Home AMX User Forum NetLinx Studio

Reading Button text

G'day all.

Its probably going to be a short answer but how would I go about reading the text on a button and putting that into a variable? I've got two controllers talking to eachother with one touchpanel keeping tabs on what the other panel is doing.

Example:
Panel A gets pushed and does this one one controller
SEND_COMMAND (10000+tpIdentity):1:77,"'^TXT-2000,0,SYSTEM WARMING'"
//Sends "SYSTEM WARMING" to button 2000 on touch panel (10000+tpIdentity)

but now I essentially want something like...

CHAR alienMSG[50]
alienMSG = READ_BUTTON (10007):1:0,"'^TXT-2000,0'"

on the other TP and controller.



Thanks,
VMarc

Comments

  • ericmedleyericmedley Posts: 4,177
    VMarc wrote: »
    G'day all.

    Its probably going to be a short answer but how would I go about reading the text on a button and putting that into a variable? I've got two controllers talking to eachother with one touchpanel keeping tabs on what the other panel is doing.

    Example:
    Panel A gets pushed and does this one one controller
    SEND_COMMAND (10000+tpIdentity):1:77,"'^TXT-2000,0,SYSTEM WARMING'"
    //Sends "SYSTEM WARMING" to button 2000 on touch panel (10000+tpIdentity)

    but now I essentially want something like...

    CHAR alienMSG[50]
    alienMSG = READ_BUTTON (10007):1:0,"'^TXT-2000,0'"

    on the other TP and controller.



    Thanks,
    VMarc

    why not just send the exact same command to a virtual device on the other master and parse it that way? That way you avoid the middle-man (that being the tp.)
    SEND_COMMAND (10000+tpIdentity):1:77,"'^TXT-2000,0,SYSTEM WARMING'"
    SEND_COMMAND  vdv_My_Other_Master,"'^TXT-2000,0,SYSTEM WARMING'"
    
  • jjamesjjames Posts: 2,908
    I'd agree with Eric, but if you're hell bent on querying the TP, check out the CUSTOM_EVENT and the ?TXT command.
  • VMarcVMarc Posts: 10
    I was thinking about it last night, essentially what I want is controller A to send to or affect a variable on controller B so that panel B can react accordingly.

    Scenario: Panel B remotely connects to rooms to offer support to the users. Without creating a local 'database' on B, I would like the panel B and/or controler B to reiceve a variable based on the room setup. Is it an LCD TV or a projector? I currently use a lot od DO_PUSH and some "OFF/ON[(10000+(TpIdentity)):1:77,1]" from one to the other as flags but that just seems wrong to me.

    Thanks
    VMarc
  • ericmedleyericmedley Posts: 4,177
    VMarc wrote: »
    I was thinking about it last night, essentially what I want is controller A to send to or affect a variable on controller B so that panel B can react accordingly.

    Scenario: Panel B remotely connects to rooms to offer support to the users. Without creating a local 'database' on B, I would like the panel B and/or controler B to reiceve a variable based on the room setup. Is it an LCD TV or a projector? I currently use a lot od DO_PUSH and some "OFF/ON[(10000+(TpIdentity)):1:77,1]" from one to the other as flags but that just seems wrong to me.

    Thanks
    VMarc

    I'd use Master to Master communications and a shared comm virtual device on each master to pass information.

    So, for example on master A

    // something happened - Index now equals a new value
    send_command vdv_other_master_virtual,'Index now equals:50'

    then on master B

    data_event[...
    command:
    { if(find_string ... 'Index now equals:'...
    // parse for value
    Index=parsed_value


    Commands are for send, stings are for receive.

    That's how I'd do it. I'd obviously come up with a better protocol but this is just an example to show the idea of how it works.
Sign In or Register to comment.