Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

serial port communication

Hi,

 

I'm trying to use LabView to communicate with a device through its serial port RS-232.

I'm totally new to this and would be very grateful if someone could provide pointers to get started.

Essentially what I would be doing is sending queries to the device and capturing the output. I have been doing this using hyperterminal and it works. But I would like to use LabView for the same.

Baud Rate - 9600

Data Length - 7

Stop bit - 1

Parity - Even

 

Thanks,

Sukanya

0 Kudos
Message 1 of 5
(3,764 Views)

I forgot to add that I need to implement it using LabView 6.1.

 

Thanks,

Sukanya

0 Kudos
Message 2 of 5
(3,763 Views)

There are serial functions on the VISA palette. I don't remember what examples came with 6.1 but you can try looking there. There may be examples that use an old serial specific driver but I would not recomend using that. It has been obsolete for a long time (well, so has 6.1).

 

There are a couple of VISA functions that are important. One is VISA Configure Serial Port. That is where you set the com parameters. Then you would use VISA Write and VISA Read to send/get data from the com port. Another one that might be valuable is VISA Bytes at Serial Port. You can use this to determine how many bytes are in the serial buffer and pass this information to VISA Read.

0 Kudos
Message 3 of 5
(3,752 Views)

Well, I have never used 6.1 before. I'm more familiar with versions that came after 8.0 but the person am working for now wants it done in 6.1. I guess they don't want to spend on the latest version. 

 

So could you tell me how I can verify if any form of communication is happening between the serial port and labview ? I'm using 9 pin serial port and using a null modem to invert. Also under serial examples there are just 3 basic VIs in 6.1. I keep getting error messages. I'm kinda lost here! Any help would be greatly appreciated.

 

Thanks,

Sukanya 

0 Kudos
Message 4 of 5
(3,739 Views)

The VISA functions in 6.1 are the same as in later versions so if you look at the newer examples, you can duplicate them in 6.1. You verify communication the same way you would with Hyperterminal. You send a command that you know will return some data from the instrument and see if it was you expect. Be sure to append any necessary termination characters such as CR/LF (\r or \n).

 

If you are getting errors, you need to provide the error codes.

 

There have been hundreds of posts on serial communication. Do a search and sort by date. You'll probably get examples that have been written in 6.1. I'm certain that I have posted examples written in 6.1.

0 Kudos
Message 5 of 5
(3,734 Views)