11-06-2012 09:48 AM
Hello NI community,
I am having difficulty consistently reading a Sensiron Flow Meter through a VISA while also reading a voltage through a DAQ. I found the VISA VI's from a different thread (http://forums.ni.com/t5/LabVIEW/Looking-for-sensiron-liquid-flow-meter-VI/td-p/1600392) and have attached all the VI's I am using (There are multiple so see replies).
My issues is that I will sometime get the main VI (Flow Base_12-11-02) to work, but other time it will not always read from the VISA displaying an error with either the VI startSampleSensirion.vi or initialize.vi When this error occurs it seems like the output of the data file is faster than when the program is working normally.
I have obtained data from the .txt file when the program works as intended but that amount of data is inconsistent to the sampling rate. I am a novice with LabView and was working off of the mostly working VI from the other thread mentioned above.
The intent of the program is to read the value from the VISA and once the value has reached below 50% of the initial value to stop the program and do a calculation from the values coming from the DAQ. The formula wasn't developed due to the issues with the current design.
Thank you for your assistance
Alex
11-06-2012 09:49 AM
More Vi's part 1
11-06-2012 09:50 AM
More Vi's part 2
And an image of block diagram
11-06-2012 05:14 PM
Alex,
I have not downloaded all of your VIs but I looked at the block diagram (BD) image. You can zip all of the VIs and attach just one file in the future.
With all those local variables you probably have serious race conditions. LabVIEW is a dataflow language and local variables break the dataflow. For example the locals at the bottom of the loop (which you mysteriously convert to a matrix, when a 2D array is all that is needed) are most likely read before the locals above are written. So the data will be one iteration behind, or maybe not. Although unlikley, it is theoretically possible that the locals might be read before the Initialize Array funcitons complete.
Learn to use shift registers. None of your locals are required.
It is also recommended to use Build Path rather than the String to Path conversion. It does some internal checking which may help avoid problems, especailly if you ever do any cross-platform work.
The Comparisons palette has a Less Than or Equal primitive which directly produces a boolean output and takes several hectares fewer of BD space.
Lynn
11-08-2012 10:01 AM
Here is the the zip file with all the VI's.
Sorry for the inconvenience.
Alex
11-08-2012 10:29 AM
You might also want to look into Autoindexing Tunnels for your building of arrays. That would eliminate the need for almost all of your Insert Into Array and therefore almost all of your local variables. The other few could be done with a shift register.