I dug down in the vi last night to isolate what isn't yet working and it
turns out I'm getting timeout errors on the optomux commands
!Q (SetWatchdogDelay), !V (StoreWatchdogDelay) and !l (StoreWatchdogEnable),
and possibly !X and !W. other optomux commands in the vi, e.g.
!R (SetDiscreteWatchdogData) work fine. I tries increasing the timeout delay
(to 2 seconds) and that didn't help.
***I just found the error as I was posting the "code" below: baud rate/timeout
cluster wired to "error in" port of FPOptoOpen.vi instead of "VISA Parameters"***
Debugging is slow and somewhat painful since I am communicating to the
fieldpoint through a dial-up soda-straw and I must shut down its other
mission-critical tasks (its running a small public drinking water plant) to
debug "in vitro".
I can't get the VI to this machine to post it directly at the moment, but I can
enumerate the gist of it here. The intent is to incrementally load a desired "fail-safe" set
of channel data into the watchdog data and the power-on default data:
1) Open the port with FPOptoOpen.vi (COM4, baud=115200, timeout=2 sec)
2) SetWatchdogDelay.vi (COM4, moduleAddress=1,delay=1000=10 sec)
3) StoreWatchdogDelay.vi (COM4, moduleAddress=1,delay=1000=10 sec)
4) for each discrete channel I want to change {
(get channelMask, failSafeData for this channel -- how is not important to the discussion)
if failSafeData=1 then dataMask=channelMask else dataMask=16'b0
WriteDiscreteWithStatus.vi (COM4,
moduleAddress, positions=channelMask, Data=dataMask) << not
sure I need to do this
SetDiscreteWatchdogData.vi(COM4, moduleAddress, positions=channelMask, Data=dataMask)
StoreDiscreteWatchdogData.vi(COM4, moduleAddress, positions=channelMask, Data=dataMask)
StoreDiscrete.vi(COM4, moduleAddress, positions=channelMask, Data=dataMask)
SetWatchdogStatus.vi (COM4, moduleAddress, positions=channelMask, EnableDisableMask=channelMask)
StoreWatchdogDataStatus.vi (COM4,
moduleAddress, positions=channelMask, EnableDisableMask=channelMask)
}
5) StoreWatchdogEnable.vi (COM4, moduleAddress, delay=1000=10
sec) << I was surprised to have to wire the delay here!
6) UseSnapshot.vi(COM4, moduleAddress, snapshot="User Defined Settings")
7) StoreSnapshot.vi(COM4, moduleAddress)
8) FPOptoClose.vi(COM4)
Have I got this right? Is there extra/missing stuff or stuff done in the wrong order or a better/easier way? I will test this
again (with the miswired port fixed) as soon as I can...
BTW, these channels are in a FP-TB-10 module hanging on the FP-1001. The baud rate, timeout, module address
and channel masks I am using are known to work correctly for optomux read and write discrete VIs.
Bob