Prev: Re : Re: Re : Re: Re : Re: Problem with TDMS in Matlab
Next: Using Event Structures with Array of Clusters
From: tzj on 4 Aug 2008 12:10 I have a case structure running in a while loop and I need to get the number of times the case runs true. Ideally, I would like this count to reset when the case changes to false. A point in the right direction would be greatly appreciated. I thought about using local variables but that would slow down the loop. Thanks!Tim
From: smercurio_fc on 4 Aug 2008 12:40 Use a shift register. Check the LabVIEW Help and tutorial on how to use shift registers. Why do you think that a local variable would slow down the loop?To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's <a href="http://zone.ni.com/devzone/cda/tut/p/id/5054" target="_blank">Learning Center</a> which provides links to other materials and other tutorials. You can also take the <a href="http://www.ni.com/academic/lv_training/how_learn_lv.htm" target="_blank">online courses</a> for free.
From: yenknip on 4 Aug 2008 12:40 Use an integer shift register on the while loop, initialise it to zero, then increment it in the true case. Set it to zero again in the false case
From: tzj on 4 Aug 2008 12:40 Ok wow, I don't know how I missed that...much easier than the convoluted solution I had in mind. I feel quite dumb but problem solved. Thanks for the help!Must get more sleep :)
From: muks on 5 Aug 2008 09:40
I thought about using local variables but that would slow down the loop. And Why do you think so? |