LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Storing Output Reading Values into Array

Hi,

 

We have a VI to get a power reading from a PM100D power meter. That is working fine, but we want to get those readings and store them into consecutive indices of an array. Plotting these values into a waveform or XY graph would also work. We just need a way to visualize this data. 

 

Thank you so much.

0 Kudos
Message 1 of 9
(1,365 Views)

Assuming your points are spaced equally in time, all you need is a waveform graph. No need for an xy graph.

You can build an array in a shift register.

 

If you just want to display the last few thousand points, just use a chart and set the history size as desired.

0 Kudos
Message 2 of 9
(1,328 Views)

Do you know any LabVIEW?  Can you recognize a While loop?  You should have a While (or possibly a For) loop in your code (which you failed to share with us -- this would really have helped us to help you), something that gives you "power readings" (presumably an indicator that you can see changing when the program runs).

 

If data (on a wire) is generated inside a loop and you bring that wire out thruigh the right side of the loop, the data on the wire usually changes to an array of the data on the wire.  You can plot an Array on a Chart or a Graph.

 

Are you interested in learning LabVIEW and being able to do simple things like this?  If not, are you at a College or University with engineering majors?  Some of them might know LabVIEW and can provide you with some help.  

 

Bob Schor

0 Kudos
Message 3 of 9
(1,324 Views)

I tried doing both of these, but whenever I get the data into an array, instead of storing it into consecutive indices, it stores it in the same, replacing the value each time. I attached a picture of our Power Reader VI. How could I incorporate this storing function?

0 Kudos
Message 4 of 9
(1,258 Views)

@SureSure wrote:

I tried doing both of these, but whenever I get the data into an array, instead of storing it into consecutive indices, it stores it in the same, replacing the value each time. I attached a picture of our Power Reader VI. How could I incorporate this storing function?


Attaching a picture of broken code is completely useless, especially since there is no visible "array" anywhere.

 

(Your stop button has the wrong mechanical action. There is a race condition. Why is there a pink local variable? There are unwired output tunnels. We can't see what's in the outer cases, etc.)

0 Kudos
Message 5 of 9
(1,253 Views)

I am attaching a link to a folder that has all the original VIs that compose the program. I got this program from another forum. Now from what I understand, in case 2 of the case structure, that is where the readout values are outputted. I tried creating a parallel connection that puts those output values into an array as they are generated, but they keep overlapping each other. I tried using the index of the while loop as the index of my array, but no luck either. The picture attached is my attempt.

 

https://drive.google.com/drive/folders/1MbdUD140P2UlPSY91iAnPmKzSUXezVd_?usp=share_link

 

0 Kudos
Message 6 of 9
(1,239 Views)

Hi Sure,

 

why do you need to use some 3rd party webhoster service?

Why don't you attach your code directly in this forum? (Use ZIP!)

 

Additionally you use LV2022Q3 which is not widely supported (due to license issues), so it makes sense to downconvert your project for LV2021 or older! (Btw. it also makes sense to use a real LabVIEW project file!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 9
(1,234 Views)

Hi GerdW, 

 

Thank you for your politeness. I was not aware about LV2022Q3's licensing issues, but in any case, I don't think that is the problem here. I am attaching the zip file, as requested. 

0 Kudos
Message 8 of 9
(1,225 Views)

See the attached code I modified. Let me if this is what you want to accomplish. I got you.

 

~your homework is my homework ~ Haha

0 Kudos
Message 9 of 9
(1,188 Views)