This commit is contained in:
Anders Sandstrom
2022-02-02 11:55:01 +01:00
parent be9ebea829
commit f32dd2ada2
7 changed files with 966 additions and 1575 deletions

View File

@@ -45,17 +45,6 @@ volatile uint8_t sys_rt_exec_accessory_override; // Global realtime executor bit
volatile uint8_t sys_rt_exec_debug;
#endif
// Start worker for socket read()
void f_worker_read(void *obj) {
if(!obj) {
printf("%s/%s:%d: GRBL: ERROR: Worker read thread ecmcGrbl object NULL..\n",
__FILE__, __FUNCTION__, __LINE__);
return;
}
ecmcGrbl * grblObj = (ecmcGrbl*)obj;
grblObj->doReadWorker();
}
// Thread that writes commands to grbl
void f_worker_write(void *obj) {
if(!obj) {
@@ -154,13 +143,7 @@ ecmcGrbl::ecmcGrbl(char* configStr,
throw std::out_of_range("GRBL: ERROR: No valid axis choosen.");
}
//// Create worker thread for reading socket
//std::string threadname = "ecmc.grbl.read";
//if(epicsThreadCreate(threadname.c_str(), 0, 32768, f_worker_read, this) == NULL) {
// throw std::runtime_error("Error: Failed create worker thread for read().");
//}
// Create worker thread for main grbl loop
// Create worker thread for main grbl loop
std::string threadname = "ecmc.grbl.main";
if(epicsThreadCreate(threadname.c_str(), 0, 32768, f_worker_main, this) == NULL) {
throw std::runtime_error("GRBL: ERROR: Failed create worker thread for main().");
@@ -254,21 +237,6 @@ void ecmcGrbl::parseConfigStr(char *configStr) {
}
}
// Read socket worker
void ecmcGrbl::doReadWorker() {
// // simulate serial connection here (need mutex)
// if(cfgDbgMode_){
// printf("%s:%s:%d\n",__FILE__,__FUNCTION__,__LINE__);
// }
// for(;;) {
// //while(serial_get_tx_buffer_count()==0) {
// // delay_ms(1);
// //}
// //printf("%c",ecmc_get_char_from_grbl_tx_buffer());
// delay_ms(100);
// }
}
// Write socket worker
void ecmcGrbl::doWriteWorker() {
// simulate serial connection here (need mutex)

View File

@@ -63,7 +63,6 @@ class ecmcGrbl : public asynPortDriver {
double exeSampelTimeMs);
~ecmcGrbl();
void doReadWorker();
void doMainWorker();
void doWriteWorker();
void addCommand(std::string command);

View File

@@ -47,7 +47,7 @@ epicsEnvSet("ECMC_TRAJ_TYPE", "1") # Trapetz:
epicsEnvSet("ECMC_VELO", "1000.0")
epicsEnvSet("ECMC_JOG_VEL", "3600")
epicsEnvSet("ECMC_JAR", "0.0") # JAR defaults to VELO/ACCL
epicsEnvSet("ECMC_ACCS_EGU_PER_S2", "1000")
epicsEnvSet("ECMC_ACCS_EGU_PER_S2", "100")
epicsEnvSet("ECMC_EMERG_DECEL", "1000") # Emergency deceleration
epicsEnvSet("ECMC_JERK", "1000") # Only valid for ECMC_TRAJ_TYPE==1

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -36,7 +36,7 @@ ${SCRIPTEXEC} ${ecmccfg_DIR}addSlave.cmd, "SLAVE_ID=$(ECMC_EC_SLAVE_NUM), HW_DES
# Apply local 24V config (local here)
${SCRIPTEXEC} ${ecmccfg_DIR}applySlaveConfig.cmd, "LOCAL_CONFIG=./ecmcEL7211-0010-Motor-Beckhoff-AM8121-0F00-0000_24V.cmd"
#Apply hardware configuration (wronmg here, should only be caööed once)
#Apply hardware configuration (wrong here, should only be done once (also done in ecmcMCU1021_coupler), but will work)
ecmcConfigOrDie "Cfg.EcApplyConfig(1)"
#Does not work. Known issue DC-patch for etherlab manster needed...
@@ -82,12 +82,12 @@ epicsEnvSet("PLUGIN_VER" ,"develop")
require ecmc_plugin_grbl $(PLUGIN_VER)
epicsEnvSet(ECMC_PLUGIN_FILNAME,"/home/pi/epics/base-7.0.5/require/${E3_REQUIRE_VERSION}/siteMods/ecmc_plugin_grbl/$(PLUGIN_VER)/lib/${EPICS_HOST_ARCH=linux-x86_64}/libecmc_plugin_grbl.so")
epicsEnvSet(ECMC_PLUGIN_CONFIG,"DBG_PRINT=0;X_AXIS=1;Y_AXIS=2;SPINDLE_AXIS=3;AUTO_ENABLE=1;AUTO_START=1;") # Only one option implemented in this plugin
epicsEnvSet(ECMC_PLUGIN_CONFIG,"DBG_PRINT=0;X_AXIS=1;Y_AXIS=2;SPINDLE_AXIS=3;AUTO_ENABLE=1;AUTO_START=0;") # Only one option implemented in this plugin
${SCRIPTEXEC} ${ecmccfg_DIR}loadPlugin.cmd, "PLUGIN_ID=0,FILE=${ECMC_PLUGIN_FILNAME},CONFIG='${ECMC_PLUGIN_CONFIG}', REPORT=1"
epicsEnvUnset(ECMC_PLUGIN_FILNAME)
epicsEnvUnset(ECMC_PLUGIN_CONFIG)
ecmcGrblLoadFile("./cfg/test.nc",0)
ecmcGrblLoadFile("./plc/test.nc",0)
#ecmcGrblAddCommand("G1X20Y20F360");
#ecmcGrblAddCommand("G4P2");