LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI is not graphing all 4 points of data

Solved!
Go to solution

Hi all, 

 

My VI is not plotting all 4 points of data. I have using a cDAQ 9172, with a 9207 and 9211 card to pick up thermocouple and pressure transducer input. My VI that I have attached is plotting the thermocouple data but not the pressure data. I have confirmed in MAX that the pressure sensors are feeding signals in, albeit the mA signal is negative. 

 

Let me know what you guys think. Thank you. 

0 Kudos
Message 1 of 6
(1,172 Views)

Hi CMSys,

 

cleanup your VI. Use Auto-Cleanup.

Then check your shift registers: one of them is not initialized like the others…

 

Your algorithm is flawed: there should be no case structure around the while loop!

And using a STOP function inside a loop is also a sign of bad VI design…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(1,166 Views)

as has been said, your code is highly flawed and overly complicated. I would recommend to work out the logic with simulated data before implementing the hardware IO. Much easier to test and verify correct operation.

 

  • Building arrays by prepending the new data is very hard on the memory manager and extremely inefficient. Try to append the data instead.
  • If you do the acquisitions right, the time points will be spaced equally and all you need is a waveform graph with the correct dt based on the loop timing. Half the data!
  • Once you have a waveform graph, all you need is a single shift register containing a 2D array where you append a new row of four elements.
  • Your case structure is pointless, because the loop cannot stop unless the value is true, so the FALSE case can never happen anyway. Right now it is just a glorified sequence frame.
  • zeroes are probably not reasonable default values for your scaling constants. (Unless you allow these to be changed during execution, the terminals should not be where they are. If they are always the same maybe they could be diagram constants instead.)
  • You are not interested in centuries, so use "high resolution relative seconds" of you need to measure the loop times.
  • Yes, one of your shift registers is not initialized and will retain stale data from previous runs of the same session.
  • A "\t" in normal display is probably not a useful delimiter.
  • It is dangerous to have the saving outside the main loop, because the data is irreversibly lost if something fails. Think state machine. With a proper state machine, even the start function can be correctly implemented. (having an outside case structure means that you are probably using "continuous run". Don't!!!)
  • The VI will come to an end once it runs out of code. the abort function is never really needed.
  • You forgot to wire the column headers for the first file function.
Message 3 of 6
(1,116 Views)

All good advice and suggestions. Thank you!

0 Kudos
Message 4 of 6
(1,099 Views)

Thank you for your response Knight of NI. I have several follow up questions, and I have attached the most recent revision of the program. I would really appreciate it if you modified my code to integrate your suggestions. I am also now reading all 4 points of data, but: 

 

1. My X-axis(Time) is not continuing to expand with the data points that its taking over time. 

2. I was not able to figure out how to append all of the collected data through each loop, into an array that I would save as a file at the end, 

given the user chooses to do so. 

3. For my AI current channels, they are pressure transducers, and I need to convert these values to PSIG readings. I am not sure if I should use property nodes to do this, or which ones I would use. 

 

Thank you

0 Kudos
Message 5 of 6
(1,057 Views)
Solution
Accepted by CMSys

@CMSys wrote:

Thank you for your response Knight of NI. I have several follow up questions, and I have attached the most recent revision of the program.


So far you have not attached anything, but here's how the data structure could look like: To scale the raw data into measurement units, you use calculations, not property nodes. I would operate directly on arrays. Values that don't need change, could use m=1, b=0, of course. Don't forget to set the graph to transposed (right-click...transpose array).

 

altenbach_0-1685165432750.png

 

 

 

Message 6 of 6
(1,016 Views)