Home AMX User Forum NetLinx Studio

M2M passing variable information

Does anyone out there know if you can retrieve a variable from one master to another. Currently I am monitoring the status of devices by looking at button states from a central controller.

This is fine for most things but I am wanting to also report projector lamp information as well. I can do this by putting the putting the text into a button in the individual rooms, then reading that text from the TP device. But it seems like it ought to be possible to look at information directly from the variables on the master...

Any thoughts are much appreciated...

Comments

  • ericmedleyericmedley Posts: 4,177
    mschardt wrote: »
    Does anyone out there know if you can retrieve a variable from one master to another. Currently I am monitoring the status of devices by looking at button states from a central controller.

    This is fine for most things but I am wanting to also report projector lamp information as well. I can do this by putting the putting the text into a button in the individual rooms, then reading that text from the TP device. But it seems like it ought to be possible to look at information directly from the variables on the master...

    Any thoughts are much appreciated...

    What I'd do is create my own protocol to speak back and forth and pass the value from one virtual device to another.

    Here's how I'd organize it.

    Main master sends command to sub-master
    SEND_COMMAND vdv_My_Sub_Master, 'nVariable?'
    


    then over in the submaster's program
    DATA_EVENT[vdv_This_Submaster]
    {
    command:
      {
      if you find 'nVariable?'
        {
        send_string vdv_This_Submaster," 'nVariable=',nMyVariable" // if you want the raw hex value   or..
        send_string vdv_This_Submaster," 'nVariable=',itoa(nMyVariable)"  if you want it in literal text.
        }
      }
    }
    

    then back over in the main master's program...
    DATA_EVENT[vdv_My_Sub_Master]
    {
    STRING:
      {
      if(find_string(data.text.'nVariable=',1))
        {
        // parse the string and set the variable
        }
      }
    }
    
    

    You could also send levels back and forth if the value is not ever going to be above or below the range of the level. Using Levels tends to generate less code.
  • Thanks Eric,

    I'll try this out and see if it works.
  • A bit more on the subject of M2M.

    I am experiencing a communications problem with one of my Controllers. I am able to create button pushes using the DO_PUSH function. But for some reason, I am not able to get the button state for those buttons.

    In other words, in the DEFINE_PROGRAM sections I have my central Master periodically check the state of buttons on other systems with a comparason such as:


    Local TP Remote TP
    [dvTPA_CLASSROOMS,101] = [dvTP_AUD_XAP,5]

    This works in all all 12 systems except for one. Does anyone have any recomendations (ie. settings to double check)

    Much apreciated,

    -Matt
Sign In or Register to comment.