Hey Watchdog Fans,
For those of you wanting to keep track of PAC Display (if it’s still running) from within your PAC strategy, I tried out PilotMan’s suggestion of using the Alarm features in PAC Display. It was nice and simple and worked great! Here’s how I implemented his idea:
I have some looping OptoScript with two int32 variables used with PAC Display, and a string to show the current status.
// Initialize the value that PAC Display should set to 1
nPAC_Display_to_Increment = 0;
// set the flag which to trigger PAC Display Alarm point
// to cause increment on nPAC_Display_to_Increment
nPAC_Display_flag = 1;
DelayMsec(2500); // allow some time for the communication between the PC and PAC
if ( 0 == nPAC_Display_to_Increment ) then // nothing happened
sPAC_Display_Status = "PAC Display not responding";
else
sPAC_Display_Status = "PAC Display ok";
endif
nPAC_Display_flag = 0; // clear the flag
DelayMsec(2500); // we'll only check every 5 seconds, so allow the rest of that time to pass
For those who prefer action blocks over OptoScript, here’s a block-based chart.
Here’s the exported chart you can import if you want to save some typing:
PACDisplayMonitor.zip (1.78 KB)
In PAC Display, I selected:
Configure > Alarming Setup > Alert Window [tab]
UNcheck “Enable Alarm Point Alert Window” as shown here:
Configure > Alarm Points > Add.
Give it a name, select the nPAC_Display_flag used in above OptoScript
In: Setup By, choose Discrete
In: Notification Options, Check Alarm Enabled.
Click on the Alarm button, in Current Value choose Set, value out: 1.
Click the ? to choose the value to change (nPAC_Display_to_Increment as shown above). Click OK to close.
Click the Discrete tab, choose True/On.
When I had this all set up and running, watched sPAC_Display_Status changes as I started then stopped PAC Display. Neat-o! Thanks, PilotMan!
-OptoMary
p.s.
Here’s a little video snippet showing what this looked like in action: