Hi Scott,
- My approach right now is to call them binary outputs (bo) records, e.g. a bo record named “MYLED:IncreaseBrightness” and then just ignore the PV value itself. Then I do “caput MYLED:IncreaseBrightness
1” every time I want to increase brightness. Is that a reasonable approach?
Yes, this is exactly what is typically done. In fact, I was about to respond to your post from yesterday where you asked about how to set the value of the bo record back to 0. I was going to say that in that case the value of the bo record
is not important. You are not sending the value in the protocol, and you are probably not displaying the value in an OPI screen. You are using the bo record is as a “command” not a 2-value choice. In that case you don’t care what the value is. By writing
either 0 or 1 to the VAL field, or by writing 1 to the .PROC file you will force the record to process, and hence send the command to the device. There is no need to set the value back to 0 when the command is complete.
Mark
From: Tech-talk <tech-talk-bounces at aps.anl.gov>
On Behalf Of Feister, Scott via Tech-talk
Sent: Friday, January 5, 2024 12:48 PM
To: tech-talk at aps.anl.gov
Subject: Representing stateless device commands?
Hi EPICS community,
I searched the tech-talk forums and documentation for this answer for a long time, because I am confident it’s in there somewhere if I could just search the correct words. However, after a long search, I decided I would stop and ask the
forum.
How can I represent a command to a device (using StreamDevice) for a command that does not involve a process variable?
For example, let’s say I have a device that has a single LED. It may accept two commands over RS232 such as:
DecreaseBrightness
IncreaseBrightness
ToggleOnOff
Since these commands operate on internal states to the device rather than states we as the user can access, we don’t actually have a PV state accessible directly to put into an EPICS PV. We just want to call those methods remotely from
EPICS.
How can I basically send the above commands like I would in a Serial Terminal, but with EPICS?
My approach right now is to call them binary outputs (bo) records, e.g. a bo record named “MYLED:IncreaseBrightness” and then just ignore the PV value itself. Then I do “caput MYLED:IncreaseBrightness 1” every time I want to increase brightness.
Is that a reasonable approach?
Thanks!
Scott