Hi,
I'd like to use asynPortDriver to connect to a serial device that pushes data when triggered by a hardware pulse.
If I use SCAN=I/O Intr and the pollThread() example code below from a previous tech-talk thread will my record be triggered to read every time there is new data? Does this code mean my driver is constantly polling the serial port at a POLL_DELAY?
I only need to read, so can I call pasynOctetSyncIO->readIt() instead?
How will I know that the serial device has finished pushing it's data for that trigger? Does asyn/pasynOctetSynIO->readIt() wait for the OutputEos in the serial buffer before returning the received message? Or is asyn waiting to read sizeof(receiveMessage) characters?
> void myPortDriver::pollThread()
> {
> while(1) {
> status = pasynOctetSyncIO->writeRead(pasynUserHMS, sendMessage, numSend,
> receiveMessage, sizeof(receiveMessage),
> WRITE_READ_TIMEOUT, &numSent, responseLen, &eomReason);
> sscanf(receiveMessage, "TEMP=%f,CURRENT=%f", &temperature, ¤t);
> setDoubleParam(temperatureParam, temperature);
> setDoubleParam(currentParam, current);
> callParamCallbacks();
> epicsThreadSleep(POLL_DELAY);
> }
> }
>
Thank you in advance for any suggestions or comments.
Nia
- Replies:
- Re: asyn w/serial device pushing data Eric Norum
- RE: asyn w/serial device pushing data Mark Rivers
- Navigate by Date:
- Prev:
Re: casStrmClient.cc error: invalid channel identifier Tim Mooney
- Next:
Re: asyn w/serial device pushing data Eric Norum
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
<2012>
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: casStrmClient.cc error: invalid channel identifier Andrew Johnson
- Next:
Re: asyn w/serial device pushing data Eric Norum
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
<2012>
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|