LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to insert a SubVI

Hi guys,

 

so in my software (2014_Conex working version) a small delay stage is controlled by an external Conex CC controller box (both Newport). At the moment, the delay stage moves in a specific range and steps at specified number of positions. I'd like to add a Newport Power Meter (PM, 841-PE-USB;) in such way, that it measures the power at a specific position and then plots both, where the position of the delay stage is x-axis and the power is the y-axis. I was told to save the PM code as a SubVI since it's fairly small and just insert it into the main and larger code. I'm not sure, where and how to connect the SubVI and I was hoping you could help me? I'd really appreciate your help, since I'm new to LabVIEW. 

0 Kudos
Message 1 of 3
(2,670 Views)

Some very quick comments:

  • The VI you uploaded (Virtual Power Meter Saved as VI) doesn't help that much - the subVI inside it would have been more helpful. At the moment, all we can see is the names of the connections you've made (or was that was intentional, because you can't upload the PM code?)
  • If you want to take the power readings during the movement, that's probably where you want to put your subVI. However, be careful about timing - the loop currently takes 200ms to run and I don't know how long a PM measurement might take (or if it's important that the motion be tracked at that speed)
  • In the same case, you have a bunch of Property Nodes. Given these aren't using explicit references, but are instead linked to FP controls, you could consider Local Variables instead of the Value Property Nodes
  • You're setting the Disabled property of "Set velocity" twice - remove one 🙂
  • Use the Typedef for the Enabled/Disabled/Disabled and Greyed out to improve readability (right click and Create > Constant to get one of these)
  • Try and rearrange Case Structures and Wires such that they don't overlap and you can easily see the wires, for example:

updated.png


GCentral
0 Kudos
Message 2 of 3
(2,639 Views)

Hi,

 

thank you for the suggestions. Here's the full code for the PW: 

0 Kudos
Message 3 of 3
(2,636 Views)