EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Anyone using StreamDevice with local serial ports on Windows?
From: Mark Rivers <[email protected]>
To: "'Oleg A. Makarov'" <[email protected]>, Eric Norum <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Tue, 26 Nov 2013 23:12:36 +0000

I think waiting for some event could be simulated with “SCAN=0.1 second” and a timeout of -1.  That will do a read with an infinite timeout.  Once a message is received it will do another read within 0.1 second.  Note that it is not “polling” every 0.1 second, it is just queuing again within 0.1 second, so it is not inefficient.  If you are using the asynInterposeEos interface then the read will only complete when the desired terminator has been received.

 

The only problem I can see is if messages are coming faster than 10 Hz.

 

Mark

 

 

From: Oleg A. Makarov [mailto:[email protected]]
Sent: Tuesday, November 26, 2013 5:07 PM
To: Eric Norum
Cc: Mark Rivers; [email protected]
Subject: Re: Anyone using StreamDevice with local serial ports on Windows?

 

Eric,

your suggestion is good for "send_request - get_response"  scenario.
It cannot be used for "waiting_for_some_event_message" scenario.

Oleg Makarov

On 11/26/2013 12:28 PM, Eric Norum wrote:

I don't think that asynOctet has support for SCAN="I/O Intr" like that.   Why not make the input record passive and FLNK the output record to it?

-- 

Eric Norum


On Nov 26, 2013, at 7:16 PM, "Oleg A. Makarov" <[email protected]> wrote:

Mark,

I have an AsynOctet problem on Linux IOC: waveform PV does not get updated with a scan field set to "I/O Intr".
Below are the results of an IOC test with serial port /dev/ttyS2 connected to the PMAC motion controller.

IOC has two waveform PVs:

record(waveform,"devWfAsynWrite")
{
    field(DTYP,"asynOctetWrite")
    field(INP,"@asyn($(PORT),$(ADDR),$(TMO))")
    field(NELM,"255")
    field(FTVL,"CHAR")
}

record(waveform,"devWfAsynRead")
{
    field(DTYP,"asynOctetRead")
    field(INP,"@asyn($(PORT),$(ADDR),$(TMO))")
    field(NELM,"255")
    field(FTVL,"CHAR")
    field(TSE,  "$(TSE)")
    field(SCAN,"I/O Intr")
}

with the request (dbpf devWfAsynWrite "version<cr>") written to the devWfAsynWrite PV one would expect devWfAsynRead PV will get an answer value from PMAC motion controller in a fraction of a second, but this does not happen. Then after a 5-second delay with "dbpf devWfAsynRead.PROC 1" command forcing devWfAsynRead PV to process, it gets value supplied by the PMAC motion controller (1.940  \r\006\006).

Am I missing some settings in /dev/ttyS2 setup or is there a bug in AsynOctet?

Oleg Makarov


> ./st.cmd
#!../../bin/linux-x86_64/fsen
## You may have to change fsen to something else
## everywhere it appears in this file
< envPaths
epicsEnvSet("ARCH","linux-x86_64")
epicsEnvSet("IOC","iocfsen")
epicsEnvSet("TOP","/mnt/share3/gmca/epics_synApps/synApps_5_6/f_sens")
epicsEnvSet("ASYN","/mnt/share3/gmca/epics_synApps/synApps_5_6/asyn-4-22")
epicsEnvSet("EPICS_BASE","/usr/local/epics/base")
epicsEnvSet EPICS_CAS_BEACON_ADDR_LIST "164.54.103.63"
cd /mnt/share3/gmca/epics_synApps/synApps_5_6/f_sens
## Register all support components
dbLoadDatabase dbd/fsen.dbd
fsen_registerRecordDeviceDriver pdbbase
## drvAsynSerialPortConfigure portName ttyName priority noAutoConnect noProcessEos
drvAsynSerialPortConfigure Serial2 "/dev/ttyS2" 0 0 0
## asynSetOption portName addr key value
asynSetOption Serial2 -1 baud "38400"
asynSetOption Serial2 -1 bits "8"
asynSetOption Serial2 -1 parity none
asynSetOption Serial2 -1 stop "1"
asynSetOption Serial2 -1 clocal Y
asynSetOption Serial2 -1 crtscts "Y"
## asynOctetSetOutputEos portName addr eos
"synOctetSetOutputEos Serial2 -1 "
## asynOctetSetInputEos portName addr eos
asynOctetSetInputEos Serial2 -1 ""
## asynSetTraceFile portName addr filename
asynSetTraceFile Serial2 -1 ""
# traceMask definitions
#ASYN_TRACE_ERROR     0x0001
#ASYN_TRACEIO_DEVICE  0x0002
#ASYN_TRACEIO_FILTER  0x0004
#ASYN_TRACEIO_DRIVER  0x0008
#ASYN_TRACE_FLOW      0x0010
#ASYN_TRACE_WARNING   0x0020
## asynSetTraceMask portName addr mask
asynSetTraceMask Serial2 -1 0x018
# traceIO mask definitions
#ASYN_TRACEIO_NODATA 0x0000
#ASYN_TRACEIO_ASCII  0x0001
#ASYN_TRACEIO_ESCAPE 0x0002
#ASYN_TRACEIO_HEX    0x0004
## asynSetTraceIOMask portName addr mask
asynSetTraceIOMask Serial2 -1 0x2
# traceInfo mask definitions
#ASYN_TRACEINFO_TIME 0x0001
#ASYN_TRACEINFO_PORT 0x0002
#ASYN_TRACEINFO_SOURCE 0x0004
#ASYN_TRACEINFO_THREAD 0x0008
## asynSetTraceInfoMask portName addr mask
asynSetTraceInfoMask Serial2 -1 0x5
## Load record instances
## dbLoadRecords 'file name' substitutions
dbLoadRecords db/fsen.db "P=23d:,PORT=Serial2,ADDR=-1,TMO=1,TSE=0"
cd /mnt/share3/gmca/epics_synApps/synApps_5_6/f_sens/iocBoot/iocfsen
iocInit
Starting iocInit
############################################################################
## EPICS R3.14.12.3 $Date: Mon 2012-12-17 14:11:47 -0600$
## EPICS Base built Aug 29 2013
############################################################################
2013/11/26 11:36:32.113 [../../asyn/devEpics/devAsynOctet.c:235] devWfAsynRead devAsynOctet::getIoIntInfo registering interrupt
2013/11/26 11:36:32.113 [../../asyn/interfaces/asynOctetBase.c:302] Serial2 -1 registerInterruptUser
iocRun: All initialization complete
epicsThreadSleep 2
asynReport
Serial2 multiDevice:No canBlock:Yes autoConnect:Yes
Serial line /dev/ttyS2: Connected
epicsThreadSleep 2
"bpf devWfAsynWrite "version
2013/11/26 11:36:36.615 [../../asyn/asynDriver/asynManager.c:1509] Serial2 addr -1 queueRequest priority 1 not lockHolder
"         ]:         "version
epicsThreadSleep 5
2013/11/26 11:36:36.615 [../../asyn/asynDriver/asynManager.c:855] asynManager::portThread port=Serial2 callback
2013/11/26 11:36:36.615 [../../asyn/drvAsynSerial/drvAsynSerialPort.c:627] /dev/ttyS2 write.
2013/11/26 11:36:36.615 [../../asyn/drvAsynSerial/drvAsynSerialPort.c:629] /dev/ttyS2 write 10
version\r\000\r
2013/11/26 11:36:36.615 [../../asyn/drvAsynSerial/drvAsynSerialPort.c:697] wrote 10 to /dev/ttyS2, return asynSuccess
dbpf devWfAsynRead.PROC 1
2013/11/26 11:36:41.615 [../../asyn/asynDriver/asynManager.c:1509] Serial2 addr -1 queueRequest priority 1 not lockHolder
DBR_UCHAR:          1         0x1                
2013/11/26 11:36:41.615 [../../asyn/asynDriver/asynManager.c:855] asynManager::portThread port=Serial2 callback
2013/11/26 11:36:41.615 [../../asyn/drvAsynSerial/drvAsynSerialPort.c:715] /dev/ttyS2 read.
2013/11/26 11:36:41.615 [../../asyn/drvAsynSerial/drvAsynSerialPort.c:795] /dev/ttyS2 read 10
1.940  \r\006\006
2013/11/26 11:36:41.615 [../../asyn/drvAsynSerial/drvAsynSerialPort.c:827] /dev/ttyS2 read 10, return 0
epics>

On 11/25/2013 6:31 PM, Mark Rivers wrote:

I found and fixed a problem in drvAsynSerialPortWin32.c.  When pasynUser->timeout was 0 for a read operation, and the number of characters available to read was 0, it was returning asynSuccess.  This is incorrect, it should return asynTimeout.  Dirk also found a problem that when pasynUser->timeout was 0 it was not returning immediately.

 

With these fixes StreamDevice works correctly with local serial ports on WIN32.

 

These fixes will be in the next release of asyn, R4-23.

 

Mark

 

 

 

From: Mark Rivers
Sent: Sunday, November 24, 2013 12:25 PM
To: [email protected]
Subject: Anyone using StreamDevice with local serial ports on Windows?

 

Folks,

 

I am trying to use StreamDevice with a local serial port on win32-x86.  It is not working.  I’d like to know if the problem is specific to my setup.

 

Has anyone else used StreamDevice with local serial ports on win32-x86 or windows-x64?

 

Thanks,

Mark

 

 

 

 


Replies:
RE: Anyone using StreamDevice with local serial ports on Windows? Mark Rivers
References:
Anyone using StreamDevice with local serial ports on Windows? Mark Rivers
RE: Anyone using StreamDevice with local serial ports on Windows? Mark Rivers
Re: Anyone using StreamDevice with local serial ports on Windows? Oleg A. Makarov
Re: Anyone using StreamDevice with local serial ports on Windows? Eric Norum
Re: Anyone using StreamDevice with local serial ports on Windows? Oleg A. Makarov

Navigate by Date:
Prev: Re: Anyone using StreamDevice with local serial ports on Windows? Oleg A. Makarov
Next: RE: Anyone using StreamDevice with local serial ports on Windows? Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Anyone using StreamDevice with local serial ports on Windows? Oleg A. Makarov
Next: RE: Anyone using StreamDevice with local serial ports on Windows? Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·