Home AMX User Forum NetLinx Studio

Command for Showing a Button State

Greetings,

I have a 6-state button on G4 panels. Is there a send_command to tell the button which state to show from code?

Thanks!

Comments

  • GSLogicGSLogic Posts: 562
    Greetings,
    I have a 6-state button on G4 panels. Is there a send_command to tell the button which state to show from code?
    Thanks!
    Studio -> Tools -> Software History -> MVP8400 -> find "^ANI"

    "'^ANI-<variable text address range>,<start state>,<end state>,<time>'"
  • a_riot42a_riot42 Posts: 1,624
    Yes, I believe the only way to do it is using the ^ANI command. So to just go to the fifth state you would write:

    send_command ui,"'^ANI-500,5,5,1'"
        "'^ANI-<variable text address range>,<start state>,<end state>,<time>'" 
          Run a button animation. Time is in 1/10 seconds and is optional.  
            0 for state means current state. 
     
            Syntax:  
                    SEND_COMMAND <DEV>,"'^ANI-<vt addr range>,<start state>,<end state>,<time>'" 
     
            Variables:  
                    variable text address range = 1 - 4000. 
                    start state = Beginning of button state (0= current state). 
                    end state = End of button state. 
                    time = In 1/10 second intervals. 
     
            Example: 
                    SEND_COMMAND Panel,"'^ANI-500,1,25,100'" 
                    Runs a button animation at text range 500 from state 1 to  
                     state 25 for 10 second. 
    
    
  • Spire_JeffSpire_Jeff Posts: 1,917
    You might also think about using a level to control the button.

    Jeff
  • viningvining Posts: 4,368
    If you make the button a multi state bar graph with states 1-6, range low = 1 & range high = 6 you can just send_level 1-6 to set the desired state. The ANI command work too but the level thing is a little easier to work.
  • a_riot42a_riot42 Posts: 1,624
    Spire_Jeff wrote:
    You might also think about using a level to control the button.

    Jeff

    That won't work with a multi-state general button will it?
    Paul
  • DHawthorneDHawthorne Posts: 4,584
    a_riot42 wrote:
    That won't work with a multi-state general button will it?
    Paul
    It has to be a multi-state bargraph, not general. You won't even get the ability to assign it a level in a multi-state general. But there is functionally no other difference, so there is no reason not to re-define it I am aware of.
  • TurnipTruckTurnipTruck Posts: 1,485
    I am using a six state button with the ^ANI command. Leaving off the time parameter of the command makes thestate static until another command requests a new state. This method works well because I am providing feedback of signal strength from an RF receiver which reports its signal level as 1-6.

    Thaks for all of your suggestions.
Sign In or Register to comment.