itohex and volume
John Paul
Junior Member
I am controlling a beyerdynamic mcsd 200 which has volume control . Sample volume commands are
03 0D 3B 01 vol 59
03 0D 00 01 vol 0
03 0D 01 01 vol 1
03 0D 02 01 vol 2 and so
now i have written a level event like this
LEVEL_EVENT[virtualTPBeyerdynamicMCSD200,1]
{
send_string dvBeyerdynamicMCSD200,"$03,$0D,itohex(level.value) ,$01"
}
itohex gives the proper hex value but the device doesnt take it but if i give the full string, the device takes .So i am forced to write switch case for each level.value, is there any other way ??
03 0D 3B 01 vol 59
03 0D 00 01 vol 0
03 0D 01 01 vol 1
03 0D 02 01 vol 2 and so
now i have written a level event like this
LEVEL_EVENT[virtualTPBeyerdynamicMCSD200,1]
{
send_string dvBeyerdynamicMCSD200,"$03,$0D,itohex(level.value) ,$01"
}
itohex gives the proper hex value but the device doesnt take it but if i give the full string, the device takes .So i am forced to write switch case for each level.value, is there any other way ??
Comments
-
I am controlling a beyerdynamic mcsd 200 which has volume control . Sample volume commands are
03 0D 3B 01 vol 59
03 0D 00 01 vol 0
03 0D 01 01 vol 1
03 0D 02 01 vol 2 and so
now i have written a level event like this
LEVEL_EVENT[virtualTPBeyerdynamicMCSD200,1]
{
send_string dvBeyerdynamicMCSD200,"$03,$0D,itohex(level.value) ,$01"
}
itohex gives the proper hex value but the device doesnt take it but if i give the full string, the device takes .So i am forced to write switch case for each level.value, is there any other way ??
You are misunderstanding what ITOHEX does. ITOHEX takes an integer and converts it to an ASCII string.
integer X = 59;
// NOTICE THE SINGLE QUOTES
ITOHEX(X) = '3B'
// so this is what ITOHEX is doing here.
send_string dvBeyerdynamicMCSD200,"$03,$0D,'3B' ,$01"
You are trying to send this message.
send_string dvBeyerdynamicMCSD200,"$03,$0D,$3B ,$01"
///////////////////////////////////////
this is actually a very common misunderstanding among new programmers.
all you really have to do is this...
send_string dvBeyerdynamicMCSD200,"$03,$0D,level.value,$01"
I know you are saying, but 59 is not in hex? What you need to realize is that 59 = $3B, no conversation to hex is needed. Matter of fact, the only thing that cares that it is not in hex is you. The serial port actually sends each byte in binary and the device you controlling receive each byte in binary. it is mearly just for display purposes in code.
// these are the same
send_string dvBeyerdynamicMCSD200,"$03,$0D,59,$01"
send_string dvBeyerdynamicMCSD200,"$03,$0D,$3B,$01" -
thanks Jeff, with 5 yrs of experience and i still dont know the basics, i suck , i ve to improve soon
-
thanks Jeff, with 5 yrs of experience and i still dont know the basics, i suck , i ve to improve soon
John Paul,
don't sweat it! On this forum, if you show any weakness, you get cut to shreds. But, we're all pretty much in the same boat. We've all done goofy things and learned 'noob' stuff every day. I still learn stuff I never knew. That's why I come here. -
ericmedley wrote: »John Paul,
don't sweat it! On this forum, if you show any weakness, you get cut to shreds. But, we're all pretty much in the same boat. We've all done goofy things and learned 'noob' stuff every day. I still learn stuff I never knew. That's why I come here.
DITTO... Was not ment to belittle, just to enlighten. -
Oh, I wasn't aiming at you... It was more a generalized response. You are always polite and a gentleman and scholar!DITTO... Was not ment to belittle, just to enlighten.
-
Thanks guys
Sure i know you guys meant well
Leave a Comment
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