08-20-2009 12:18 PM
That's mostly right except for the feedback node.
Post your VI and I'll mod in LV 2009 so you can look.
Ben
08-20-2009 12:28 PM
08-20-2009 12:36 PM - edited 08-20-2009 12:38 PM
Yup!
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
08-20-2009 12:44 PM
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?
08-20-2009 12:51 PM - edited 08-20-2009 12:52 PM
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.
08-20-2009 12:55 PM
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!
08-20-2009 12:59 PM
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
08-20-2009 01:01 PM
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).
08-20-2009 01:18 PM
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.
08-20-2009 01:30 PM
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