Pop-up Screen Flashing

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!
Parents
  • Thank you for your response. I am relatively new to IWS so I haven't had a chance to look into Graphics scripting at all.

    I am wondering now if I need to keep the logic I have in place in the Tasks for opening the screen (using the local variable as a toggle) like I currently have, but within the graphics script, toggle that local tag on open and close?

    So something to the effect of:

    Tasks - Open screen when either Robot tag is True AND the toggle bit is off.

    Graphics Script - Set the bit to On when the screen opens so the task cannot try to reopen it. Set the bit to Off when the screen closes.

    Screen Script - Close the screen when Both tags are False AND the toggle bit is On.

    I'm going to keep looking into this method further, but I definitely appreciate any input.

    Edit: I see that the Graphics Scripting has the WhileRunning function. I think this is where I need to handle my code since I want the screen to pop up at any time if the tag goes true.

    Thanks!
Reply
  • Thank you for your response. I am relatively new to IWS so I haven't had a chance to look into Graphics scripting at all.

    I am wondering now if I need to keep the logic I have in place in the Tasks for opening the screen (using the local variable as a toggle) like I currently have, but within the graphics script, toggle that local tag on open and close?

    So something to the effect of:

    Tasks - Open screen when either Robot tag is True AND the toggle bit is off.

    Graphics Script - Set the bit to On when the screen opens so the task cannot try to reopen it. Set the bit to Off when the screen closes.

    Screen Script - Close the screen when Both tags are False AND the toggle bit is On.

    I'm going to keep looking into this method further, but I definitely appreciate any input.

    Edit: I see that the Graphics Scripting has the WhileRunning function. I think this is where I need to handle my code since I want the screen to pop up at any time if the tag goes true.

    Thanks!
Children
No Data