Hi folks,
I'm still working on getting these Heinzinger PCU 50-300 supplies doing everything I want using EPICS. Today I thought I'd try reading the status word from the supply, so I added an mbbiDirect record. The custom sections of my .db file now read:
record(ai, "$(P)$(R)GetCurrent") {
field(DESC, "Read output current")
field(DTYP, "stream")
field(INP, "@devPCU50_300.proto getCurrent $(PORT) $(A)")
# field(SCAN, "1 second")
field(SCAN, "Passive")
# field(PINI, "YES")
field(EGU, "Amps")
field(ESLO, "0.001")
field(LINR, "SLOPE")
}
record(ao, "$(P)$(R)SetCurrent") {
field(DESC, "Write output current")
field(DTYP, "stream")
# field(SCAN, "1 second")
field(SCAN, "Passive")
field(OUT, "@devPCU50_300.proto setCurrent(%d) $(PORT) $(A)")
field(PINI, "YES")
field(VAL, "0")
# field(FLNK, "$(P)$(R)GetCurrent")
field(EGU, "Amps")
field(ESLO, "0.001")
field(LINR, "SLOPE")
}
record(mbbiDirect, "$(P)$(R)StatusRegister") {
field(DESC, "Status Register")
field(NOBT, "24")
field(DTYP, "stream")
field(INP, "@devPCU50_300.proto getStatus $(PORT) $(A)")
field(PINI, "YES")
field(SCAN, "Passive")
}
But I'm seeing some unexpected behavior, somehow related to my other records. Above, the PINI field for the GetCurrent record is commented out. When I start the IOC in this state, the StatusRegister record is properly populated. If I set PINI to YES and start the IOC, the StatusRegister record is not properly populated. Running the command 'dbtr PCU50_300testStatusRegister' on the "broken" startup will update it so that it has the correct status. I've watched the console output when launching st.cmd, and browsed the logfiles that I generated, but I can't spot what I'm doing wrong. I've attached a logfile where I have the problem, and another where I don't. My .db, .proto, and st.cmd are at: https://github.com/leblancOUAL/PCU_50-300/
I feel like the root cause is that somehow the replies to the different serial commands are getting mixed up, but I can't see how that's possible. It is more likely that I've done something silly along the way. Any hints for troubleshooting are greatly appreciated!