How to pass the string '02' in Max 5?

Feb 8, 2011 at 8:11am

How to pass the string '02' in Max 5?

Hi folks,

We’re trying to control some projectors via the Max [serial] object and RS232, but have run into a snag with Max 5; our message MUST start with zero. Specifically, the syntax is: ’02 4F 4D 4E 03′ for instance. It cannot be ’2 4F 4D’ etc., we’ve tried with other software. Seems straight forward enough, but with Max 5 every time we try to form the string ’02′ it gets abbreviated to ’2′. Try typing ’02′ into a message box, umenu, whatever, the ’0′ magically disappears. If we try to form the string on the fly, say with [sprintf 0%i] the zero gets knocked off, even though [sprintf 1%i] works as one would suspect. The only way we can pass the message ’02′ is if we put quotes around it, but then the [serial] object complains “Serial doesn’t understand “02 4F 4D 4E 03″.

Any help MUCH appreciated. We’ve got a lot of equipment we want to control this way.

Christopher

#54853
Feb 8, 2011 at 9:11am

serial accepts ints. It looks like what you want to send are hex values. So 0×02 is 2, 0x4f is 79, 0x4d is 77, etc.
Generally, the ints sent thru a serial port are ASCII values… (in ASCII 4f 4d 4e is the “OMN” string). So you may need to play with itoa/atoi.

#197536
Feb 8, 2011 at 12:15pm

Based on atoi this is a hex to int converter.
_
johan

– Pasted Max Patch, click to expand. –
#197537
Feb 8, 2011 at 12:25pm

The same thing, but with only one standard object (there are some funny nice features deeply hidden in Max):

– Pasted Max Patch, click to expand. –
#197538
Feb 9, 2011 at 3:25am

Thank you gentlemen. That both explains well and solves the problem.

Thanks,

Christopher

#197539
Feb 15, 2011 at 6:24pm

Hi Christopher
did you manage to get your patch working? I am doing the same exact thing with a panasonic projector and having difficulty getting it to work. I’ve done other rs-232 controls before in max but this one is frustrating me. my projector wants also wants STX and ETX at the beginning and end… in theory I am sending the integers to serial object as follows: 50 65 68 90 90 59 80 79 70 51 13

spelled out with itoa that means ’2ADZZ;POF3′

grrr

- Johnny

#197540
Feb 15, 2011 at 7:05pm

Figured it out.. its like the above integer stream but ’2′ and ’3′ instead of 50 and 51

simple example patch attached :) It is quite literal, just figuring out the actual ascii codes to send, but with a little more work it could be made to do the translation of any command. BTW this is for Panasonic PT-Dxxxx series, some Panasonics do not require the AT ZZ for projector ID.

–Johnny

#197541
Feb 15, 2011 at 10:08pm

Once you get going its hard to stop :) I found a more detailed serial command doc digging around panasonics site, which allowed me to add more commands, such as lens zoom, focus etc etc. I also streamlined and switched to sprintf to format commands easier. new and improved enclosed

–Johnny

#197542
Apr 3, 2011 at 12:14pm

Hey,

@Christopher: did you get it to work?

@all: I want to control a Kramer VP-88ETH Matrix with Max via RS232. I have a USB-Serial Converter from HAMA. Honestly I am not really firm with this kind of things, but thought it shouldn’t be too dificult. As I understand the manual of the Matrix, to switch for example Input 1 to Output 3 it needs the HEX code: 01 81 83 81
(the download page of the manuals: http://www.kramergermany.com/support/product_downloads.asp?pid=371).
(as for all the other controls, I have no idea).
Anyhow, I don’t get it to work at all. “Serial” doesn’t send hex-data, right? Any help on getting started is very appreciated!!
How do I even know, that the Matrix is receiving any data at all from the macbookpro?

Thanks a lot, rene

#197543

You must be logged in to reply to this topic.