Hi EPICS users,
This is a very basic question regarding getting started with binary inputs, and the purpose of RVAL. (As an aside, perhaps we should anyone provide an example for a binary input (bi) similar to the “temperature:water” (ai) example from
the Getting Started guide under “Test EPICS”, at:
https://docs.epics-controls.org/projects/how-tos/en/latest/getting-started/installation.html#test-epics
My students and I have been struggling to get a simple binary input working, though I think we’ve got it now. We first tried expanding, in the above Getting Started tutorial, the “test.db” script with:
test.db:
“””
record(ai, "temperature:water")
{
field(DESC, "Water temperature in the fish tank")
}
record(bi, "isfishy")
{
field(DESC, "True if the fish tank has fish inside.")
}
“””
However, “caget isfishy” shows a blank value, and “caput isfishy 0” does not seem to change anything. This perplexed us for a while.
Looking into it further in the user docs, we landed at documentation for the binary input record:
https://epics.anl.gov/EpicsDocumentation/AppDevManuals/RecordRef/Recordref-11.html
Then, we tried modifying ZNAM and ONAM such as
test.db:
“””
record(bi, "isfishy")
{
field(DESC, "True if the fish tank has fish inside.")
field(ZNAM, "False")
field(ONAM, "True")
}
“””
And now we can do “caput isfishy 1” and all “caget isfishy” prints with “True”, as does “caget isfishy.VAL”. However, I noticed that “caget isfishy.RVAL” still gives 0.
So here’s my question: Is this zero in RVAL expected even though the Boolean is now
True, and why? Thanks!
Scott