LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing values to sub VI and writing data to controls

Solved!
Go to solution

As part of a control interface for a VFD i am interfacing with using Modbus TCP I wanted to try and compartmentalise some of my code into a subVi

 

However in doing so I am having a lot of trouble understanding how I can read the current drive settings for the Ramp up and Down values and update those values into the main faceplate of my control.

 

The sub Vi is tested and works exactly how I want. Selecting Read (latch on pressed) reads the registers from the drive and outputs it to the controls and the indicators. The indicators were incorporated because I did not know how to pass the data out of the sub vi without them. Updating works to write the current value in the controls to the VFD registers.

 

However when I incorporate this VI into my larger project the values are always displayed as zeros if I have the switch set to latch. However i do see a momentary flash of the correct values soon after pressing the read button or if i change it from latched operation to switched, however i would prefer it to opperate in a latched mode so as to reduce communication overheads to the drive. 

0 Kudos
Message 1 of 2
(2,654 Views)
Solution
Accepted by Apothus

Hi,

 

A number of suggestions:

1. Use references and property nodes to set FP indicators from a subVI (you can learn more here and here)

2. Don't put output indicators inside Cases. When the case is not Read, the VI outputs default values to the outputs and gives you the zero values. 

 

Good luck,

Danielle

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
Message 2 of 2
(2,621 Views)