serial port (ttyS1) - Sending commands via terminal... HELP!!!
hey, guys... I need some help, here
I am currently working for a university, trying to program in Perl/Tk a gui that will control this device.
Now the problem: I can't figure out, for the life of me, how to send commands directly through the serial port. The device that I'm programming for takes as input a string (for example "p" for pressure) and it's supposed to return a string that will tell the setting that it's at (eg, ABCDeE FHGIeJ)
ABCD-is a multiplier, and E is the exponent
FHGJ- is a multiplier, and J is the exponent
so when I send "p" I am supposed to get letters like that back... then I need to program to interpret them... that's not the hard part, getting it to take the input and spill back output IS the hard part.
First off, is there any way that I can echo or print or something directly to the device, through serial (just one letter, or so). Second, is there a way that I can get it's response back (even if only to the terminal window). Thirdly, how do I do it?. Lastly, Please Keep it simple.... i'm quite new to this...
*edit* by the way - in case you didn't know, it is RS-232 serial port through a 15-pin D-sub connector (9 pin serial on computer, 15-pin serial on device
Last edited by Nalorin; 05-05-2005 at 04:51 PM.
|