LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CLD security example intialise state

Hi

 

I'm studying for the LabVIEW CLD exam and was going over the security example.

 

I noticed that the initialise procedure for the control clusters uses the property values to initialise (see attched jpg).

 

I recall that setting the values of a control via its property reference is considered a massive no, no!  So how about using a local variable?  If I do this the CLD correction machine will mark me down for using a local variable.

 

Does anyone know how to intialise a control Cluster such as this without getting docked marks?

 

 Sean

0 Kudos
Message 1 of 4
(2,693 Views)

Good question.

 

I wonder how they would feel about setting the default values within the cluster controls.

 

 

Another approach was to create a sub-vi which contained the clusters and set the initial values within them.

 

Maybe I'd need to post an example to illustrate what I mean by that. 

 

Picture a subVI that contains the clusters (type def).  You bundle by name the default values.  Then you have cluster indicators which all contain their corresponding default values.

In the main VI, you wire the outputs of the above subVI and you have your initialized clusters with their default values.

 

Remember to comment everything: indicators, wire labels, connector pane, etc..

0 Kudos
Message 2 of 4
(2,675 Views)

SeanJ wrote:

 

 

I recall that setting the values of a control via its property reference is considered a massive no, no! 


I wouldn't consider using value property nodes such a massive no, no.  In the situation of initializing controls, you are doing it once and at the beginning of the program.  The performance hit of using a property node is not going to be that big.  If you were trying to update a control repeatedly in a loop using a property node, then you will notice a performance hit.

Message 3 of 4
(2,669 Views)

Like Ravens Fan said, initializing values with property nodes just that one time is fine.  That's how I did it on my exam last month.  

 

As a more general statement, I just finished writing a blog post on my opinion of the CLD sample problems.

 

 

-------------------
Greg
Certifed LabVIEW Developer
0 Kudos
Message 4 of 4
(2,653 Views)