LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you save waveform data w/ a variable iteration?

Solved!
Go to solution

That's mostly right except for the feedback node.

 

Post your VI and I'll mod in LV 2009 so you can look.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 21 of 34
(1,650 Views)
Post like this? LV8.5.1
0 Kudos
Message 22 of 34
(1,647 Views)

Yup!

 

Producer_Consumer.png 

 

please note that the string constant "spreadsheet string" defines the type of data the queue will transfer and is wired to the input where that DAQmx taks was wired.

 

You still have to mod the code to do the controlled timing part but this shows how to pass data between loops.

 

Try watching the code in execution highlighting mode to get a better idea of what the code is doing.

 

Ben

 

Ben

Message Edited by Ben on 08-20-2009 12:38 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 23 of 34
(1,640 Views)

Ok, so what is the 'reference' thing you have on there and how did you make the data type 'spreadsheet string', my qeueu wire is still maroon, why is yours pink, and now it will not connect to the 'write to meaasurement' VI...

 

What is the feedback you mentioned?

0 Kudos
Message 24 of 34
(1,633 Views)

Nick B. wrote:

Ok, so what is the 'reference' thing you have on there and how did you make the data type 'spreadsheet string', my qeueu wire is still maroon, why is yours pink, and now it will not connect to the 'write to meaasurement' VI...

 

What is the feedback you mentioned?


 

I poped-up on the wire from the spreasheet function (hence the default name) then dragged it over to where I was creating the queue. The wire color will generally give you a hint as to the type of dat in the wire. Mine was pink because its a string. Your was a "DAQmx" task.

 

The Feedback node is that thing to the upper left in your VI but is missing from mine.

 

here is that code as 8.5 so you can poke at to see where I connected everything.

Message Edited by Ben on 08-20-2009 12:52 PM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 25 of 34
(1,630 Views)

Also your stop button will not work.

 

Unless it is placed in one of the loops, it will only get read once when the program starts, and then never again. It is not functional!

0 Kudos
Message 26 of 34
(1,637 Views)

altenbach wrote:

Also your stop button will not work.

 

Unless it is placed in one of the loops, it will only get read once when the program starts, and then never again. It is not functional!


...and this will become more clear if you watch your code run in execution highlighting mode.

 

Have fun!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 27 of 34
(1,630 Views)

Ha ha stop buttons never cooperate with me...

 

So the code you posted did not have the 'reference' part that is shown in the picture, and is identical (as far as I can tell) to my code (which I altered according to your instructions).

0 Kudos
Message 28 of 34
(1,628 Views)

I put the stop button inside the larger of the two while loops, and it still is not cooperating.

I watched the VI run in highlighted mode, and when I clicked the save button nothing happened (yes, I did set the record points to five (5)).

 

When not in highlighted mode, the saving does work, once. What did making it a qeueu accomplish? It seems to me that I'm where I was before, only perhaps fancier.

 

0 Kudos
Message 29 of 34
(1,610 Views)

Nick B. wrote:

I put the stop button inside the larger of the two while loops, and it still is not cooperating.

I watched the VI run in highlighted mode, and when I clicked the save button nothing happened (yes, I did set the record points to five (5)).

 

When not in highlighted mode, the saving does work, once. What did making it a qeueu accomplish? It seems to me that I'm where I was before, only perhaps fancier.

 


You de-coupled the rates of the two loops. Now the top loop can iterate at the rate indidacted by your constant while the bottom loop can run at the rate the control specifies.

 

This was just the first step.

 

Once you get the two loops running and logging then you have complete the conversion over to a producer consumer structure. I'm not sure I would be serving you well if I just asked you to post a new image and then tell you what to do next. please try to figure out why the saving works once. If you have to, post another image so we can look.

 

You will still have to implement the "variable save" functions. This should be straight froward because you could use a "flush queue" to get the backlog ( all of the entries that were added to the queue by the producer loop while the consumer was waiting) and only keep the last element (delete from array will retun the last).

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 30 of 34
(1,604 Views)