Anthem serial command with variable
Denis
Junior Member
Hi
I try to send a serial commande trough variable in an Anthem TLP1
the string has to look that TFP13 meaning set band1 (FM1) preset 3
I tried
But I get an invalid parameter from TLP1
Any cue?
I try to send a serial commande trough variable in an Anthem TLP1
the string has to look that TFP13 meaning set band1 (FM1) preset 3
I tried
//VARIABLE
CHAR nTUNER_PRESET_NUM
CHAR nTUNER_PRESET_BAND
//CODE
BUTTON_EVENT [dvTP_TUNER,13]
{
PUSH:
{
nTUNER_PRESET_BAND = 1
}
}
BUTTON_EVENT [dvTP_TUNER,14]
{
PUSH:
{
nTUNER_PRESET_BAND = 2
}
}
BUTTON_EVENT [dvTP_TUNER,1]
{
PUSH:
{
nTUNER_PRESET_NUM = 1
}
}
BUTTON_EVENT [dvTP_TUNER,2]
{
PUSH:
{
nTUNER_PRESET_NUM = 2
}
}
BUTTON_EVENT [dvTP_TUNER,3]
{
PUSH:
{
nTUNER_PRESET_NUM = 3
}
}
BUTTON_EVENT [dvTP_TUNER,4]
{
PUSH:
{
nTUNER_PRESET_NUM = 4
}
}
BUTTON_EVENT [dvTP_TUNER,5]
{
PUSH:
{
nTUNER_PRESET_NUM = 5
}
}
BUTTON_EVENT [dvTP_TUNER,16]
{
PUSH:
{
SEND_STRING dvTLP1, "'TFP',nTUNER_PRESET_BAND,nTUNER_PRESET_NUM,$0A"
SEND_COMMAND dvTP_TUNER,"'@TXT',70,nPREAMP_BUFF"
CLEAR_BUFFER nPREAMP_BUFF
}
}
But I get an invalid parameter from TLP1
Any cue?
Comments
-
Hi
I try to send a serial commande trough variable in an Anthem TLP1
the string has to look that TFP13 meaning set band1 (FM1) preset 3
I triedBUTTON_EVENT [dvTP_TUNER,16] { PUSH: { SEND_STRING dvTLP1, "'TFP',nTUNER_PRESET_BAND,nTUNER_PRESET_NUM,$0A" SEND_COMMAND dvTP_TUNER,"'@TXT',70,nPREAMP_BUFF" CLEAR_BUFFER nPREAMP_BUFF } }
But I get an invalid parameter from TLP1
Any cue?
don't you just need the itoa? if I am reading your post correctlySEND_STRING dvTLP1, "'TFP',itoa(nTUNER_PRESET_BAND),itoa(nTUNER_PRESET_NUM),$0A"
or am I missing something? -
Currently nTUNER_PRESET_BAND and nTUNER_PRESET_NUM are integers. When you use them to concatenate the string you are sending to the tuner they need to be converted to their ASCII equivalents. Thankfully the NetLinx function ITOA makes this nice and easy. If you use the code JohnMichnr suggested it should fix your issues.
-
Nice!
Thanks guys.
I tried ITOA but here is my errorSEND_STRING dvTLP1, "'TFP',itoa(nTUNER_PRESET_BAND), (nTUNER_PRESET_NUM),$0A"
-
Nice!
Thanks guys.
I tried ITOA but here is my errorSEND_STRING dvTLP1, "'TFP',itoa(nTUNER_PRESET_BAND), (nTUNER_PRESET_NUM),$0A"
Close. ITOA is a function that takes an integer as its parameter (which is the value inside the parethesis) and will return the ascii equivelent (which will sit where the ITOA is called from). Because you are converting two decimal values you need to call it twice:SEND_STRING dvTLP1, "'TFP',ITOA(nTUNER_PRESET_BAND),ITOA(nTUNER_PRESET_NUM),$0A"
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
