LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Feature request: VISA serial locking

Hi folks,

My application uses a hand full of devices, which are mainly controlled
by serial interfaces. Some of them share a RS485 bus. I use VISA to
prevent the black magic needed with the serial vi´s.

A good style of programming is to have all communication in parallel
wires and separate vi´s for each device (See the error cluster
thread). I have to ensure that only one vi talks to its device at one
time. Other vi´s and devices on the same bus have to wait until the
first vi has completed communication or all data becomes garbled. VISA
GPIB does this with lock/unlock. I tried the lock/unlock vi´s with
serial VISA. It did not work. After digging deep into the VISA
programmer manual for several hours I found that it is
not
implemented. Why?

Putting all vi´s into a big sequence is not the Labview way to do it.

I don´t need shared locking with 'passwords', only plain, unshared
locking. I have to implement this via semaphores myself. Why hasn´t NI
done that?

A good device example is a HP power supply with a GPIB and serial
interface. It has commands to read and both voltages and
currents. Good programming practice dictates using different vi´s for
voltages and currents. On the GPIB interface (pseudo) parallel
execution of both vi´s is possible by using locking. But it is not
possible to use the same vi´s with serial VISA. VISA portability
between interfaces doesn´t work here. That´s a major drawback not
stated anywhere.

IMHO this by itself is worth a fix for LV 5.1. It is not a feature. It
is a bug.

How do you think?

Johannes Niess
0 Kudos
Message 1 of 4
(2,833 Views)

Hi all,

Is the above still true? i.e. VISA locking does not work with serial devices, or is this just an old problem? It's just I have tried using it with no success.

-Martin

Certified LabVIEW Architect
0 Kudos
Message 2 of 4
(2,655 Views)

Locking is a function of the transport layer (i.e. GPIB)

Serial originated with interfaces to teletypes where we used reed relays to create the binary stream. There was never any thought given to locking when it was first implemented (he#$ we were happy it worked).

I have used an Action Engine  to implement locking for multiple devices. Just make sure the transmit recieve operation for each device are contained in the same action so that the reply from one device does not get read by the other device.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 4
(2,645 Views)

Thanks Ben,

Just wish NI would state things like this in the VI context help. I have re-written using semaphores. Thanks for the link to the "Action engine" also.

-Martin

Certified LabVIEW Architect
0 Kudos
Message 4 of 4
(2,632 Views)