I am working to simulate a SCPI type device with an IOC. I am using I/O Intr records to read in the SCPI and set the state of the mbbi record. The IOC should return ERROR if an error occurs, such as if an invalid state is requested. I
can see the error message in the IOC when an invalid state is requested, but do not know how to capture the error in the protocol file or db setup to send a return string of “ERROR”.
The error I get is when sending the IOC “SYSTEM:STATE MONITOR” is: ’… RCV_STATE: Record does not accept input "MONITOR"’
Proto definition:
readSystemState
{
in "SYSTEM:STATE %s";
out "%(\$1)s";
}
Record definition:
record(mbbi, "RCV_STATE")
{
field(DESC, "SYSTEM:STATE P01")
field(DTYP, "stream")
field(SCAN, "I/O Intr")
field(INP, "@simCmd.proto readSystemState(STATE_RTN) $(PORT) 0")
field(ZRST, "STANDBY")
field(ZRVL, "0")
field(ONST, "OPERATE")
field(ONVL, "1")
field(TWST, "SELFTEST")
field(TWVL, "2")
field(UNSV, "INVALID")
}
record(bi, " STATE_RTN ")
{
field(DESC, "State Return")
field(DTYP, "Soft Channel")
field(SCAN, "Passive")
field(ZNAM, "OK")
field(ONAM, "ERROR")
field(VAL, 0)
field(PINI, 1)
}
Patrick Barrett
Software Engineer
The Boeing Company