LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to decide the port of RS232 ?

Hi, I am using RS-232 port to control several instruments and I have a card on which there are more than 3 RS-232 ports. Each port connects with one instruments. When I program in Labiew, how can I decide which port is for which instrument? Moreover, can any one provide an example Labview program for RS-232? Thanks a lot.
0 Kudos
Message 1 of 6
(3,667 Views)
Is this a National Instruments RS-232 interface card? If so, what is the model number? (PCI-232/4, etc.)
0 Kudos
Message 2 of 6
(3,667 Views)
Typically, you can use the "VISA Configure Serial Port" to select which port talk to which instrument. You can use a "VISA Resource Name" control on the front panel to identify which port is used with a given instrument.

All the communication settings are done with the Configure Serial Port vi.

You then send commands to the instrument using communicate with the VISA Write. You can monitor responses by checking the number of bytes at the serial port and diplaying it using a VISA Read and attaching the output string to a display (on the front panel).

As for deciding which port to set with which instrument, first cjeck what ports the instruments can talk to. Is it limited to COM1 or COM2? What settings should be used, and so on. Verify that you c
an satisfy the requirements of the instrument. Fom that you decide what port to attribute to the intrument.

Providing an example would require knowing a bit more what you are using for a multiple Serial Port. I would not want to lead you in the wrong direction.

Hope this helps..

JLV
Message 3 of 6
(3,667 Views)
Hi, JLV,

Thank you so much. It's very good. I am using the RS-232 card with 8 ports from National Instruments. And what is the VISA ? Where can I find any explanation for that ? I
used GPIB with Labview, and I know that there is an address for every instrument. Are they similiar for deciding which port to which instrument?

I think that if you give some simple examples, they are very helpful for me to understand easily.

Thanks again.
0 Kudos
Message 4 of 6
(3,667 Views)
Hi Whuili,

From your block diagram, go to your Functions Palette.
Within that, look under Instrument IO.

First go to VISA, then VISA Advanced.
Place a VISA Open on your block diagram.
Go back to Instrument IO, but this tiome go into Serial. In there you will find the vi's to configure the serial port, read, write and close the port.

Of course, open the serial port first by placing a VISA Resource Name Constant to the OPEN VISA vi. This is where you select which COMx port you want for which instrument. You should be able to see all 8 ports if they were previously setup (from Windows).

I forgot to ask which version of LV you are using. I am using LV7, so there may be a few differences to my instructions, as I don;t remember the ex
act placement of the VISA-Serial vi's in the previous versions.... I think they should be relatively the same.. ;o)

Hope this helps..

JLV
0 Kudos
Message 5 of 6
(3,667 Views)
Hi, JLV,

It is so good. Thank you very much.
0 Kudos
Message 6 of 6
(3,667 Views)