08-01-2018 05:29 PM
Hey guys so this is an interesting problem. I am using a queue to pass information from on VI to another. Both VIs are on the host computer. One VI (Data Viewer.vi) is getting information from a cRIO and displaying it on 4 charts and passing it to the other VI (Record.vi) to record it into a file. Here's where it gets weird though. The data comes from pressure sensors. When I increase the pressure the Data Viewer.vi shows the increase in pressure but the Record.vi never sees this increase however the record.vi is seeing information from the sensors. Any ideas of why this is? See attached pictures for more information. Thanks!
Solved! Go to Solution.
08-01-2018 05:35 PM - edited 08-01-2018 05:36 PM
You attached two meaningless pictures and a broken snippet. If you want us to help you, please attach simplified working VIs.
(What we can see are greedy loops and Rube Goldberg logic everywhere... 🐵
08-02-2018 01:38 AM
As suggested by Altenbach, Please attach sample code/ Code Snippet.
Based on the attached code i suggest you to go through LabVIEW basics and working process of State Machine Architecture
08-02-2018 05:13 AM
If you have to attach images, you might as well add them as images (safes us a few clicks):
08-02-2018 08:38 AM
Here are the VIs.
08-02-2018 09:24 AM
There would be a ton of remarks to do. Picking one of the most important: apparently you would like to save while acquiring. However, as you did not wire False to Wait Until Done, running Record.vi will pause the acquisition. Record.vi will then process all data stored so far into the queue since the beginning of the acquisition, until the queue is empty: now Dequeue Element will wait forever (timeout is -1) for new data that will never come, so you will not be able to stop the loop and exit Record.
So why not to put Record management in the lower loop, calling the vi normally? Also, you should avoid infinite wait in dequeuing, managing the timed out? output properly.
Also remark that pacing the recording loop with Delay Timer is not useful, as the loop is already timed by either the data rate or the timeout you should choose for dequeuing (say 100 ms, as your acquisition loop is timed at 20 ms).
08-06-2018 03:46 PM
What do you mean when you say "So why not to put Record management in the lower loop, calling the vi normally?". Put Record management in lower loop of the Data View.vi?
08-07-2018 01:49 AM
Yes. Acquisition and recording will be managed in parallel. Remember that all data will be saved, also those taken before you press Record.
Also, you don't need to call Record.vi dynamically.
The loop in Record could be managed as follows (I removed some unnecessary code).