LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to read pressure readings

Solved!
Go to solution

Hello.

I have a VI developed to measure temperature and pressure using Ni9213 and 9207. 

* I'm not able to receive the pressure transducer readings in the array in this VI. I'm not able to figure out the reason for this , because the same code I'm able to get the temperature readings. 

* When I'm saving the array readings on the USB , the rest of the columns are not being saved on the USB. Would be of great help if someone could let me know the reason. 

* It is not necessary to count the number of loop iterations , I would like to replace it with a time stamp as well. But the wiring errors are popping out once I do it. Could someone enlighten me on how.to execute that.

 

Thank you so much. 

0 Kudos
Message 1 of 23
(2,644 Views)
Solution
Accepted by topic author Zaqf

Some comments (just to make sure we are on the same page):

  • You seem to be taking 16 Channels of data from Mod3 (which I assume is the 9213), though in "mixed up" order, and 6 Channels of data from Mod5 (assumed the Pressure Transducer) at a rate of 2 Hz.
  • The Temperature data are stored in a nx17 2D Array, with columns 0-15 being the sample and column 16 the Row index, while the Pressure data are stored in an nx7 2D Array, with column 0 being the Row index, and 1-6 being the samples.  It is not clear why you did this.
  • You only write the Temperature data to a file.
  • You can "see" Temperature data being acquired, but not Pressure (the Main Problem).

Have you "played" with your Pressure device using MAX?  MAX is a great tool for figuring out how DAQmx acquires data from hardware.  Open MAX, attach your 9207, and open a Test Panel.  Configure it as you wish, and then start trying to acquire data.  If you don't see anything, trouble-shoot.  I'm not familiar with the 9207, which seems to be a flexible Voltage and Current Analog Input module.  Try hooking it up to a 1.5V battery, and see if you can record a DC voltage of 1.5V.  Maybe you have a bad module, or maybe you wired the inputs incorrectly.  

 

Once you know you can acquire data from the 9207, make sure you have set up your LabVIEW VI to use the same parameters you (successfully) used in your Test Panel.

 

Something I learned one of the first times I posted a question to the Forum is that Index Array (which you use a lot!) has a Very Nice Feature -- if you "pull down" the bottom edge of the Function, it provides you additional inputs.  Furthermore, if you don't wire the inputs, they take on the default values of 0, 1, 2, 3, ...  So try this:

Index Array 16.png

 Bob Schor

Message 2 of 23
(2,623 Views)

* Right , 16 temp channels from 9213 mod3 . Ohh I thought it was not in the mixed order as I created the index array to sort it out  How can I correct it to an alligned order , please suggest . And yes , 6 channels from mod 8 which is pressure transducer. 

* What does nx mean. Maybe this is the reason why I'm getting temperatures in the array clearly in 16 columns but not pressure.

I didn't do it knowingly. Please suggest how I could get readings just like the temperature with 0-6 being samples and 7 being the row index. ( This should be the reason for not obtaining pressure values ). Please could you redraft my VI accordingly

* NOT ALL MY 16 TEMP DATA IS BEING SAVEd WHICH IS shocking. When I write it to Csv , only one column is being written with mixed values. Please suggest.

 

Yes , I played with my transducer on the MAX by testing the panels , even though the required readings are not been acquired , some readings are being shown which is not been acquired on the labview code. I thought I would develop the code first , then later configure it accordingly. 

I will try hooking it up to a 1.5 V DC supply but I just want the readings to be read in an array and a chart. I feel there is an error in the labview code to display the array .

Thank you for the new info of index array. I will try that , will it fix the first issue u reported being in a " mixed up order". 

 

Thanks a lot. Please if you redraft a VI , I could work on it tomorrow. Thanks again. Take care. God bless

 

 

 

 

 

 

 

 

0 Kudos
Message 3 of 23
(2,608 Views)

Thank you. I have sorted all my issues. And last issue is writing the array on the USB via Csv format. 

There is some error in the "write delimited file" , sometimes the written Csv file is being corrupted and sometimes it is only copying the last set of values from the array .

I need the whole set of array values to be copied and that's not happening. It seems to be a small error because the same way I have other projects copying the whole set of values from array successfully. 

But in this VI ,there is some error. Could someone help me with it. 

Thank you

0 Kudos
Message 4 of 23
(2,570 Views)

Hi Zaqf,

 

I believe "append to file" set to "True" would help you, in order to write all the values not overwrite anything in the csv file.

Ajskrim_0-1633340145657.png

append to file? appends data to an existing file, if TRUE. If append to file? is FALSE (default), the VI replaces data in an existing file. If there is no existing file, the VI creates a new file.

 

Hope this helps,

 

 

_______________________________________________________________

-Patrik
CLA || CTA
If it helps - Kudo it, if it answers - Mark As Solution
Message 5 of 23
(2,559 Views)

Thank you. That helped. 

In this VI , the number of loop iterations are being saved in the array , instead can I replace it with time stamp with exact time ? 

At the same time I want samples to be read at 2 Hz too. 

Is it possible ? 

Thank you so much. 

0 Kudos
Message 6 of 23
(2,529 Views)
Solution
Accepted by topic author Zaqf

Hi Zaqf,

 

sure, after right formatting you can write timestamp instead of the loop iteration. In your case, as you're writing DBL information into a spreadsheet, you need to format also time into DBL and then add it into an array as you currently do with the iteration number.

GetTime2Double.png

 

Your Sample Rate will not be affected by this. 
Keep in mind that the Rate you set in DAQmx Timing VI specifies the sampling rate in samples per channel per second. If you use an external source for the Sample Clock, set this input to the maximum expected rate of that clock.

If you're not sure about DAQmx in general, I recommend 

Getting Started with NI-DAQmx: Main Page

 

If you struggle in general with the basics of LabVIEW programming, then, well, LabVIEW Core 1, 2 trainings can be a good starting point.

_______________________________________________________________

-Patrik
CLA || CTA
If it helps - Kudo it, if it answers - Mark As Solution
Message 7 of 23
(2,491 Views)

Thank you so much. That worked. Appreciate your time. 

I would like to save the temperature , reading, voltage and current readings in a single csv file with one path created. Is that possible ? My current model required 3 different paths to save temperature , voltage and current. 

Could you let me know your comments on this. I am attaching the VI within.

0 Kudos
Message 8 of 23
(2,445 Views)

Hi Zaqf,

 


@Zaqf wrote:

Could you let me know your comments on this. I am attaching the VI within.


Well, there is so much more to cleanup!

 

See this snippet:

  • You don't need 23 IndexArray nodes, 3 BuildArrays/Bundle nodes and so on! Just some ArraySubsets and ArrayToCluster will do the same! (Read the help for ArrayToCluster to learn about the cluster size option!)
  • You also don't need so many array indicators to show some elements of that array! Either use just one array indicator or convert the array to a cluster of those elements to show them nicely on your UI! Using 23 array indicators to show 23 elements of an array is just insane: it uses 23 times more memory then needed! What will you do to show elements of arrays containing 100+ elements?
  • Use descriptive labels for controls/indicators! It's just senseless to use that large label containing all your sensor/channel names for that 2D array indicator: use a short label and (if really needed) use a larger caption in the UI instead to reduce blockdiagram clutter…

@Zaqf wrote:

I would like to save the temperature , reading, voltage and current readings in a single csv file with one path created. Is that possible ? My current model required 3 different paths to save temperature , voltage and current. 


Yes sure its possible!

You just need to build one array containing all your needed measurement data!

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 23
(2,438 Views)

Hello GerdW 

 

Thank you for this Information. This one is Gold. Now I have an idea how to simplify it .

You have explained it clearly on how I could make it much simpler .

Here , it is possible to gather the 25 temperature readings to a single array and saving the file.

But it seems impossible to incorporate the 7 voltage readings and 1 current reading into that same array , because I am using two "create Daq channels" to acquire the input signals. 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. 

 

Thank you. Appreciate it

 

 

 

0 Kudos
Message 10 of 23
(2,428 Views)