What PD are you using? can you create a [comport] object?
Try right clicking to get the help for [comport] to set the parity, flow control etc, and also the devicename.
the message pp2500 would then be created with a stream of decimal bytes like:
112, 112, 50, 53, 48, 48
"112" is the byte that incodes "p" in ascii
you may need a "return" at the end:
112, 112, 50, 53, 48, 48, 10
if you put the above in a message box and send it to the unit through the comport object you should be in business.
I don't have any ASCII encoding table here, so I used the pd "key" object, which I'm not sure is correct...
b.
Jasper van den Brink wrote:
Hi b, Thanks for the reply. Its not a camera that i use, its a pan tilt unit FOR a camera. The ptu is made by dperception.com and it has a rs232 controller. It listens to commands like pp2500 (pan position 2500) and tp600 (tilt position 600). I am an new to this kind of programming. Sorry i dont understand really what you mean. I hope somebody can make a Pd patch for me that i can try and see if it works. I am not good in this. My excuses.
Cheers jasper
On 8/31/05 2:35 PM, "B. Bogart" ben@ekran.org wrote:
Hi Jasper,
What camera did you get?
I'm been using Canon and Elmo serial control cameras in PD the last couple months.
For canon and elmo the protocol documentation states the raw bytes one needs to send to the camera. I thought this was the norm so I'm suprised your getting anything out of a terminal program, since I've been no other cameras that consider the ascii meaning of each byte as significant.
Anyhow thats beside the point.
When using the comport object in PD you have to send each byte as a decimal integer. So you only send it messages from 0-255. It is a very low level interface as things like "\n" are just anyther number from 0-255. Marc Lavallee has written a package called ascii that takes 0-255 and makes symbols and lists out of it, it also takes symbols and lists and turns it back into dec bytes.
My pan/tilt command looks like this:
129, 1, 6, 2, 18, 18, 4, 4, 1, 0, 1, 11, 0, 0, 255
where each "," sends a different message one after the other.
I have used the keyspan on OSX using comport and it works fine. I used the version in the CVS in the iem folder, but It does not have a darwin makefile, but copying the makefile directly from the PD externals documentation worked fine. Also since your keyspan is not a ttyS* you'll need to set the comport device name manually. Check out the help patch on how to do this.
I was thinking of releasing an interface abstraction for this elmo camera...
Good luck.
b/.
Jasper van den Brink wrote:
Hello all, I am new to pd and dont have any experience with pd to, i am learning. What i am trying to make is a controller for a rs-232 pan/tilt unit. I managed to give commands with zterm and it works fine. Command like pp2500 will set the pan movement to step 2500 for example. First thing i want to try is to give commands like that with Pd.
The settings for the pan/tilt unit are: The host terminal or computer should be set to 9600 baud, 1 start bit, 8 data bits, 1 stop bit, and no parity. Hardware handshaking and XON/XOFF are not used.
Using OSX 10.3.9
The keyspan serial adaptor is: USA19QW181P1.]
I have been looking everywhere to see if i could find an example howto just give simple commands to the pan/tilt unit but i cant find it anywhere.
Would somebody be able to send me a Pd patch for it?
Thanks a lot, cheers
jasper
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev