Hello all,
I created a screen that is scripted such that when either one of two tags become true (an alarm from a robot), the screen will pop up. It is also scripted to automatically close the screen when BOTH of the tags become false.
The issue I'm having is that when either tag is true, the screen flashes (almost like it is reopening every cycle). The logic is very simple, but it seems that there is a better way. In Tasks, I have an independent script as follows:
//If $Fanuc1_HMI.LT_BatteryAlarm = True Or $Fanuc2_HMI.LT_BatteryAlarm = True Then
// $Open("RobotBatteryAlarm")
//End If
In the Screen Script, I have the following:
//Sub Screen_WhileOpen()
//
// If $Fanuc1_HMI.LT_BatteryAlarm = False And $Fanuc2_HMI.LT_BatteryAlarm = False Then
// $Close("RobotBatteryAlarm")
// End If
//
//End Sub
Is there a better way to do this where the screen won't flash or flicker? I was thinking about adding some logic in the task where if the screen is already opened, not to try to reopen it, but I'm not sure of the best way to do this. Maybe use a local tag which is set when the screen opens, and if that tag is True, have something like:
//If ($Fanuc1_HMI.LT_BatteryAlarm = True Or $Fanuc2_HMI.LT_BatteryAlarm = True) And ExampleScreenTag = False Then
// ExampleScreenTag = True
// $Open("RobotBatteryAlarm")
//End If
Along with the logic in the closing portion to set it back to false like:
//Sub Screen_WhileOpen()
// If $Fanuc1_HMI.LT_BatteryAlarm = False And $Fanuc2_HMI.LT_BatteryAlarm = False Then
// ExampleScreenTag = False
// $Close("RobotBatteryAlarm")
// End If
//
//End Sub
Thanks!