01-09-2015 11:18 AM
Hello LabVIEW gurus,
I'm working on some code that fills a matrix with voltages read off of a meter. I'm picking the index that the voltages are put into because it needs to be in a specific order. My code works and the voltages are seen in the index they are supposed to be in, however they don't stay. When the meter reads another data point, the previous index is reset to zero. It only show up in the matrix before the next data point is read by the meter. I would love if the matrix was full of data when the code stopped, but I can't figure out how to do this really.
I posted a piece of my code to show you all how the matrix is being made and filled.
Any help would really be great!
thanks all
Solved! Go to Solution.
01-09-2015 11:27 AM - edited 01-09-2015 11:29 AM
Hi fresh,
two points:
- THINK DATAFLOW!
- Don't mix up the terms "array" and "matrix". These are similar, but different things in LabVIEW!
See this snippet:
- THINK DATAFLOW: values are stored in wires and shift registers! (Indicators are just data sinks, controls are data sources…)
- ARRAY: use array functions (like ReplaceArraySubset) to manipulate arrays!
01-09-2015 11:43 AM
That is going to happen every time you write default values to terminals in a loop!
Your code makes very little sense- lets do a walk-through
That is not likely what you want the code to do.
01-09-2015 12:03 PM
Thank you both for the replies!
Gerd that picture helped me, I figured out how to fix it and now I have an array the fills perfectly with my measured voltages. Thanks Jeff, that helped me understand the data flow better, I didn't realize what I was doing wrong until now, I'm pretty sure I get it now. I had similar problems like this before and I think I've been making the same mistake
01-09-2015 12:19 PM
@winterfresh11 wrote:
Thank you both for the replies!
. I had similar problems like this before and I think I've been making the same mistake
I suspected as much. Thats why I took the time to walk it through. Training is available- consider it.