LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Communicate via RS232

I am working with a combustion gas analyzer: IMR 1400 IR.
It comes with an RS232 port for communication with a computer.
I am trying to make a LabVIEW program, that will read in the data, then do whatever it is I want to do with it.
I am having a very hard time setting up the communication with the device though.
The Measurement & Automation Explorer isn't even finding the device.

Any thoughts?
 
Thanks 
Cory K
0 Kudos
Message 1 of 16
(3,908 Views)
Hi Cory,
i´m not sure if you can see your device in MAX. You can communicate with it, if you use the VISA driver. Try to use the "Example finder". There are the "Basic and Advanced Serial read and Write" vi.

Hope it helps.
Mike
0 Kudos
Message 2 of 16
(3,905 Views)
You will never see a serial device in MAX. Serial does not have a protocol like GPIB. All that you will see in MAX are the serial ports themselves.

First, verify that you can talk to it with HyperTerminal. This is to verify your COM port settings as well as your cabling. 90% of the problems are here, and have nothing to do with LabVIEW. Then, open the example in the Example Finder, and set the COM port up the same way as you did in HyperTerminal. Pay attention to the termination character if there is one! By default a linefeed is used to indicate to VISA that reading from the device should stop when that character is seen. If this is different for your device (it will be defined in the documentation) you must modify the example in the block diagram since these parameters are not brought out to the front panel.
0 Kudos
Message 3 of 16
(3,898 Views)

What exactly am I supposed to do in HyperTerminal?
So, I'm supposed to set up this whole thing in VISA, instead of MAX?

Cory K
0 Kudos
Message 4 of 16
(3,894 Views)

What you are supposed to do in Hyperterminal is the same thing you are tying to do in MAX - test the com settings, serial cable, and commands. You do not use either to set something up. The advantage of Hyperterminal is that you will often find Hyperterminal instructions in an instrument's manual. If you have problems, you can contact the vendor and explain what you have done. If you say you are using MAX, many will just go 'Huh?'.

When you have the basic communication working, then you can start with LabVIEW and you will use the VISA functions to configure the port and to read/write. VISA is what is used by MAX.

0 Kudos
Message 5 of 16
(3,887 Views)

Well, here's what I know so far

Baud:9600
Data Bits: 8
Parity: None
Stop Bits: 2

For the 9 pin RS232 connection, here are the pins that actually do something:

3 - TXD transmit data
5 - GND ground
8 - CTS clear to send

I have no clue what COM port to assign it to, nor how to do so even if I wanted to.....

I'm not sure what hyperterminal wants me to type,
as far as I got was opening it.

Cory K
0 Kudos
Message 6 of 16
(3,883 Views)

I have an RS232 cable, and I am now not sure if it is the correct one.
It says in the manual of my equipment that I need a "null modem cable"

Is that different from a regular RS232 cable?

Cory K
0 Kudos
Message 7 of 16
(3,880 Views)
No callout for Pin 2 as RXD (recieved data) on your equipment?
A null modem cable swaps pins 2 and 3 around on the other end of the cable so recieve on one end is connected to transmit on the other end and visca-versa.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 8 of 16
(3,857 Views)

You can use whatever com port on the pc that you want. It's rare to find more than one these days but they should be labeled.

Hyperterminal does not know or care what you should type after connecting. That's going to be documented in your manual. It might say that in order to perform such and such an operation, you need to enter the string A1. Type that and hit the enter key.

There are two basic types of serial cables. A null modem swaps the tx and rx lines. That means that the tx pin on the pc is connected to the rx pin of the instrument and the rx pin of the pc is connected to the tx pin of the pc. If the cable is not labeled, use an ohmeter and check for continuity. Stick one of the probes on pin 2 of one of the ends and stick a probe on pin 3 of the other end.

0 Kudos
Message 9 of 16
(3,856 Views)
In addition to the above you may find the following information of some use:

Standard null modem cable for 9-pin connectors. You can get a null modem adapter if you have a standard cable. Got a Radio Shack nearby?

Verifying a Serial Port:Hyperterminal Test

Serial HowTo
Message 10 of 16
(3,849 Views)