View Single Post

   
  #11 (permalink)  
Old 01-16-2008, 07:28 PM
jimp@specsol-spam-sux.com
 
Posts: n/a
Default Re: RS232 programming, helps needed...

linda <plinda77@yahoo.com> wrote:
> Hi All


> I am doing a project recently requires RS232 communication between a
> hpux workstation and a robot. This machine has its own RS232
> communication protocol which can accept commands and return result
> from queries. The RS232 connection requirement is very simple.


> the workstation the machine
> 9 pins connector 25 pins connector


> Pin 2(Rx) connected to Pin 2(Tx)
> Pin 3(Tx) connected to Pin 3(Rx)
> Pin 5(Gnd) connected to Pin 7(Gnd)


> Ive wrote a C code to control the machine. Apparently, the machine is
> accepting the commands from the C program and performed its tasks, but
> wouldnt response to the queries that Ive sent from the program.
> Therefore Ive probe(pin2 - Tx) from the 25 pins Dsub connector and
> found that the machine is actually returning the expected result but
> the serial port is not set to read the result. The read result return
> -1.


> I am not a RS232 programmer and this is the first time I am doing so.
> But I think it must something to do with the RS232 options that I
> should set in my hpux box.
> All kinds of RS232 related helps are appreciated. Thanks in advance.
> ~


For a direct connection, i.e. no flow control, you should be using the
device file that has 00 as the last 2 digits of the minor device number.

As in:

crw--w--w- 1 bin bin 78 0x023800 Sep 23 07:11 tty2d9
^^ These digits.

The termio man page should explain these bits.

--
Jim Pennino

Remove -spam-sux to reply.
Reply With Quote