Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 communication

I am trying to build a LabVIEW program to communicate with an Inrad Autotracker III. However I am completely new to serial communication and have not been able to find good resources telling me how to do it. Based on what I've seen online, I think the following code should be able to at least communicate with my instrument, but the VISA read is never able to return a signal and usually just times out. 

 

The manual for the instrument doesn't have alot of information in it but I've included pictures to be helpful. 

 

Any help would be appreciated, because I am quite lost in figuring out how to communicate with this device.

0 Kudos
Message 1 of 4
(1,221 Views)

1. The number of bytes you wrote should not be the number of bytes you want to read.  Instead, just tell the VISA Read to read more bytes than you ever expect in a message.  I tend to use 50 or 100.

 

2. Your settings are wrong.  You need to set the Parity to "even" and the Data Bits to 7.  The rest of the settings for the VISA Configure Serial Port should be left unwired as the defaults should work.

 

3. Go watch this video: VIWeek 2020/Proper way to communicate over serial



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(1,214 Views)

Thanks for the video suggestion. Here are the changes that I made, but I am still getting an error out of the VISA read command.

Download All
0 Kudos
Message 3 of 4
(1,205 Views)

Hi,

 

Adding a time delay somewhere in the block diagram does not do what you want. 

You never know when this is executed (most times at the wrong moment) Look at it with highlight execution on.

You must use the dataflow to force the delay at the right moment. See screenshot.

 

What is the protocol of the device saying about the return data. You are better of using a termination character or a known number of bytes returned.

 

Kees

 

0 Kudos
Message 4 of 4
(1,144 Views)