From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[LABVIEW] how to start two different functions of two differents instruments at the same time?

The ZIP file had not uploaded. I think its because the zip size. I put this in a google drive folder:

https://drive.google.com/drive/folders/0B3DHnU3HZK39bGhxZno5M2I0dHM?usp=sharing

0 Kudos
Message 11 of 12
(214 Views)

Did you see where I said "Take all of the routines that you use, put them in a folder, compress the folder, and attach the resulting Zip file"?  But never mind, I think I have a better idea of what you are trying to do.  See if this is more-or-less correct ---

  • You have a bunch of Controls on the Front Panel.  Some (probably those in the Decoration marked Monochromator) are for the Monochromater, and need to be passed (at some point) to the MoCo VI.
  • You have a button called Start Scan.  When this is pushed, I'm guessing that you want to pass settings to the Monochromator, then "start a scan" (whatever that means).
  • You have a PowerMeter instrument that you use while taking the Scan.  It also has parameters that govern (how?) its behavior.
  • There are two Stop buttons (why?).

So let's assume that my description, above, is more-or-less what you want to do. There is a ordered sequence that needs to be followed:

  1. Parameters for the Monochromator must be chosen (or left at Default Values).
  2. When Start Scan is pressed, the Monochromator must get "loaded" with its parameters.
  3. At (or at around) the same time, the Power Meter must be initialized.
  4. When both are "ready" (however that is determined), the Monochromator must start the Scan, the Power Meter must read the results, data must be collected and saved.
  5. At some point, the Scan ends (either automatically or through User Intervention).  At this point, the data are saved.
  6. Optionally, the program can go back to Step 1 for more data (but think about saving the parameters of the scan and whether to allow different scan values and different output files) or you can simply exit.

A good model for such an orderly sequential routine is something called a State Machine.  LabVIEW has templates for this, and you can also find examples and tutorials on the Web.  There is even some Templates built into LabVIEW that illustrate this concept.

 

Spend some time with pencil and paper (or a good Word Processor) before you start rearranging your Block Diagram.  Be sure you understand the idea of what the Front Panel controls do (vis-a-vis the functioning of your Program -- are they holding a parameter, giving a "command", showing a value?) and code accordingly.

 

Bob Schor

 

 

 

 

 

0 Kudos
Message 12 of 12
(209 Views)