Hey there,
Thanks for taking a look. The theory and practice I use the ASYN /
StreamDevice for is as follows. I use the an IDN record and function to
query the device name, once every 10 seconds. In an Agilent WFG for
example. I have a separate periodic scan record that queries/sets the
device qualities.
In the IDN portion of the proto file I execute a 'dbpf SOMERECORD 1'
and a
reply timeout exception of 'dbpf SOMERECORD 0'. It acts like a ping. I
then use that bit in epics to drive the DISV / DISA / SDIS, of a common
scan record.
So if my Agilent WFG is turned off, then I stop trying to read/write the
device qualities. But the IDN still checks. So if someone comes and
turns
the WFG on, epics starts reading and writing the qualities again.
It's nice because it cleans up unnecessary (and polled typically) network
traffic as well limits the number of error messages generated, and lastly
stops an IOC from processing things unnecessarily.
I tried this with GPIB devices, but I don't get exception code called in
the proto file.
Here is the record text that is relevant, I can send you attached
complete
ones if you like. The ALIVE record referenced below in the proto is a
simple calc record.
[ the record .... ]
record(stringin,"HEBT:SCOPE1:IDN") {
field(DESC,"string input record")
field(SCAN,"10 second")
field(PINI,"YES")
field(PHAS,"0")
field(EVNT,"0")
field(DTYP,"stream")
field(DISV,"1")
field(SDIS,"0.000000000000000e+00")
field(DISS,"NO_ALARM")
field(PRIO,"LOW")
field(FLNK,"0.000000000000000e+00")
field(VAL,"string")
field(INP,"@tektds8000.proto IDN(HEBT:SCOPE1) GPIB0 10")
field(SIOL,"0.000000000000000e+00")
field(SIML,"0.000000000000000e+00")
field(SIMS,"NO_ALARM")
}
[ the proto that fails to call the exception exec.... ]
IDN {
InTerminator = LF;
@init {
out "HEADER OFF";
out "*IDN?";
# in "%s %s";
in "%64c";
}
out "*IDN?";
# in "%s %s";
in "%64c";
# Added by James Larsson Oct. 5 2017 to throttle ASYN Error Messages
exec "dbpf \$1:ALIVE.A 0";
@replytimeout
{
exec "dbpf \$1:ALIVE.A 1 ";
}
}
[ the proto that crashes the IOC (just a @writetimeout delta).... ]
IDN {
InTerminator = LF;
@init {
out "HEADER OFF";
out "*IDN?";
# in "%s %s";
in "%64c";
}
out "*IDN?";
# in "%s %s";
in "%64c";
# Added by James Larsson Oct. 5 2017 to throttle ASYN Error Messages
exec "dbpf \$1:ALIVE.A 0";
@writetimeout
{
exec "dbpf \$1:ALIVE.A 1 ";
}
}
[The script portion that configures the GPIB device: and the '.....'
are mine
.....]
asynSetOption("GPIB0",10,0x0c,0)
.....
asynSetTraceIOMask(GPIB0,10,0x0005)
asynSetTraceMask (GPIB0,10,0x001f)
.....
dbLoadRecords("asynRecord.db","P=HEBT:SCOPE1:,R=ASYN,PORT=GPIB0,ADDR=2,IMAX=0,OMAX=0")
....
asynSetTraceMask (GPIB0,10,0x0000)
asynSetTraceIOMask(GPIB0,10,0x0000)
Cheers and Thanks again!
James Larsson, P.Eng.
Triumf Control Systems Engineer
Hello James,
I am back from ICALEPCS, thus I can start debugging your StreamDevice
problem.
In order to reproduce your problem, I need some more information from
you.
Please send me:
* The part of your startup script where you configure the GPIB device
* The record that causes the crash
* The protocol file used by this record.
Best regards,
Dirk
On 06.10.2017 17:40, [email protected] wrote:
Hey hey!
I have a device on my Linux IOC, using Asyn GPIB. The device works on
the
IOC and, connected with EDM - is controllable.
When the device is turned off I get an error message: asynError in
write:
GPIB0 writeGpib failed ENOL 2: No listeners
The function in the proto file uses exception @replytimeout, but that
never executes, which I would expect (I queried a device, it's not
there,
I should have a timeout). This works on TCP/IP devices, just not GPIB.
Does anyone have any thoughts, or hacks, or updates on getting GPIB
exceptions to run the proto file exception commands?
Also when I try using the @writetimeout exception to more closely mimic
the error message, the IOC crashes on boot, not even an IOC command
prompt, which looks like a separate problem, any help on that would
also
be appreciated. Error message is:
A call to 'assert(dbLockIsInitialized)'
by thread 'cbLow' failed in ../dbLock.c line 239.
EPICS Release EPICS R3.14.11 $R3-14-11$ $2009/08/28 18:47:36$.
Local time is 2017-10-06 08:13:40.495885987 PDT
Please E-mail this message to the author or to [email protected]
Calling epicsThreadSuspendSelf()
Thread cbLow (0x9a12518) suspended
Cheers
James Larsson