LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XY data tracing

Solved!
Go to solution

Hi everyone,

 

I am having some issues creating a traceable graph on my XY plot. I understand that a line requires at least 2 data points, so as long as I call for data output within the while loop it will only produce a single output point. (see attached sniplet and FP picture). I tried introducing shift registers by dragging the XY graph outside the while loop and replacing the node with shift register, however nothing happens and plotting halts completely. The other similar forum questions seem to be focused on express vi's (which i'm not using) and altering the 'clear data after each iteration' box.

I would be grateful if you could guide me in the right direction, seeing as I'd like a continuous trace of measurements for all points to be extracted afterwards in a data file.

 

Thank you in advance,

Nafsika

 

Download All
0 Kudos
Message 1 of 9
(3,479 Views)

Hi Nafsika,

 

- build the X and Y arrays using shift registers in the loop.

- create the plot for the XY graph inside the loop from those two arrays

- display the plot inside the loop…

Best regards,
GerdW


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

Thank you for your input, GerdW.

 

I am new to shift registers, so attached is my attempt on implementing your comment. It doesn't trace still, and I'm not quite sure why. 

I can see the continuous data flow since effectively the vi works as kind of a scope, yet I can't grasp the input/output relation of the info stream to building the array through the iterations. So each time I take a reading (amplitude), I attribute a timestamp to said reading (time) then build arrays with the elements and cluster them to the XY plot. Thus to trace the plot, I don't see why i need to alter the actual array; the new data point will be created with the recorded new value set regardless, i just want a registration of the previous value to remain in 'memory' of the graph so that it is observable. Does this make sense?

 

Any advice welcomed,

Nafsika

0 Kudos
Message 3 of 9
(3,440 Views)

Hi nafsika,

 

you need to store arrays in your shift registers...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 9
(3,436 Views)
Solution
Accepted by topic author Nafsika

Close, but you are trying to plot individual values, since your shift registers never build up arrays..see example.Shift_registers_arrays.png

 

Message 5 of 9
(3,425 Views)

Hi Cstorey, thank you for your input!

 

I think I understood the concept, I tried editing the code 2-ways, one with shift registers and 1 with express vi's (having unchecked the clear data box). I have attached 2 sniplets, they seem to work, but I would appreciate a second opinion in terms of obvious rookie mistakes I might have made 🙂 (the 2 array size icons are only there for my sanity check)

 

Thank again!

 

Download All
0 Kudos
Message 6 of 9
(3,406 Views)

Ok, you grasped the shift register plotting concept well but there a lot of simplifications you can make.

 

1 - avoid sequence structures, use dataflow

2 - no need to double convert timestamps, the subtract operator does that for you

3 - elapsed time calc was wrong

4 - add error handling

 

Hope this helps.XYshiftregisters_cleaner.png

 

 

 

 

0 Kudos
Message 7 of 9
(3,395 Views)

Thank you. I will try to implement accordingly and learn more in the process.

Out of curiosity, are you using a local variable (to the left of the shift register's input)?

0 Kudos
Message 8 of 9
(3,365 Views)

That's not a local variable, it's an empty array constant.  It's used to initialize the shift registers as empty before the loop runs.  That way the plot is cleared each time it executes.

 

Good luck with your LabVIEW learning.  There are plenty of resources out there, use as many as you can and continue to ask questions.

 

Cheers,

Craig

0 Kudos
Message 9 of 9
(3,357 Views)