|
|||
|
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 |
|
|
||||
|
||||
|
|
|
|||
|
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
|
|
|||
|
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.
|
|
|||
|
Well, here's what I know so far
Baud:9600Data Bits: 8Parity: NoneStop Bits: 2 For the 9 pin RS232 connection, here are the pins that actually do something:3 - TXD transmit data5 - GND ground8 - 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. |
|
|||
|
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. |
|
|||
|
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. |
|
|||
|
In addition to the above you may find the following information of some use: <a href="http://www.cc86.org/%7Epjf/hwb/ca_Nullmodem9to9.html" target="_blank">Standard null modem cable for 9-pin connectors</a>. You can get a null modem adapter if you have a standard cable. Got a Radio Shack nearby? <a href="http://www.ni.com/support/serial/verhyper.htm" target="_blank">Verifying a Serial Port:Hyperterminal Test</a> <a href="http://www.cab.u-szeged.hu/LDP/HOWTO/Serial-HOWTO.html#toc3" target="_blank">Serial HowTo</a>
|
|
|||
|
So if I plug in this device into the serial port in my computer, where can I find it.
I'm not sure what the computer will call it, or what COM port it will assign it to (if that's what the computer does) I'm not terrible at communicating with the device once I have my LabVIEW program recognizing the device. Setting up the device so it is recognized is the hardest part for me. |
|
|||
|
Cory K wrote:
So if I plug in this device into the serial port in my computer, where can I find it. I'm not sure what the computer will call it, or what COM port it will assign it to (if that's what the computer does) I'm not terrible at communicating with the device once I have my LabVIEW program recognizing the device. Setting up the device so it is recognized is the hardest part for me. You can find the device at the end of your serial cable.:smileyvery-happy: MAX will not call your device anything. It doesn't even know that it is there. The only thing that MAX knows about serial is whether there is a com port or not and what the default settings for it are. The actual com port number is assigned by windows but it is something that you can change as long as the name does not conflict with another port. You are the one that assigns the device to a port when you select wwhich port to plug it into. Can you explain exactly what you mean by LabVIEW recognizing the device? As I said, MAX and the VISA Resource Control only recognizes serial ports. |
|
|||
|
Hey Cory! Dennis is completely right. Serial Protocal has no protocal for device identification; thus, unlike GPIB, you won't be able to see the device in MAX. What this means for us is, as long as you are able to use Hyperterminal to communicate with the device as outlined previously, you will be able to use basic serial example VIs to communicate with the device as well. Once you get to that point, you can then start working on developing a driver. Hope this helps!
|
|
|||
|
Well in case anyone was wondering, I finally got this thing working.The problem ended up being I had a regular DB9 RS232 cable instead of a null-modem cable.This made it so the Transmit and Recieve pins weren't connected.Anyways, now at least I can communicate with the device.Thanks for all of your help everyone.
- Cory |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|