LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial instr. (VISA) VI slowing down performance

Hi,
I tried to use the serial VISA Vi´s of LabVIEW 6 to install a communication
between a "Master" (PC104) and some "slave"-devices via a multi-RS-232 card
(PCM-3643). After writing a command, the master is waiting for a short
respond of the slave, indicating the execution of the command.
I´ve used the property "Termination Character" to detect the end of the
respond. I hoped to minimize the system load by this way, but I realised a
100% system workload while the VI is waiting. With portmon you can see
thousends of status calls to the port instead of few receive events. This
extra-load seemed to slow down the overall performance (and increases the
CPU temperature).
Is there a way to minimize the activities in the waiting
period, or should I
better use the old Vi´s from the Serial Compatibility palette to build my
own loop, including some additional waiting time.
I´m not a very experienced labview programmer (nor a programmer at all).

Thank you

Hans-Joachim
0 Kudos
Message 1 of 3
(2,708 Views)
You can put a check for "Serial Settings"-"Number of Bytes at serial Port" (Property node wired with the VISA session) inside a loop with a wait of 5 ms, coupled witha case statement which allows the VISA read only if there are bytes to be read.

This should reduce the CPU overhead.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 2 of 3
(2,708 Views)
Hi Hans-Joachim,

I like your comment about "and increase the CPU temperature".

Make sure you get a copy of the latest and greatest version of NI-VISA.

A while back they fixed an issue where NI-VISA ate up all of the CPU. This sounds similar to what you mentioned.

The suggestion regarding checking the number of bytes at the port first is always good advice.

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