How to communicate with this devie

I have an instrument to communicate with using serial. The instrument can communicate with a pc using serial and receives instructions from pc and act. In its manual, it saids, its configuratiion is following:

Interface:
RS 232 C; 1200 to 9600 Baud; 1 or 2 stop
bits; 7 or 8 data bits; no, odd or even parity;
handshake:

Factory default settings:
line delimiter:
data delimiter: , (comma)
handshake: software (XON/XOFF)
data bits: 8
stop bits:1
parity:no
baudrate: 9600

The question is how to communicate with it using an arduino and labview interfacing with arduino. So far I want to at least be able to talk to it (even manually via a serial app). Do I need to type special charactrs or something at the end of each line of command? Should first make the handshake (and how) before I can send anything to this guy?

How about a link to the mystery device user manual?

What Arduino are you using?

Why not just use Labview to communicate with the device? Why the Arduino?

Please read the forum guidelines.

The "handshake: software (XON/XOFF)" is something you will have to watch for as you are sending. The XOF tells you to stop sending to the device. The XON tells you to resume sending to the device. You will not be able to use any of the usual ready-built Arduino communication libraries if this is truely being used by the device. It means the communication is designed for full-duplex operation. And that means you need to see if there is a character to be read after every character you send. If nothing, send the next character. IF there is something to read and you read it and it is an XOF, do not send another character until your receive an XON from the device.
Your mystery device must be really old and have a really slow processor.

Paul

groundFungus:
How about a link to the mystery device user manual?

What Arduino are you using?

Why not just use Labview to communicate with the device? Why the Arduino?

Please read the forum guidelines.

It is a lab instrument about 20 years old. Back then, it cost a lot I heard. And as you can imagine, there is no online manual as far as I know. I read the paper version (from my mentor) and found the only relevent part to this communication is the part listed above.

I am using a 2560 (and I do have uno and nano). I would like a portable device which can control it, rather than a pc with labview

Paul_KD7HB:
The "handshake: software (XON/XOFF)" is something you will have to watch for as you are sending. The XOF tells you to stop sending to the device. The XON tells you to resume sending to the device. You will not be able to use any of the usual ready-built Arduino communication libraries if this is truely being used by the device. It means the communication is designed for full-duplex operation. And that means you need to see if there is a character to be read after every character you send. If nothing, send the next character. IF there is something to read and you read it and it is an XOF, do not send another character until your receive an XON from the device.
Your mystery device must be really old and have a really slow processor.

Paul

Thanks, Paul, it is really useful information. Yes, it is about 20 years old and belongs to the teacher of the teach of mine originally. I also found something like this on manual, so just use (modern) windows terminal to:

  1. The communication can be tested using a simple interface program, e.g.
    Windows Terminal, Procomm or Hyper Terminal.
    2.When the login window of "audit trail" is displayed, the instrument cannot be
    controlled by the PC.
  2. Commands consisting of several words can be entered with or without
    blanks (e.g. getdata ↵ or get data ↵).
  3. Commands refer to the currently activated method. In addition all "get..."
    commands can be extended by a method number.
    Example: get data head 3 ↵ ... data head of method 3 will be transmitted,
    independent of the activated method.
  4. Each set of measuring results transferred by "get data ↵" will be marked (see
    chapter 11.2.11) in the memory by "fetched by host computer: y".

Do you have an old computer with RS-232 connector ? Then you should test it, to be sure that the device still works.

For the Arduino, you need a rs232-to-ttl-converter. They have a MAX3232 chip.
Dc5v max3232 max232 rs232 to ttl serial communication converter module with jumper cable geekcreit for arduino - products that work with official arduino boards Sale - Banggood.com-arrival notice-arrival notice.

The Serial.begin(9600) uses default no parity, 8 bits, 1 stopbit.
The Serial.println() adds a and at the end of the text.

Try the most simple command first. Is there a "give me your name" or "give me your id" command ?

Maybe you have luck and the XON and XOFF are not needed. As soon as you receive one of those, then you can try to slow it down by adding a delay after sending each character. If that is not enough then you might have to implement the XON and XOFF.

Your lab instrument may only be 20 years old, but the use of XON-XOFF says the design is at least 50 years old.

Paul

Koepel:
Do you have an old computer with RS-232 connector ? Then you should test it, to be sure that the device still works.

For the Arduino, you need a rs232-to-ttl-converter. They have a MAX3232 chip.
Dc5v max3232 max232 rs232 to ttl serial communication converter module with jumper cable geekcreit for arduino - products that work with official arduino boards Sale - Banggood.com-arrival notice-arrival notice.

The Serial.begin(9600) uses default no parity, 8 bits, 1 stopbit.
The Serial.println() adds a and at the end of the text.

Try the most simple command first. Is there a "give me your name" or "give me your id" command ?

Maybe you have luck and the XON and XOFF are not needed. As soon as you receive one of those, then you can try to slow it down by adding a delay after sending each character. If that is not enough then you might have to implement the XON and XOFF.

Thanks!

I have got one of this usb to rs232 converter

Yes, I would like to test it with a computer so it is easier I guess to start with. Will any regular serial program for usb to ttl adapter be able to do communicate using this special protocol (including sending and displaying the XON and XOFF)?

RealTerm is a good one, especially if you want to detect non-printable control characters such as newLines and carriage returns

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.