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

Filling an array with serial data in a While Loop

$
0
0

Greetings,

 

I am fairly to new to LabVIEW, but I have a decent understanding of how to get things done. But I am currently stuck.

 

Issue:  I am trying to fill an array with serial data while running a While Loop. Only the first element is filled.

 

                  Specifically, I am running a program that accepts inputs of both pressure and diameter. Diameter is being read in from a Laser Scan Micrometer (Mitutoyo LSM 6200 + 501S). The data is read in using VISA Read, which is as a string. I am attempting to convert the string information into a numeric using scan from string (which, as above, is successful for one element). Then, I want to insert each converted piece of data into an array. I have tried this a few different ways, one attempt is attached, below:

 

I am using a While Loop because I want the program to start by running a DAQ box for pressure while simultaneously controlling a pump and the LSM. Then, once enough data is collected (my stop if True is when the size of the pressure  Array reaches sample rate * sample duration) I stop the LSM, the pump and the VI. Note, this stage of the VI only consists of the Daq box and the LSM. I have yet to buy a pump. 

 

Note also the sampling rate of the LSM is hardcoded into the device itself, but I am inputting an equal sampling rate for pressure. 

 

Every time I run I only get one value for Diameter, yet I fill all of my values for pressure. What am I doing wrong?

 

Thanks for your time,

Matt


Viewing all articles
Browse latest Browse all 5565

Trending Articles



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