New unit and not so clever programmer
nastables
Junior Member
Hi all I am working with an rs422 switcher which accepts quite readily direct commands such as send_string "'R",'02','04',$0D"
as a newbe I cant find the way to make this work in the format I am used to with say ...autopatch
I have attached the file .. look particularly at the section DNF .. this is where I am having the issues although I know for sure the matrix is accepting ascii I understand I am doing somthing wrong ..but I do not know what. Can some one help?
indebted
Nigel
as a newbe I cant find the way to make this work in the format I am used to with say ...autopatch
I have attached the file .. look particularly at the section DNF .. this is where I am having the issues although I know for sure the matrix is accepting ascii I understand I am doing somthing wrong ..but I do not know what. Can some one help?
indebted
Nigel
Comments
-
add 48
It looks to me like this is the important line of code:
send_string dvSWC2,"'R',(rsinput),(rsoutput),$0D"
rsinput and rsoutput appear to be the input and output numbers that you want,
but the switcher expects the ascii representation of these integers.
Try this:
send_string dvSWC2,"'R',(rsinput) + 48 ,(rsoutput) + 48 ,$0D"
or this:
send_string dvSWC2,"'R',ITOA(rsinput),ITOA(rsoutput),$0D"
Also, you might check the way that rsoutput is calculated. I haven't looked at your code carefully, but it appears to me that there may be an error there.
Sorry if I misread.
Good luck.
Harold -
Two things should be mentioned:
1. You have a 24 output switcher. Adding 48 to the integer channel number will not give an appropriate ASCII code if the channel number is greater than 9. So, using ITOA is necessary.
2. If you need to pad single digit channels with a zero, you can use the technique described by B Clements in the recent ITOHEX thread (I don't think the FORMAT function is available for Axcess code):send_string dvSWC2,"'R',Right_String(" '0',ITOA(rsinput)",2),Right_String(" '0',ITOA(rsoutput)",2) ,$0D"
Harold
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