Sending Text to a Button
arunmohan
Posts: 31
I can send any text onto a particular button by the command used in Netlinx
SEND_COMMAND Panel,"'^BAT-520,1,Enter City'"
Now I want to send the text in a char variable instead of the direct text, How the syntax will change?
Please helpme
SEND_COMMAND Panel,"'^BAT-520,1,Enter City'"
Now I want to send the text in a char variable instead of the direct text, How the syntax will change?
Please helpme
0
Comments
You would simply put your char variable in place of "Enter City"
SEND_COMMAND Panel,"'^TXT-520,1,cVariable'"
Also:
SEND_COMMAND Panel,"'^TXT-520,0,cVariable'"
Will display the text in all states of the button... on, off, etc.
Oops! I didn't even notice that!
My experience with ^TXT is that it is a comma delimited string and that in the form you have it, the text that will be sent to the button is the string 'cVariable'. Do I have this wrong? I don't have a touch panel to check it with right now.
I think what you need to do to use ^TXT with a variable argument is something like:
SEND_COMMAND Panel,"'^TXT-520,0,',cVariable"
I think to use the ^BAT form (if appropriate) you'd need something like:
SEND_COMMAND Panel,"'^BAT-520,1,',cVariable"
which is sort of funky looking because you have the two commas together -- one as part of the string and one as a delimiter.
^TXT-<address> , <state> , <text>
^BAT-<address> , <state> , <text>
Where:
<address> is the variable text address of the button intended for the text
<state> is both, off or on (0, 1, 2 respectively OR states 1 - 256 for multi-state buttons)
<text> is the text meant to be on the button, whether it be a variable or static text (up to 50 chars per AMX-PI)
^BAT appends text to a button. So if you wanted your button to say "This is silly", you could do this:
send_command dvPanel1 , '^BAT-520 , 0 ,This '
send_command dvPanel1 , '^BAT-520 , 0 ,is '
send_command dvPanel1 , '^BAT-520 , 0 ,silly '
// Variable text button reads "This is silly"
^BAT is helpful when hitting that magic text length when sending to a panel (which I *thought* was 188 characters, though I've seen some people say 200 and AMX-PI say 50 . . .)
Just like Google, AMX-PI is your friend (except when it's wrong.)
No. it wont work.
See the post after the one you quoted. The command you are trying to use is slightly wrong. Look at the ' and , below.
Try:
Jeff
Thanks Hedberg, Thanks Spire_Jeff..... I'll let u know if it is working.
This will work.
SEND_COMMAND Panel,"'^BAT-520,1,',cVariable"
Thank u all.
Good.
Do you see why it works and why
"'^BAT-520,1,cVariable'"
does not give you the result you want?
There is a metric buttload of lessons about strings in this little example.
Well, maybe only a half metric buttload, but it's important to understand.
Sure, I'll.
I have a problem to communicate between the iPad and the ni-3100. When I contact to the tpcontrol in the iPad and I press on the button it doesn't do anything (it even doesn't change color from red=press to yellow=release). In the netlinx I see that the iPad is online. I don’t know what the problem is.