set a default Input/output EOS and allow to override in st.cmd

This commit is contained in:
Jens Eden
2014-12-17 14:17:56 +00:00
parent 288ba61a4f
commit bb0926f60b
2 changed files with 16 additions and 4 deletions
+3 -3
View File
@@ -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)
+13 -1
View File
@@ -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, &registrarPvt);