Discussion:
Timing for Analyzers How is it handled?
(too old to reply)
MrSafe
2008-08-05 17:10:07 UTC
Permalink
Hi, I have two questions but I didn't want to clutter the forum with multiple questions so I will post them in the same thread hope no one minds.Question #1: I have attached a VI for a analyzer where it will search for a CW and center it with a span of 7 MHz or less. What  I found out is without the Delays it seems lab view runs through everything too fast? The analyzer will often miss the peak when it needs to span in. So when it does span in there is no peek just noise spanned at 7 MHz. However If I add the delays(as shown in the VI) it seems to catch the CW almost 80% of the time. I have tried changing delay times and it seems 1 second is the sweet spot. My question is how do you guys handle issuing commands to instruments which involve delays?Question#2: If I want lab view to come back to a certain point during operation how is it done? For example: Lab View is going from A to C but  I need it to repeat B before going to C. Basically I want to be able to tell lab view to go back to any point of the program at any given time for whatever reason I need it to. Hopfully I haven't confused you to hell.


Get Frequency.vi:
http://forums.ni.com/attachments/ni/170/346793/1/Get Frequency.vi
Stephen_S.
2008-08-07 06:10:05 UTC
Permalink
Hi MrSafe, As far as your first question, LabVIEW will execute the commands that are in your program as you define them. I am not sure what your VI is doing, since I am missing many subVI that I need to reproduce your program, but if there is an instrument that requires delays to control it, then this has to be taken into consideration when writing the program for it. There is no way that LabVIEW can automatically detect what the parameters of the instrument are unless there are built in functions for it.For your second question, I believe that you are describing a state machine. State machines allow you to have different sections in your program that you can run in any sequence, or depending on parameters that you choose. Essentially, it is a case structure within a while loop where each peice of code that you want to run is within a different case, or state. There is a tutorial on state machines and how to build them <a href="http://zone.ni.com/devzone/cda/tut/p/id/7595" target="_blank">here</a>. I hope this helps.Regards,Stephen S.
unclebump
2008-08-07 10:40:20 UTC
Permalink
Here is another link for the statechart module add-on for item#2.
<a href="http://www.ni.com/labview/statechart" target="_blank">http://www.ni.com/labview/statechart</a>
Loading...