I’ve got a PTZ controller sending bytes via the VISCA-IP protocol into a UDP in, currently i’m trying to pack / unpack the signals, i tried using a struct method but not having much luck with identifying. one issue, and i’m not sure how to fix it, is that the Z axis outputs 3 less columns than the X or Y.
would love any suggestions on how to capture these values so i can
convert them into floats.
Hi.
First thing I’d do (for debugging) is display those bytes as hex values.
I’ve attached a toe file that just simply strips off first column/row and converts the rest to hex:
But you’ll want to do the processing right in the callback:
udpin3_callbacks
Basically you’ll want to examine the ‘bytes’ argument right there each time, and if they match what you are looking for, then update some other table with the extracted values. (You’ll be updating different cells of that other table depending on if you find an x/y/z message etc).
The trick is to know which bytes to look for.
In this document: VISCA protocol command list
Your incoming messages mostly resemble ‘Pan_tiltDrive’ but I’m not fully familiar with that protocol.
Okay, I’ve expanded the toe file a little bit.
The callback now examines the bytes to see if the beginning and end match what it’s looking for.
If so, it takes the two unique values and stuffs them into a CHOP for later use.
To test, you can run ‘test1’ or ‘test2’. Each will update the CHOP with unique values. hex_AVKANS.23.toe (4.6 KB)