10-30-2017 07:33 AM
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
Solved! Go to Solution.
10-30-2017 07:54 AM
10-30-2017 09:55 AM - edited 10-30-2017 09:56 AM
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
10-30-2017 10:25 AM
10-30-2017 12:14 PM
Close, but you are trying to plot individual values, since your shift registers never build up arrays..see example.
10-31-2017 06:22 AM
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!
10-31-2017 09:28 AM
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.
11-02-2017 08:43 AM
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)?
11-02-2017 10:33 AM
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