01-17-2011 03:49 PM
I have two software VIs made up of numerous other VIs. One software VI is for a Cornerstone 130 Monochromator and the other is for an Avantes 2048 Spectrometer. I want to create a loop so that the spectrometer is set to a specific wavelength and tells the monochromator to start, read, save the signal, and stop...then goes back and changes the wavelength of the spectrometer, etc.
I also need to create a VI for saving the sequence of signals from the spectrometer... The commans I would use with the mouse: File -> Save Experiment -> (type name) -> Ok -> Start -> Stop -> Save -> Experiment -> Ok....repeat.
Any advice would help. Thanks.
01-17-2011 04:06 PM
Your question is pretty much open-ended. It will be tough for people to give you good advices.I'll give it a shot.
If your program flow is strictly sequentially, start out with a "flat frame" or "stacked frame."
Add a loop around the frame will give you repeated sequence. I'm a big fan or state-machine
structure and just recently start using event-driven sturcutre. If you are looking for a structure
to start with, try to search for "state-machine" and "event-driven" in NI developer zone or this labview
forum.
I still consider myself at beginner level so not sure if my comment helps or not =P
01-17-2011 05:21 PM
To both of you:
The sequence structure will work but is almost never the preferred way to set up a program, particularly one which will likely expand and become more complex over time. This program has already grown from two independent programs, one for each instrument, to a combined system. Many of the very experienced and accomplished LV programmers do not use sequence structures at all on only for very specific needs to enforce dataflow.
Look at the Producer/Consumer architecture. The producer may contain the user interface and will send commands to the consumer. The consumer will likely be a state machine with states for each instrument as well as save to file, start up initialization, shut down, and error handling states. This architecture is robust, expandable, easily understood, and widely used by programmers who make their living with LV.
Lynn