Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all articles
Browse latest Browse all 5663

VISA reading drastically slowing down at 20Hz (Labview + Arduino + Xbee project)

$
0
0

Hi,

I am quite new to Labview and Arduino, so excuse me if I use incorrect terms. I am having some troubles with the following project, I hope you guys can give me some guidance!
I have 16 sensors connected to 16 analog pins on an Arduino mega board. This board has a wireless shield mounted on it, with an Xbee module. I have another Xbee module which communicates with it and is mounted on a USB dongle that plugs into a PC, with Labview 2015.

The A/D output from the Arduino analog pins is read and sent every 50ms to the Xbee module connected to the PC. So every 50ms (that is, a sampling frequency of 20Hz), a new line of comma separated analog readings is sent, using AnalogRead and Serialprint in Arduino. This data is fed to a Labview code with a producer-consumer architecture. This code configures a VISA serial port, reads the data, converts it to a voltage value and writes the data to a text file (see block_diagram.jpg).

The problem is that at a sampling frequency of 20Hz (with the configuration of the attached jpg) when reaching 400 processing iterations the code drastically slows down and values are not parsed correctly. It behaves as if the queue was overflowed (but queue elements indicators show 0), or memory or buffers were full. This seems quite suprising to me since the sampling frequency is so slow. I tried a couple of configurations setting buffer size, flushing the buffer, using waiting times but nothing seemed to work. Is it because the processor loop takes too much time to iterate? I tried disabling the data parsing, the voltage conversion and the text file generation, and just keep the dequeueing reading, and still got the same behaviour.

What may be causing this? Any suggestions to modify the block diagram are very welcome! Is there a more efficient way to do this than with VISA, or queues...?

I am using Labview 2015 on Windows 7.

Thanks!!block_diagram.jpg


Viewing all articles
Browse latest Browse all 5663

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>