Go Down

Topic: Using Arduino with RS232 Shield to access a terminal (Read 718 times) previous topic - next topic

venngomez

Hi,

I have a terminal that a PC can receive and send data with the cable in the diagram attached. now I'd like to replace the PC with an Arduino with a RS232 shield as specified in the other diagram, so far I can send a few bytes over from arudino, but seems not getting any response, looks like the cabling issue, can anybody give me a guidance on cable pin layout that will work in this situation? Thanks,

V.C.


PaulS

Quote
I have a terminal that a PC can receive and send data with the cable in the diagram attached.

Links are better than pictures any day of the week.

Quote
so far I can send a few bytes over from arudino, but seems not getting any response

How do you know that you can send data, if you are not getting any response?

Using what code?

venngomez

the link to the rs232 shield is:http://www.wvshare.com/product/RS232-Board.htm
I know data got sent to the device from Arduino from the response of the terminal, it printed something every time i sent:
  Serial.begin(38400);

  byte job[] = {0x04, 0x61,0x61, 0x05};
  for (int i = 0; i < 4; i ++) {
    Serial.write(job);
  }


  // expecting two bytes from the terminal after sending the job above, but nothing come out   
  int cnt = 0;
  while (cnt == 0) {
    n = Serial.read();
    if (n != -1)
      cnt ++;   
  }

venngomez

the code is:

Serial.write(job [ i ]);

not:

Serial.write(job); i think formatting removes the brackets

PaulS

Quote
i think formatting removes the brackets

Not if you post code using the # button up there, like you should.

Quote
the link to the rs232 shield is (not formatted correctly - see those buttons up top? Learn what they do)

Don't care yet) about the shield. I asked about the device you expect to be replying.

venngomez

Hi Paul,

there is no link to that device, it's a dump terminal, in PC we use ACK/NAK to communicate.

Go Up