Does anyone know how to send the formatted text string to a touch panel button from code? Sending $P won't work obviously. Tech support wasn't sure.
Paul
Formatting codes can be used in the state text for bargraph and multi-bargraph buttons. The following formatting codes will be replaced with the identified values:
$P - level percentage
$V - raw level value
$L - range low
$H - range high
$A - adjusted level value (raw level value ? range low)
$R - range (range high ? range low)
$$ - $ character
Assign an address code to the button and do a text SEND_COMMAND using one or more of the formatting codes in the string.
Sure it will. I assume you are referring to these formatting codes:
Assign an address code to the button and do a text SEND_COMMAND using one or more of the formatting codes in the string.
I tried that and using send_command dvTP, "'^TXT-100,0,$P'" resulted in the the text $P showing up in the text field, not the precentage. Have you tried this? I haven't got it to work but perhaps I am doing something wrong. How does the TP know if the incoming string is a formatted code? I can't imagine it parses it for the codes and behaves accordingly but perhaps it does.
Paul
Buy changing the text on a button (via a VT command) you can modify the codes on a button.
When one of the Text Formatting Codes is encountered by the firmware it is replaced with the
correct value. These values are derived from the following operations:
Might also be worth trying the old @TXT command rather than ^TXT
I tried that and using send_command dvTP, "'^TXT-100,0,$P'" resulted in the the text $P showing up in the text field, not the precentage. Have you tried this?
Yes, I tried exactly that and it showed the percentage and it showed it with a percentage sign if I send $P% as the text.
I haven't got it to work but perhaps I am doing something wrong.
Are you using a bargraph button and not a multi-state bargraph button? If you are then I think that?s your problem even though you?re not doing anything wrong. I?ve used the multi-state bargraph buttons before and it works fine but I just tried it now with the simple bargaph and I?m seeing what you?re getting. So there appears to be a bug or the help file is wrong. Use the multi-state bargraph button instead if your application sees fit.
Yes, I tried exactly that and it showed the percentage and it showed it with a percentage sign if I send $P% as the text.
Are you using a bargraph button and not a multi-state bargraph button? If you are then I think that’s your problem even though you’re not doing anything wrong. I’ve used the multi-state bargraph buttons before and it works fine but I just tried it now with the simple bargaph and I’m seeing what you’re getting. So there appears to be a bug or the help file is wrong. Use the multi-state bargraph button instead if your application sees fit.
I am using a bargraph not a multistate bargraph. I will change it to a msbg and see if that works. Thanks!
EDIT: Yes it looks like the msbg is ok, but the regular bg doesn't work correctly unless that is by design.
Paul
Comments
Assign an address code to the button and do a text SEND_COMMAND using one or more of the formatting codes in the string.
I tried that and using send_command dvTP, "'^TXT-100,0,$P'" resulted in the the text $P showing up in the text field, not the precentage. Have you tried this? I haven't got it to work but perhaps I am doing something wrong. How does the TP know if the incoming string is a formatted code? I can't imagine it parses it for the codes and behaves accordingly but perhaps it does.
Paul
Might also be worth trying the old @TXT command rather than ^TXT
Send_Command dvTP "'@TXT,100,'$P'"
Are you using a bargraph button and not a multi-state bargraph button? If you are then I think that?s your problem even though you?re not doing anything wrong. I?ve used the multi-state bargraph buttons before and it works fine but I just tried it now with the simple bargaph and I?m seeing what you?re getting. So there appears to be a bug or the help file is wrong. Use the multi-state bargraph button instead if your application sees fit.
I am using a bargraph not a multistate bargraph. I will change it to a msbg and see if that works. Thanks!
EDIT: Yes it looks like the msbg is ok, but the regular bg doesn't work correctly unless that is by design.
Paul