forked from epics_driver_modules/motorBase
set a default Input/output EOS and allow to override in st.cmd
This commit is contained in:
@@ -7,9 +7,9 @@ Please note:
|
||||
- MAXnet cards with firmware versions older than 1.33.4 shouldn't be used
|
||||
with the ethernet port. They abort communication, if they detect a tcp packet
|
||||
with checksum 0xffff.
|
||||
- MAXnet cards with firmware versions below 1.33 use "\n\r" as input EOS
|
||||
on Ethernet ports. Version 1.33 and higher use "\n" on ethernet and serial ports.
|
||||
The input and output EOS must be set prior to calling omsMAXnetConfig()
|
||||
- Input EOS defaults to "\n\r", output EOS defaults to "\n".
|
||||
Since this may not fit every combination of firmware version and serial/IP selection,
|
||||
it can be set by calling asynOctetSet[In|Out]putEos prior to calling omsMAXnetConfig()
|
||||
|
||||
add this to st.cmd if using the ethernet port:
|
||||
drvAsynIPPortConfigure("MAXNET","maxnet-ip-address:23",0,0,0)
|
||||
|
||||
@@ -88,6 +88,8 @@ omsMAXnet::omsMAXnet(const char* portName, int numAxes, const char* serialPortNa
|
||||
notificationMutex = new epicsMutex();
|
||||
notificationCounter = 0;
|
||||
useWatchdog = true;
|
||||
char eosstring[5];
|
||||
int eoslen=0;
|
||||
|
||||
serialPortName = epicsStrDup(serialPortName);
|
||||
|
||||
@@ -128,7 +130,17 @@ omsMAXnet::omsMAXnet(const char* portName, int numAxes, const char* serialPortNa
|
||||
timeout = 2.0;
|
||||
pasynUserSerial->timeout = 0.0;
|
||||
|
||||
// Set input and output EOS in st.cmd
|
||||
// to override default setting, set input and output EOS in st.cmd
|
||||
if (pasynOctetSyncIO->getInputEos(pasynUserSyncIOSerial, eosstring, 5, &eoslen) == asynSuccess) {
|
||||
if (eoslen == 0)
|
||||
if (pasynOctetSyncIO->setInputEos(pasynUserSyncIOSerial, "\n\r", 2) != asynSuccess)
|
||||
printf("MAXnetConfig: unable to set InputEOS %s: %s\n", serialPortName, pasynUserSyncIOSerial->errorMessage);
|
||||
}
|
||||
if (pasynOctetSyncIO->getOutputEos(pasynUserSyncIOSerial, eosstring, 5, &eoslen) == asynSuccess) {
|
||||
if (eoslen == 0)
|
||||
if (pasynOctetSyncIO->setOutputEos(pasynUserSyncIOSerial, "\n", 1) != asynSuccess)
|
||||
printf("MAXnetConfig: unable to set OutputEOS %s: %s\n", serialPortName, pasynUserSyncIOSerial->errorMessage);
|
||||
}
|
||||
|
||||
void* registrarPvt= NULL;
|
||||
status = pasynOctetSerial->registerInterruptUser(octetPvtSerial, pasynUserSerial, omsMAXnet::asynCallback, this, ®istrarPvt);
|
||||
|
||||
Reference in New Issue
Block a user