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  2013  2014  2015  2016  2017  <20182019  2020  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  <20182019  2020 
<== Date ==> <== Thread ==>

Subject: More streamDevice and Asyn issues...
From: Rod Nussbaumer <bomr@triumf.ca>
To: tech-talk@aps.anl.gov
Date: Wed, 24 Jan 2018 14:59:59 -0800
Hi All, again

Yesterday, I submitted a question regarding the use of streamDevice+asyn, and this is a different question, primarily a streamDevice one. It relates to parsing data into a waveform record where the record is configured to use FTVL "STRING". According to the Record Reference Manual, the data should somehow be stored as strings of maximum length 40. I cannot seem to make that happen with the streamDevice configuration, but rather it just wants to be stored as one long string, undelimited.

To complicate matters, the input data (serial via FTDI USB interface) are formated in a somewhat pathological way; it uses a sequence of key-value pairs (I really only want the 'value' part), where each of the pairs are separated from the other pairs using '\x0a' (linefeed). The keys and values are separated from each other by ':' (colon) in each key-value pair. There is an overall single character start and end delimiter for each transmission. A single transmission includes 17 of these key-value pairs, and an overall length of about 350-400 bytes, depending somewhat on the specific values sent. Some data are strings with embedded whitespace, some are null, and some are numeric type, both integer and floating point formats.

I have tried many different protocol configurations, and I'm never able to get the waveform record to populate with more than one STRING element. That one element is always the minimum of the waveform NELM field, or the size in bytes of the string data read on the asyn port.

Also, I cannot seem to be able to use any regex expressions in the protocols. As soon as it sees the %/ or the %#, it complains. I seem to remember not having a problem with regex usage before. I'm hoping to be able to use it to suppress the leading 'keys' in the data.


-------------------< IOC load and init >------------------------

############################################################################
## EPICS R3.14.12.2 $Date: Mon 2011-12-12 14:09:32 -0600$
## EPICS Base built Jan 18 2018
############################################################################
2018/01/24 14:19:15.051403 _main_ No converter registered for format '%/'
2018/01/24 14:19:15.051480 _main_ ocemfgc3_poll.proto line 56: in format string: "%#/.+://" 2018/01/24 14:19:15.051492 _main_ ocemfgc3_poll.proto line 56: in command 'in' 2018/01/24 14:19:15.051503 _main_ ocemfgc3_poll.proto line 52: in protocol 'rd_poll' 2018/01/24 14:19:15.051519 _main_ while compiling protocol 'RD_POLL' for 'CYC:MM:POLL'
2018/01/24 14:19:15.051529 _main_ CYC:MM:POLL: Protocol parse error
2018/01/24 14:19:15.051539 _main_ CYC:MM:POLL: Record initialization failed
iocRun: All initialization complete
# exit
mmpsioc1>e2018/01/24 14:19:17.052128 scan2 CYC:MM:POLL: Record not initialised correctly


The application was built with PCRE included:

ldd /usr1/local/epics/iocApp/genericStreamApp/devel/bin/linux-x86_64/genericStream
        linux-vdso.so.1 (0x00007ffdd65b8000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f132c5b0000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f132c390000) libreadline.so.6 => /lib/x86_64-linux-gnu/libreadline.so.6 (0x00007f132c140000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f132bf38000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f132bd30000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f132ba20000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f132b718000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f132b500000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f132b150000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f132c820000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f132af20000)

EPICS 3.14.12.2, streamDevice latest from github, asyn 4-22.
Debian Linux ver 8.


---------------< Protocol file >------------------
InTerminator  = ';';
OutTerminator = ';';
LockTimeout  = 2000;
ReplyTimeout = 1000;
ReadTimeout  =  500;


RD_POLL {
    Separator = "\x0a";

    out "!G POLL";
    in '%#/.+://';
    in "$%500c";
    in ";"

}


---------------< DB file >-----------------
record(waveform,"CYC:MM:POLL"){
	field(DESC,"waveform record")
	field(DTYP,"stream")
	field(INP,"@ocemfgc3_poll.proto RD_POLL $(PORT)")
	field(SCAN,"2 second")
	field(FTVL,"STRING")
	field(NELM,"1000")
}

---------------< Sample Data >------------------
Leading delimiter = '$', trailing delimiter = ';'
Lines delimited by '\x0a'.

$TIME_NOW:260249.009010
FAULTS:
WARNINGS:FGC_HW SIMULATION
ST_LATCHED:DIMS_EXP_FLT ID_FLT
ST_UNLATCHED:PC_PERMIT LOW_CURRENT
STATE_OP:SIMULATION
STATE_PC:OFF
ST_ADC_A:V_MEAS_OK IN_USE
ST_ADC_B:V_MEAS_OK IN_USE
ST_ADC_C:V_MEAS_OK
ST_ADC_D:V_MEAS_OK
T_DCCT_A:
ST_DCCT_B:
REF_I:0.0000000E+00
REF_V:0.0000000E+00
MEAS_I:-2.4354238E+00
MEAS_V:-4.0542068E-03;

Once again, is this do-able? What I'm reading says yes, but it is one of those fringe applications where things aren't very conventional.

Thanks for your help on this one.

Rod Nussbaumer
TRIUMF,
Vancouver, Canada.


Replies:
Re: More streamDevice and Asyn issues... Eric Norum

Navigate by Date:
Prev: Re: device support for bidirectional records Michael Davidsaver
Next: Re: More streamDevice and Asyn issues... 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  <20182019  2020 
Navigate by Thread:
Prev: Re: device support for bidirectional records Michael Davidsaver
Next: Re: More streamDevice and Asyn issues... 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  <20182019  2020 
ANJ, 24 Jan 2018 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·