trying to get my head around protocol 2000 for kramer vs 801n with NI3000 and MVP8400
slatepipe
Posts: 8
hi - i'm making slow progress but enjoying the process. im learning netlinx and tpdesign and i've done the programmer 1 course through the company i work for. i'm practising code and suchlike at home with my audio kit and tv. i got most of it working quite well using IR but now i'm trying to learn rs232 techniques by using a kramer vs801n audio video switcher, it's an 8 in 2 out switcher and currently i have it set up so it all works fine using manual switching with all 8 inputs. so i tried to configure my MVP with some buttons to do the switching, initially just for audio. but with the code i have written below i can only get button one (case 1?) and button 2 (case 2?) to switch between inputs 2 and 5, which i can't understand as i figured these buttons would therefore switch between inputs 1 and 2.
can anyone offer any advice to how i can get these buttons set up to switch between all 8 inputs using the protocol 2000? if that is indeed what i should be using?
many thanks
BUTTON_EVENT[dvPanelKramer,0]
{
PUSH:
{
SWITCH(button.input.channel)
{
CASE 1: SEND_STRING dvKramer,"$02,$81,$81,$81" //Audio Input 1 to Output 1
CASE 2: SEND_STRING dvKramer,"$02,$82,$81,$81" //Audio Input 2 to Output 1
CASE 3: SEND_STRING dvKramer,"$02,$83,$81,$81" //Audio Input 3 to Output 1
CASE 4: SEND_STRING dvKramer,"$02,$84,$81,$81" //Audio Input 4 to Output 1
CASE 5: SEND_STRING dvKramer,"$02,$85,$81,$81" //Audio Input 5 to Output 1
CASE 6: SEND_STRING dvKramer,"$02,$86,$81,$81" //Audio Input 6 to Output 1
CASE 7: SEND_STRING dvKramer,"$02,$87,$81,$81" //Audio Input 7 to Output 1
CASE 8: SEND_STRING dvKramer,"$02,$88,$81,$81" //Audio Input 8 to Output 1
CASE 9: SEND_STRING dvKramer,"$18,$81,$80,$81" //Increase Output Gain
CASE 10: SEND_STRING dvKramer,"$18,$81,$81,$81" //Decrease Output Gain
}
}
}
can anyone offer any advice to how i can get these buttons set up to switch between all 8 inputs using the protocol 2000? if that is indeed what i should be using?
many thanks
BUTTON_EVENT[dvPanelKramer,0]
{
PUSH:
{
SWITCH(button.input.channel)
{
CASE 1: SEND_STRING dvKramer,"$02,$81,$81,$81" //Audio Input 1 to Output 1
CASE 2: SEND_STRING dvKramer,"$02,$82,$81,$81" //Audio Input 2 to Output 1
CASE 3: SEND_STRING dvKramer,"$02,$83,$81,$81" //Audio Input 3 to Output 1
CASE 4: SEND_STRING dvKramer,"$02,$84,$81,$81" //Audio Input 4 to Output 1
CASE 5: SEND_STRING dvKramer,"$02,$85,$81,$81" //Audio Input 5 to Output 1
CASE 6: SEND_STRING dvKramer,"$02,$86,$81,$81" //Audio Input 6 to Output 1
CASE 7: SEND_STRING dvKramer,"$02,$87,$81,$81" //Audio Input 7 to Output 1
CASE 8: SEND_STRING dvKramer,"$02,$88,$81,$81" //Audio Input 8 to Output 1
CASE 9: SEND_STRING dvKramer,"$18,$81,$80,$81" //Increase Output Gain
CASE 10: SEND_STRING dvKramer,"$18,$81,$81,$81" //Decrease Output Gain
}
}
}
0
Comments
In either case, are you able to send the commands manually via Control Device? That way you can verify the commands you have in code are indeed correct and make the switch do what it's supposed to.
I don't see anything necessarily wrong with your code. I might put curly braces around the cases just in case.
ex:
CASE 1: {SEND_STRING dvKramer,"$02,$81,$81,$81"} //Audio Input 1 to Output 1
CASE 2: {SEND_STRING dvKramer,"$02,$82,$81,$81"} //Audio Input 2 to Output 1
i got the string commands from a kramer pdf i found online for a kramer 16 x 16 switcher and also with some email exchanges with the amx tutor who i'm in contact with, they appear to be the same : http://www.kramerelectronics.co.uk/downloads/protocols/protocol_2000_rev0_51.pdf
i figured out that the first 01 needs to be 02 as it's audio i'm trying to route first. and i read somewhere today that i might need to press buttons 1 and 4 to select the right protocol on the 801n, in case it isnt already set
i figure i must be doing something right as i'm definitely getting a response in that it switches between inputs 2 and 5 (even though i was trying to get 1 and 2) with some buttons at the moment but some other buttons just do nothing.
but i'll try your points too later and hopefully somehow i'll get something figured out
if anyone has any more pointers please let me know
thanks
BUTTON_EVENT[dvPanelKramer,0]
{
PUSH:
{
SWITCH(button.input.channel)
{
CASE 1: SEND_STRING dvKramer,"$02,$81,$81,$81" //trying to get Audio Input 1 to Output 1
}
}
}
the results i got were :
$81 is input 2, $82 is input 5, $83 is input 5, $84 is input 2, $85 is input 2, $86 is input 5, $87 is input 5, $88 is input 2, $89 is input 2, $8A is input 5, $8B is input 5, $8C is input 2, $8D is input 2, $8E is input 5, $8F is input 5, $90 is input 3, $91 is input 3, $92 is input 5, $79 is input 3, $78 is input 3, $77 is input 5, $76 is input 5
it seems weird that i'm not getting the results that the protocol 2000 suggests that i should be getting. i tried downloading the protocol 2000 calculator from kramer http://www.kramerelectronics.co.uk/s...ad.asp?f=35567 and that gave the same results as what is laid out in the chart for the 16 x 16 matrix in the protocol 2000 pdf.
i was wondering if the VS801n can be reset to its factory state or something? if that may have something to do with the problem?
or is there some glaring error that i have probably missed?
thanks
so at the moment i am trying to send 01 as a string to switch to input 1 but am still having no luck : CASE 1: SEND_STRING dvKramer,"$01" //trying to get Audio Input 1 to Output 1
can i ask if anyone can see what mistake i am making now? many thanks
It's the most direct way to verify your serial codes. Simply setup device details, then send your test strings.
Whatever you want to try, you can verify the codes pretty quickly, and you don't have to upload programs etc.
One other note regarding 'switch' statements. As suggested above, enclose each case statement with curly brackets.
The other habit of mine is to always include a 'break' at the end of each case. This ensure that further case statements are not acted upon.
Most times the case statements are discrete, but there are times/conditions where multiple cases may occur, unless they have a 'break' at the end.
eg..
case 1:
{
// do something
break;
}
Hope that all helps.
I second "hand jamming" the strings directly to the device. This is just good troubleshooting practice. When I'm writing code, I typically just put in pseudo-code where I'm actually sending the string with the thought that I'm going to first test the strings using Control A Device first to see if A) the physical connections are working and See if the serial port is configured properly and C) the strings I have are working and formatted correctly and D) I'm getting the responses (if any) back as expected. I then change the pseudo code accordingly.
$01 $84 $82 $81
The $01 is the opener (always)
The $84 is INPUT 4 (with values starting with $81 and up for 1 and up)
The $82 is OUTPUT 2 (same value ranges as input)
The $81 is the closer (always)
No spaces, no commas, no return.
hi
thanks for this
- i'm kind of making progress with this issue but i'm still not quite there. i went to see my friend at AMX in london yesterday and amongst other things, he gave me some similar advice to above regarding the diagnostics/control a device, so i'm reasonably confident with that now. although i still cant get feedback in the notifications window, though it is all enabled.
i can get some switching to occur when i send a string in (just between inputs 1 and 3 for example) but it seems a bit random, if i try the same strings in my code from a button on my TP it seems to do different stuff, sometimes nothing and sometimes switches to a different input
i just realised i havent tried the break at the end of each case so i'll try that tonight
i figure maybe i could also try sending the strings as ascii too instead of hex?
i was wondering if there is any more of that document i could have a look at as i want to be 100% sure i have the 4 dip switches set correctly so i can rule that out as a problem - i currently have them all set to on and i hope that this is correct but i can't be sure
many thanks
If you send a 4 byte packet, then the Dev will probably only grab the first byte, or if it is snoozing or not listening (as is a bit common) it might grab another of your 4 bytes instead - or possibly a mashed value if it managed to hear more than 1!. This may go some way to explain the erratic behavior as effectively you are sending 4 commands on top of each other - and it sure won't like that.
The protocol (previous post) does actually infer a single byte for control.
So, to build a control byte as per the above:
n7 is always the binary value 0
n6,5,4 are the binary value for the machine address and if it is set to 0, then these bits are 000
n3,2,1,0 are the binary value of the input num you want ie input 3 is 0011, input 5 is 0101 etc
therefore your binary val for the control byte for input 5 on a master would be (no spaces of course) 0 000 0101
....which is $05
* The doc also says baud of 1200 not 9600 for your swr.
Hope this helps, and if it doesn't, my plea is insanity.
Steve
i've learned quite a lot but the kramer thing still won't play ball. i tried the curly brackets in the code with the breaks and i've tried the 4 dip switches on the back in different positions but i figure that as it is the only unit they should all be on and when it is set like that it does respond to strings in some way. i sent loads of different strings in via the control a device method, and sometimes it would switch but not onto the right number. it switches fine when i press the buttons but maybe it is actually faulty? if there is a firmware reset method maybe i could try that?
but thanks for all the help and advice along the way
Don't forget to water it.