Hello,
I'm new to EPICS and I've been trying to write some simple programs just
to get to know the software.
Let me start with the database records I'm currently using:
record(bi,"$(user):goSub0") {
field(DESC,"Start Subroutine0")
field(DTYP,"Soft Channel")
field(FLNK,"$(user):stopsub")
field(ZNAM,"Go0")
field(ONAM,"Nogo0")
}
record(bi,"$(user):goSub1") {
field(DESC,"Start Subroutine1")
field(DTYP,"Soft Channel")
field(FLNK,"$(user):stopsub")
field(ZNAM,"Go1")
field(ONAM,"Nogo1")
}
record(sub,"$(user):stopsub") {
field(DESC,"SimpleTest")
field(INAM,"SubInit")
field(SNAM,"TestPrint")
field(INPA,"$(user):goSub0.VAL")
field(INPB,"$(user):goSub1.VAL")
}
The idea is, whenever any of the goSubx changes the TestPrint function
should be called. I'm using MEDM to create a simple GUI, where a button
(Message Button) has its Control Channel set to goSubx.VAL with the press
message set to 1.
As far as I know, this changes the value of goSub whenever I press the
button.
The question is, having the TestPrint function:
long TestPrint(struct subRecord *psu) {
return 0;
}
how can I determine which button was pressed? I wanted to check both
inputs and see which goSubx.VAL == 1 but I don't know how to get to the
biRecord pointer using the subRecord pointer. Is there any way to do this?
Thanks in advance for your help.
Kind Regards,
Pawel Predki