0

Text Change Event?

I have multiple screens displaying text, which is defined as user variables in Live Text objects. 

I have just set up a plugin script that reads the value of the variables in a "master" presentation on one display, then broadcasts those values to the entire subnet as UDP messages, which updates the text on any displays with the same user variables defined. This allows me to change the variables on one display via the BrightSign iOS app and have those changes reflected on all our displays.

At the moment, I am using a 3-second timeout event to trigger the plugin. This works fine, but the text on the other displays occasionally flashes as it is refreshed by the script, even though the variables' values have not changed.

As I see it, I have three options:

1: Live with the flashing.

2: Double the number of variables to have a "current" and "new" version of each, then modify my script, or use conditional targets, to only broadcast the UDP commands when the "current" and "new" values differ.

3: Trigger the script with a "Text Change" event. If such an event exists.

 

Does updating User Variable text in a Live Text object via the BrightSign app generate an event that I can use to trigger my plugin script?

7 comments

  • 0
    Avatar
    Lyndon

    So, every three seconds you send udp commands to your other units with the variable value? Is there one variable being updated?

  • 0
    Avatar
    W Buchanan

    >So, every three seconds you send udp commands to your other units with the variable value?

    That's correct.

    >Is there one variable being updated?

    Three variables, all used in a single Live Text object.

  • 0
    Avatar
    W Buchanan

    REPOSTING FOR CLARIFICATION

    ------------------------------------------------

    >So, every three seconds you send udp commands to your other units with the variable value?

    That's correct.

    >Is there one variable being updated?

    Three variables, all used in a single Live Text object.

    The plugin script handles one variable at a time. The timeout event sends a separate plugin message for each variable, passing the variable name as the plugin argument.

    The script is a modified version of the getvar.brs script provided by BrightSign Support to another user in these forums. The original script was posted in this discussion:

    http://support.brightsign.biz/entries/30008250-Answer-to-a-UDP-query-sending-the-valor-of-a-User-Variable

  • 0
    Avatar
    W Buchanan

    UPDATE: SOLUTION FOUND

    ---------------------------------------------------

    As it turns out, my script was utterly unnecessary. Its sole purpose was to retrieve the values of user variables and broadcast the variable names and values as UDP messages. As it happens, BrightAuthor has the capability of doing exactly what I needed without any need for a script. (Although, if I had a huge number of variables, I'd still use a script.)

    I was sure I had seen something about that, but a search of the forums was fruitless. Aaaand then I stumbled across this in the BrightAuthor manual:

     

    To utilize a User Variable in a command, first add the desired command. In the Parameters field, type the exact name of the variable in between two dollar signs on each side (e.g. “$$variable1$$”).

     

    Yep. I'm an idiot.

    Armed with this previously-forgotten knowledge, I was able to ditch the script and use conditional targets to solve my text-flashing problem. (See attached image for conditional target setup).

    I changed the outgoing UDP messages to send new variable names with the value of the existing variables. (The receiving BS units have the new variables defined, the sending unit does not.) Conditional targets set up on the receiving units allow me to compare the incoming value with the existing value, and change the existing value only if the two variables don't match.

    This is not an ideal solution, but it works. The sending unit is still sending a UDP message every three seconds, but the receiving units only redraw the text when the variable values actually change.

    My immediate issue is solved, but I'd still like to know if an event is generated when user variables are changed.

    Also, could we maybe get a "Does not equal" option in the Conditional Target dialog?

  • 0
    Avatar
    Brandon Miller

    I'm new to programming BrightSigns.  I have 3 XD232 players that I want the same content to be on.  I have 30 User Variables (Event Name, Event Location, Event Time x 10 =30 User Variables).  I want to be able to change the user variables on one of the players and once those are updated it would automatically change the same user variables on the other 2 players.  Can someone please give me very direct instructions on how to do this?  Any help would be great.  Thanks

  • 0
    Avatar
    Clifton Davis

    In regards to W Buchanan's open question about if an event is generated when user variables are changed, I found this...

     

    Lyndon (BrightSign Support)

    Question: 

    Is there a message sent when a Variable is changed, and is it possible to detect that in a Plugin?

     

    Answer:

    Yes, there are different Variable change messages. The following could be added to the Processevent function in a plugin to detect variable changes. You can see that a Variable has changed, and you can get the variable name and variable value. 

     

    if type(event) = "roAssociativeArray" then
         if type(event["EventType"]) = "roString" then
            if (event["EventType"] = "USER_VARIABLE_CHANGE") then
              userVariable = event["UserVariable"]
              variablename$ = uservariable.name$
              variablevalue$ = uservariable.getcurrentvalue()

            endif
         endif
    endif

     

    You could also change the variable value by calling here:

    uservariable.setcurrentvalue(string, true)

  • 0
    Avatar
    Marcus Garfunkel

    It appears the event["EventType"] has changed to "USER_VARIABLES_UPDATED"

Please sign in to leave a comment.