LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to read pressure readings

Solved!
Go to solution

Hi Zaqf,

 


@Zaqf wrote:

Could you enlighten me on how I could include the voltage and current readings to the same array , to ultimately save the readings in a single pathway. 


What about using BuildArray to build an array?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 11 of 23
(1,510 Views)

Ohh okay. So after building array I could split it into the array subsets ? 

I will do that then. 

Thank you so much Gerdw

0 Kudos
Message 12 of 23
(1,507 Views)

Think about what you are doing, not about how you are doing it.

 

I haven't looked at your code (but you, and GerdW, certainly have), but here is the Key Question -- are all of your various measurements taken synchronously (by which I mean "at the same time")?  Then what you want to do is to combine these three synchronously-obtained Readings (which I assume, because they are synchronous, will each be in an Array of M samples x N Channels, where the M, number of Samples is the same for the three Arrays, and the N, number of Channels, differs).  

 

So combine them.  Do you want Set 1, followed by Set 3, followed by Set 2?  Some other order?  Go ahead and Build the Array in whatever order you wish to have, ending up with a single array of M samples x (Sum of N) channels.

 

One thing to be careful about -- Build Array appends rows.  As I have configured it, you want to append columns.  [Note that I'm not certain that my configuration is the same as yours, since I haven't looked at your code, but if you are doing multi-channel Sampling, the 2D Array is typically organized with rows = samples and columns = channels).  Can you figure out how to combine Arrays so that Columns are appended?  [Hint -- look at Build Array and at Transpose 2D Array, reading the Detailed Help, if necessary].

 

Bob Schor

Message 13 of 23
(1,505 Views)

Thank you Bobschor  for your valuable piece of information. 

Yes , I am synchronously collecting the readings. I will try to work this out tomorrow.

My concern is if I try to wire set 1 , set2 and set 3 to "build array icon" , should I drag down to open the terminals in the first build array ?  And then if you look into my code , there is another build array following the initial one which is linked with the loop iteration shift register. I hope it doesn't show any error. 

Yes , I want to append rows , so it is fine as it is , I believe. 

Thank you 

0 Kudos
Message 14 of 23
(1,497 Views)

Hello, Zaqf.

 

     You were right, I should have looked at the code you attached.  I'm surprised to see that it incorporates few of the suggestions about working with Arrays that several of us have made to you in the course of this Discussion -- you still seem to be building an array, then taking it apart one element at a time, and putting it back together again.  It is too bad that you haven't learned the proper way to use (and think about) Arrays.

 

      In my many years of using digital computers to acquire data (even before there was an IBM PC), I've (almost) always collected mutliple samples of data at some fixed clock rate (like 100 points at 100 Hz, continuously), or else I collected a series of times between digital events I was studying (usually with a 1 - 10 kHz clock) -- yours is the (rare, in my experience) example of collecting one sample at a time.  

 

     It will be interesting to see how satisfied you are with your attempt to create a single data file with the three sets of data "assembled" together.

 

     Just out of curiousity, can I ask how much data you expect to collect, or, alternatively, for how long do you expect to be sampling data at 2 Hz?  If the answer is "only a few hours", then I'd ask why you are doing so much work within a single While lloop?  In particular, why not collect all of the data, form it into a single 2D array, and when the While Loop stops, bring that Array to a Write Delimited Spreadsheet and write the data "all at once"?

 

     Of course, if you were going to acquire data for, say, a week, say 40 Channels at 2 Hz, all Dbls, that would be 40 x 2 x 60 x 60 x 24 x 7 x 8 (Chans x Freq x sec x min x hr x days x bytes) = 387.072 MB, which can be easily handled by LabVIEW (32-bits).  

 

Bob Schor

 

 

0 Kudos
Message 15 of 23
(1,478 Views)

Hello Bobschor. 

 

I have got a clear idea about how arrays work in this discussion and all the valuable suggestions I heard from this discussion , I was not able to use it as I was away from the computer/DAQ. 

I will be doing all the changes now as I made it to the site . I am sampling at 2 Hz because I am running the experiment for 2-3 hours and I don't need to run at high frequencies. 

So can you tell me if I can still assemble  the three sets of data to single build array and proceed as you have mentioned earlier ? 

If so , what should I do with the following build array.

 

Thank you

0 Kudos
Message 16 of 23
(1,471 Views)

Helloo.

I have replaced all index and array indicators with array subsets and clusters. It looks neat now. 

But still I'm not able to wire the set 2 readings (7 voltage readings) to the temperature array . Once I drag down the build array and connect the set 2 data , only set 2 data is being shown.  And I don't mind removing the loop iteration data from the array too because It is just 2 Hz. 

Please suggest a way with the help of a PNG or pic with ref to the VI

 

 

 

0 Kudos
Message 17 of 23
(1,456 Views)

With LabVIEW, you can quickly build a little Test routine to "experiment" with Learning LabVIEW.  Here's an example -- I have three DAQ devices that produce, at 2 Hz, 23 random temperature readings, 6 random pressure readings, and one "other" reading.  While the data are being acquired, I want to see (or plot, or something) some elements from the most recent sample, and also accumulate all of the samples as a 2D array of 3 sets of data (which I call, temporarily, All Temps, All Pressures, and All Other).

 

Through some "magic" (having to do with Arrays, and hinted at in a previous response of mine), I combine these into a single "All Data" array (ask yourself what is in each row of this array), which I then proceed to write, all at once, to a Test.csv file on my Desktop.

 

Here's a Snippet of the code, which is also included as a LabVIEW 2019 file.

Test Multi-DAQ Data.png

 

Bob Schor 

Message 18 of 23
(1,452 Views)

Thank you so much Bobschor for your valuable response and time. 

This means a lot. 

Unfortunately I am away from my labview system now. The VI looks really good and I hope I will be able to work on this one tomorrow. I'm wondering how the "all data array" collects the array data from "all temps" , "all pressure" and "all others".

Or should I build an array and connect the 3 output arrays to build array and transpose the 2 d array ? 

Anyways thank you Bobschor. Appreciate it

0 Kudos
Message 19 of 23
(1,439 Views)

Bobschor. I am very sorry to bother you again on this subject but I am using labview 2018 and was not able to open the VI. 

But I tried recreating the VI as shown in the snippet and was unfortunately not able to acquire the signals.

I will be recreating a VI and sharing it soon. Looking forward for your support. Thank you

0 Kudos
Message 20 of 23
(1,420 Views)