LabView Explanation/Notes

View previous topic View next topic Go down

LabView Explanation/Notes

Post by Admin on Mon Aug 28, 2017 1:37 pm

This topic is dedicated to the preparation of a LabView manual/help guide.

Admin
Admin

Posts : 14
Join date : 2017-08-24

View user profile http://cacsphysics.forumotion.com

Back to top Go down

CounterIncrementChange.vi 082817

Post by Admin on Mon Aug 28, 2017 2:13 pm



CounterIncrementChange.vi grabs CountIncrement.vi and changes the initial input.
The reason why you need an external VI to change the input of a VI, is simply because LabView cannot change default values while running.


The CounterIncrementChange.vi breakdown:

The VI is split up into five parts: the Opening, Obtaining Default Values, Changing Default Values, then Comparing the Old to the New, the Check. The VI reads from left to right with the opening stage. Note there are three elements to the opening stage: the Square with the O, the green box, the pink box, and the blue box. The Square with the O is another VI which opens an external VI.(A VI that opens another VI)The pink box and the blue box are a string constant and an integer, respectively. The last element is a "Path" constant. LabView distinguishes between a plain text and path, the benefit to this is transportability. Meaning I can use this VI in a PC or Mac without altering the path constant.

Note that the path constant connects to the Open VI. Essentially, I the path constant is set to the location of CountIncrement.vi and connecting the constant to the Open V. The outputs of the Open VI is a reference to CounterIncrement.vi(green) and an error output(yellow).

The next three sections of the VI are inside a film container which is used to assure order of operation in the RTL fashion. The first section contains a VI which is set to obtain a control value with the name supplied to the "Control Name" tab. The mid-section contains four objects three of which are VIs addressing the referenced VI (from the Open VI, more on this later). The three VIs change the default value then saves the new default values as defaults(this is important because this enables LabView to remember the last shot-number). The final segment compares the old default value to the new default value(I just realized that if I want the VI to be more through I need to obtain the new default value with the second part method.) which outputs a boolean value to the change indicator, the last part of the VI.

The second part of the code consist of one VI, this class of VI enables the control of other VI externally. This VI has three inputs the reference, the error input, and the name string. Then, it outputs three elements: the reference, the error out, and the value contained in the "Control Name" control. Note the color of the control value, which indicates the "variant" class. As of yet I do not understand the variant class. It may have to do with not distinguishing between other values; as in string, integer, float, etc. Also, note that the output is directed to the third section of the film container, this is used to compare the old default to the new default.

The mid-section contains four elements. The first VI is similar to the VI in the previous section, but changes the control value. The VI takes four inputs: the reference, the error in, the name of the control value, and the value you wish to change the control value to(The value must be a variant this is the reason for the fourth element, changing the integer to a variant.) and outputs the reference and the error out. The next VI saves the current values as defaults, enabling LabView to remember changes to its values. The inputs are the reference, and the error in. The last VI closes the opened VI, it takes two inputs: the reference and the error in.

The third section compares the old default to the new value(input), but the two values are of different class so a conversion is needed. This is the reason for the first VI, which changes a variant to a specified class; hence the two inputs: variant and the integer on the top. The VI outputs the variant under the new class, in this case an integer. The last operator is a comparison: if inputs do not equate, send out a "True" boolean value, which is then sent to the change indicator. The idea is that if the input is the same as the old default value, the indicator will not change.

Admin
Admin

Posts : 14
Join date : 2017-08-24

View user profile http://cacsphysics.forumotion.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum