Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem using case structure inside while loops

0 views
Skip to first unread message

drfunkphd

unread,
Aug 14, 2008, 2:40:07 PM8/14/08
to
Hi all, I am currently building a VI (using 8.5.1) to monitor and control a pressure tank system.  It mainly uses a while loops to retrieve the pressure data and export commands and signals using a DAQ.  I am running into a problem when trying to record the data.  Recording is done at a much slower rate than the sampling, so I used a timer to trigger a case structure.  This then retrieves all of the readings and writes them to an excel spreadsheet.  The problem is that while the recording is taking place, all other sampling has to wait for the recording to finish.  Is there any way to make the while loop continue to run simulataneously with the case structure?  Or am I approaching the entire recording process in the wrong manner?  I'm new to Labview, and this seemed to be the simplest way to accomplish the task.  Any feedback would be much appreciated.  Thanks - Dan


The BeastMaster Final.vi:
http://forums.ni.com/ni/attachments/ni/170/349391/1/The BeastMaster Final.vi

GerdW

unread,
Aug 14, 2008, 4:10:10 PM8/14/08
to
Hi DrPhunk,&nbsp;other ideas:- using a subvi for parts of code used more than once? See attachment...- cleaning up your logics for the boolean part in the upper right corner of the big loop? Look at my comments (from simple replacements to wel-known Rube-Goldberg!)&nbsp;For your problem:Put independent DAQ parts into seperate loops. Use consumer-producer pattern <a href="http://forums.ni.com/t5/util/emoticonspopuppage" class="emoticon-link" target="_blank"><img src="http://forums.ni.com/i/smilies/16x16_smiley-wink.gif" border="0" alt=":smileywink:" title="Smiley Wink"></a>


beast.zip:
http://forums.ni.com/ni/attachments/ni/170/349436/1/beast.zip

drfunkphd

unread,
Aug 15, 2008, 2:40:04 PM8/15/08
to
Thanks again guys.&nbsp; I'm going to try to implement all of the suggestions you mentioned.&nbsp; I'm sure I'll be checking back as I run into problems.
0 new messages