SEND_STRING Questions
jabramson
Junior Member
I'm trying to wrap my head around some SEND_STRING commands...Not so much the commands themselves, but the string formatting.
For Instance, I have this command which works (SONY VISCA Camera Control)
SEND_STRING dvCamera, "$81,$01,$06,$01,$10,$10,$03,$02,$FF"
How is that different than let's say one of these commands (which don't work, so what am I sending?)
SEND_STRING dvCamera, "'$81,$01,$06,$01,$10,$10,$03,$02,$FF'"
SEND_STRING dvCamera, "$81$01$06$01$10$10$03$02$FF"
SEND_STRING dvCamera, '$81,$01,$06,$01,$10,$10,$03,$02,$FF'
Finally, I"d like to replace the $10s with a integer variable, how would I do that?
Thanks.
For Instance, I have this command which works (SONY VISCA Camera Control)
SEND_STRING dvCamera, "$81,$01,$06,$01,$10,$10,$03,$02,$FF"
How is that different than let's say one of these commands (which don't work, so what am I sending?)
SEND_STRING dvCamera, "'$81,$01,$06,$01,$10,$10,$03,$02,$FF'"
SEND_STRING dvCamera, "$81$01$06$01$10$10$03$02$FF"
SEND_STRING dvCamera, '$81,$01,$06,$01,$10,$10,$03,$02,$FF'
Finally, I"d like to replace the $10s with a integer variable, how would I do that?
Thanks.
Comments
-
I'm trying to wrap my head around some SEND_STRING commands...Not so much the commands themselves, but the string formatting.
For Instance, I have this command which works (SONY VISCA Camera Control)
SEND_STRING dvCamera, "$81,$01,$06,$01,$10,$10,$03,$02,$FF"
How is that different than let's say one of these commands (which don't work, so what am I sending?)
SEND_STRING dvCamera, "'$81,$01,$06,$01,$10,$10,$03,$02,$FF'"
SEND_STRING dvCamera, "$81$01$06$01$10$10$03$02$FF"
SEND_STRING dvCamera, '$81,$01,$06,$01,$10,$10,$03,$02,$FF'
Finally, I"d like to replace the $10s with a integer variable, how would I do that?
Thanks.
The differences are the differences between a string expression and a string literal, the command which you note that works is a string expression which is a concatenation of integers and string literals and variables that resolve to integers. In the case above, all you have are integers designated by hex notation. You have no string literals or variables in the expression.
The first of the examples which you list as not working is a string expression (delimitted with double quotes) containing nothing but a single string literal (delimitted with single quotes). The second doesn't work because you don't have commas between the integers that you want to send and you are probably just sending a single 8bit integer, The last is a single string literal. It includes the $ characters and the commas.
The classic example in demonstrating how this works. All of the following will send the string 'HELLO'send_string dvDevice,'HELLO' send_string dvDevice,"'HELLO'" send_string dvDevice,"'H','E','L','L','O'" send_string dvDevice,"$48,$45,$4c,$4c,$4f" send_string dvDevice,"72,69,76,76,79" send_string dvDevice, "72,$45,'LL','O'" a = 'H' b = 'E' c = 'L' d = 'O' send_string dvDevice,"a,b,c,c,d"
The final hello shows how to include a variable in a string expression. -
That helps a lot, thanks!
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums