I am installing a permanent evening-time projection piece that need to be completely autonomous: needs to come on at sunset (ie. variable) & go off at midnight. Am trying to find the right solution for switching on and off the projector. It’s a question of sending simple command codes (C00: projector on; C01: projector off) via RS232 (but operating from a Mac, so via usb/RS232 adapter?) following to a year round schedule (I have a patch that does this, but for a DMX system). Has anyone any experience of doing this using Max?
I was looking at this and it seems it should be as simple as connecting with an adapter and using the serial object with the right port, haven’t tried it yet though. Possibly more fun using a microcontroller with a light sensor?
Have just ordered some USB to RS232 adapters, will let you know how I get on!
Look forward to hearing how you get on. I usually muddle through and find a solution, but I don’t want to buy the projector (big beast: Sanyo XF1000) until I’m sure it will work for me.
Will keep you posted, for reference I am using ‘Projection Design’ kit which can receive ASCII commands over RS232 or indeed over LAN. For example, to turn one on:
And I have ordered this adapter:
Just got the adapter and rigged up a quick patch and it seems to work fine!
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 904.3oc2X1zbaBCDF9r8uBMLSmbI0CqPfgbKMG5jSsS5gdnSlLBPIQsXvCH2 lzL4+dQRP7Ww7grcrSuXrVKKsuOZ0pU7zvAVgYOvJrPmg9AZvfmFNXfxjzvf p1CrlPeHJgVn5lUT1jIrTg0o5eSvdPnrWZikiTMq9ooTQz87z6tImEIzSA36 Ox8TD34Ox9Tj2X4mX6Q1nqq9O2lkJRoSXpg77bNModz3wJaYg+7iDbswzYS3 oILgx0f4FylIpsZuvHWv+qZjA7Hao0mGNT9woaozowwHJJhlW5u2wP4Lwr7z lnfiijBX+.o9AL1PL.GWXHJK82rbgJF.IxPm+sKt7xlv.3nDtm61gA6CCFJG 3PVdC5CGnTjmZU101L043LeFxK6b4lraXozvD1hxoCJGuAkWYV2SwiSYZm2h KWgQVgzz6rPWaBeX+oT.qEkTLMubnuEc1mt5xOi9PRb6DLPGfX6XHB6y9Dnm XxL1LgUTTlpXM335i7sQiCP9iQ9XDwuLWQS6fHv7HL.qe32W9fCdU9fOf7YC wNBTAKoT8nnDFMuwLrKPDehJtA5KWf.qsb6kyl4hVHxcXZsrKwTd4rwZ8n3p cSp7RddlgHbOhb5KgjrwLrHUNKl2t5qpCAFqiPb5s7c6RxYYJzIYwrUBdVOh JgmxVxffFV+GseUlRLfoUI1qvaUO+E6wUcQ5LQVQTdVRhZ9MXcHblPj0TgPD UhcG7KI1WI89hnlXPR70z+N+zL5zorz3lyRqCxpp1yzZdw32sGhEzLd7GKKF tJHndGYuODCHuaNDKiVDw4sGvnqKVuGo+AL.7+Z.iN2ccQODyhWN9p4YSWqR WnL+jKt5jFfhit5XcAg9fYwLtGWWn7ru9kuekcKBGp1lrUBmbDJbnEgiU0rQ b1Fc6bft57FtZHS5lnYEg5u0ZJRGh5zz.CUOXs2u97xoBTt27x7l+J2TJTZe YnUjMKOpdDqea.n4pLlUH3oTAurJqE5DrTmtmGGyRWbELlWHqQMdy000Y+A5 f+.s4OS3wSyJAVQcpLP85wb8jOFO9kFymmcl.jUv2p.vuY7Di6h6P5GO0DzA bkObIuzXefyt3+xR0Pfg9OlnR6cXEvaW7PW7lf9ENfwJN5nttEY0uCfptJcm TM1GTdWj0X24NqPvMrqy8s0efs0eVYYWeMKvydgkWO68xxKzkSEvllUs7D0m G9O.leSE9C -----------end_max5_patcher-----------
Wow! I completely zapped your last reply with the patch! I thought the thread had gone dead and I have been following up another solution. I have just opened the maxpatch. I am getting a message in the maxwindow which says ‘no such object’for ‘toascii.
Will have a look, see if I can find it.
`Thanks so much for looking into this. Not too late for me as it happens.
Its part of the Jasch object library:
Got my projector control system going great now, but don’t send too many messages through too fast or it seems to crap out the serial port or something.
Thanks again Luke.
I’ve installed ‘toascii’ and am building a patch to run the installation.
Two quick questions:
1. Will any USB to Serial adaptor do?
2. Any way I test the patch before I hook up the projector (I don’t have it here where I’m building the patch)?
3. Someone told me it’s a good idea to send the code to the projector several times (to be sure, to be sure). What do you think?
Again my thanks & kicking myself I didn’t keep my eye on this thread!
I am going this morning to buy a usb I’m sending ‘set C00’ to your text editor
I don’t have the projector with me here (it’s alreada
Sorry Luke, that was three questions! (plus some unfinished gobbledeegook i forgot to delete.
I just had an installation a week ago with rs232, dmx and midi.
And I had the problem that while testing serial communication, my mac freezes after a couple of minutes (between 10-15).
I was using different USB to serial adapters but no change.
At the end I used a PC with USB to serial adapter and windows XP on to run the patch. And it works perfect.
Take a look on this topic
Its about Arduino but I think it is a OSX problem.
Edit: If your projector supports this and you would like to stay on a mac I would turn it on/off via LAN
I assumed this was an efficiency limitation of RS232 resulting in buffer overflows. I have no problems when sending individual button press type commands triggered by an OSC controller, but if I try to use a fader to control a parameter then things go wrong because the messages come through too fast. I haven’t had problems with Arduino serial and OSX either, but then I haven’t particularly had to send lots of messages in quick succession. Maybe this is a OSX limitation if it doesn’t happen on XP?
1. I would have thought any adapter that mentions RS232 would be alright, should be fairly inexpensive
2. Once you have the adapter plugged in you should stop getting the ‘serial port not available’ error message
3. Probably a good idea, there are occasions when things don’t get through. There is a pretty basic communication going on here after all!
This method should be fine for just turning a projector on and off.
Patch built and everything seems to work fine!
Flying over to Ireland tonight to install & will add a final post to let you all know how it works.
For anyone who is interested here is my final patch. I haven’t yet tested it on the Sanyo XF1000 because the museum has been closed over the Christmas period, and I don’t have any big beasts like that lying around here!
Would really appreciate it if anyone could have a look over it (Luke!) and see if I’ve everything in the right place. Not being a programmer, am a little fuzzy (or a big fuzzy if you prefer) regarding the exact line I need to send. The XF1000 manual says "C00"[CR] for power on, and "C01"[CR]. Is that all I need the patch to type in?
Luke, I don’t understand what the ‘sprintf’ object is, and I’ve left it out for the moment. Do I need it for some reason?
Thanks for all your help
A programmer friend (unfamiliar with max) suggested there is usually some sort of initiation signal to open a serial port followed by the command sequence. Is that taken care of by the serial object?
Don’t worry about the sprintf, that was just for messages with changing values like brightness.
You don’t really need all the ascii conversion stuff if you are only sending on and off messages, you can just send the ascii code from a message box. I’ve included a patch that simplifies this somewhat, I’m sure yours will work fine, but it seemed a little convoluted and there are lots of delays and onebangs that I wasn’t sure what they were doing.
Some simple devices like module boards might need a certain message to put them into serial communication mode, but I would expect this not to be the case with your projector (certainly isn’t with mine) and the documentation for your projector’s communication protocol would certainly mention it if there was.
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 1132.3oc0ZkziaaCE9r8uBVe1c.ejZsnn.E4RuzK8ZPv.ZKFOJiVFHQkNoA4 +d4hjslwR1zVK1ACrkDIezu22amZ99xEq1j+JubE52PeDsXw2WtXgdH0.Kpe dwpT1qaSXk5ksZadZJOSrZsYNA+Ugd7uTUJPhbTJ6YNprpf+KMKINRuf7Me4 WotMC947LQFKkqm5OKhYIMyjUkFmkvE5eN3vf4UhlQws1jx3+SuI.4glgegI 19Tb1tGK3aEFYiD3ImFQC0W.Wr5BQ9M5SJZ9wxkpuVaIFjw+WozbDDDwSP.F i6RvIWnfS5TvgSK3lUJ91KbiTuZCKa2Jzm5GW.reKbw0etgE78IrPHiHrHx2 sKg2gzSBt.adnOgIV5LZgrD59fqQHZDk8jTHwcAu3QdFaShdawim1uTp8IzN jdveTz8jqQ2uFs5zXF3n0+tApKNzovsPALPW3h28KtDhaAKTuo.V1lmjfRkL 8Sh3zt7ZfwIGhyEhOZro4iMgTIZ3IH3HGNkD9XDSvpAmZzQMQUlvvGqqGpYY eTuv8KUNyy7u0R3Ti7UVRUM2B9FUxhFERmzR5l1.ankN.Zc5l1Pan0c.z50I sDrMz5O.ZCF.OGN.ZA7.TR.LDhIm2rr9V4tXbKJYekG8nzCW5I8HSHJh2TIL 0l11IgmtgqCF.0jeMgdpjaRQGwVFmPKcF5k1enEUF70VTUhqNoDg5qxj63pe .luL4UYuv19LBq9qqpYHiB3QuNvq0EKfPrFBAR3AL7Jvo9ZE5uUYu1CFE61X 9swO3hgPOXcm20VQ1Namyz0wD8TcLUmFqwZy6HqMk3JSkkWXszcEPbJurjsi eDD64ibBPNgRgnqRDfaRaEmtzIPWJows0WaFBAirgGqbabLZadDG847BzGv3 e+C+yefXYQx6A08MjjDmw2WtA4XDL3V0mtriKk4FUa7ANlxvcF2RLSxYQJCq NK+dbhhMplN0cv4o8D8ICpp6y3PEzsCEI79ygh.timGUu8nojPTU4FyccEqY 5JYfb1rdmtQDSPaGCzXh+b8cq0WISD7ccMSDGr9bOtWKZB9InnoFLDGLFUM0 2oDxDcdFYd2D.JItTCMMWs7P1.eu2Wsz3gPRqzh79NIUh+zEglN7SREHTcxq gAL8k7RcRQqQ8XAQgaBxXEp3BJTwSeFQP3HWM3ekWULRcgPuUcgT+dapCeSC F2tPz6htV328JvzbhZ72B6kRDcaiBtI7M5.yDwKEwYLQbdV6EgeyhdJNJhm0 FNhhKUYdh5O0i07iLZIBNG+.yG+DZA9LerC0J0k2rwO.bWAOpSv4rri67ZLe VsE4L7SZbzK4xz20d3DpmoVFSjW59GN76LdBfuEB.cF0uXaL27uP.s9coKSs STXoIQu4wI.SAavz2E1YRcgswHElOcrqMri6kohMdITYlZkFF.uCONEZXqDg 2ln61603MHulvvI0oQ8OZv4cZ7mu.Q1vNAymOrUwomup3n3eBiwQIyG9PlxX txND9wx+GW1Hpn. -----------end_max5_patcher-----------
Wow! That is good: You managed to reduce my patch to about a quarter the size!
It looks lovely. From my lowly altitude on the learning curve, can’t quite figure out the coll object (where is the data stored?). But it seems to work fine. Thanks for that. Very much.
No mention of any initiation in the XF1000 documentation, though there is a specification for the serial protocol:
Baud rate : 9600 / 19200 bps
Parity check : none
Stop bit : 1
Flow control : none
Data bit : 8
The serial object seems to allow control of those properties (except flow control, but as there is ‘none’…)
Anyway I’ve added those properties to your patch. Do you think it’s neccessary?
If you look in the reference file for [serial] you will see that the default baud rate is 4800 so you will need to change that, but everything else should be fine.
If you lock the patch and double click on the [coll] you will see and can edit the data I have put inside it, check the help file for a proper run down of its workings, you can tick an attribute to save the data with the patch or save a named text file separately.
Thanks for that Luke. I reckon it’s ready to go. Just have to try it out on the XF1000 (next week). Many thanks again.
As usual, another question:
The Sanyo XF1000 manual specifies, with beautiful Japanese inscrutability, that "Dedicated serial cables that come with a projector must be used for the connection to a computer and the projector" followed by a diagram. Is this just a standard 9 pin serial cable , or do I need to get a cable made up?
Sorry if this is a silly question.
Hmm, I don’t know enough about this to give you solid advice, but it seems to suggest that you might need an adapter or cable to cross the wires, I think this is what a ‘null modem’ or ‘crossover cable’ does? Anyone?
My projector manual seems to say there is no crossover required so I think I may have just been lucky with my set up!
"Connect the projector and host using a standard serial cable with 9-pin female to the host, and 9-pin male to the projector. Pin 2 connects to pin 2, pin 3 connects to pin 3 and pin 5 connects to pin 5."
Had a chat with an engineer who did her thesis on serial communication (my sister in law in fact!). Seems that the cable required is – as you figured Luke – a null modem, which is for computer to computer and female/female. The crossing is so that the TxD (transmits data) is connected RxD (receives data) on the other computer. So that’s it I think (though I wouldn’t bet on it). If so I want to thank you all for your help. Luke especially. Knud
Forums > Jitter