I have a device that takes 3.5 seconds to run a measurement and I don't want that some process send a command that changes a parameter while the measurement is in progress.
I am using stream device and asyn to communicate with it.
My idea was to ever send a command asking for the measurement status when the parameter is changed. If the device is busy, nothing happens. If it is idle, the parameter is changed.
As stream device has no if conditional, I used this idea in the protocol file:
in "Instrument Busy";
# We change the parameter only after we are sure that the device status
# is not "Instrument Busy".
in "Frequency stop set";
So, if the equipment sends back "Instrument Busy", the protocol match and that's it. Nothing more happens. But when the equipment sends "Instrument Ready" the @mismatch exception handler is activated and the command to change the parameter is sent.
This is working fine, but I see red warnings in the IOC shell every time the @mismatch handler is used.
So, this brings me 2 questions:
1 - Is there a way to avoid these warnings case a @mismatch is activated? For the other cases, the warnings must be shown.
2 - Is there a better way to do this with stream device? I could read the measurement status in a record, on a periodic SCAN basis, but this don't avoid the case where a parameter is changed between one scan processing and
the next, just after the measurement started. In fact I am disabling record processing of the status while the device is idle and
re-enabling after the measurement started, just to reduce the number of commands sent to the equipment.
Thank you for your suggestions.
Márcio Paduan Donadio
Control Systems Engineer
SLAC National Accelerator Laboratory
Advanced Instrumentation for Research Division
2575 Sand Hill Rd
Menlo Park CA 94025
Office (650) 926-5007