LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Structure for multiple controls changes?

I have some controls like shown in the picture. Lets say I want to check for changes done by the user in the String controls, since every string is inside a separated cluster, I would have to create a single case (inside a Event Structure) for each string or add them one by one to the same case, again one by one. How can I check for events on all the controls of the same type without having to add them manually one by one? Or, if I check for events on all the controls, how can I then identify wich control triggered the event structure?

0 Kudos
Message 1 of 10
(3,143 Views)

I don't know what you mean by time structure.

 

You can register the entire cluster for value change.  Then compare the old value of the cluster with the new value to determine which one had changed.

0 Kudos
Message 2 of 10
(3,138 Views)

I came up with comparing references of the controls changed till I find the one that tiggered the event structure. For this I get control references at the program start up. But since ther are quite some controls, I think it's rlly ineficient to check for the control like this. Any sugestions?

0 Kudos
Message 3 of 10
(3,131 Views)

Yes but, then I rhater use shift registers in the while loop to check for changes (save last value, and compare with new one), but I wanted to use Event structure becous I thougth it was more efficient.

0 Kudos
Message 4 of 10
(3,119 Views)

Attach your actual VI so I can see your data types.

0 Kudos
Message 5 of 10
(3,109 Views)
In every event structure you can register a value change for an entire cluster. In other words, that one event will fire when ANY of the controls in the cluster change. To determine which control changed there is a value in the event data nodes called "OldVal". It returns the value of the cluster before the change happened.All you have to do is compare OldVal to NewVal, and there is the item that actually changed.

This is often more efficient than trying to create separate events for each control.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 10
(3,106 Views)

Ty very much, I will create a "all elements" value change case, and then compare. But since in my cluster ther is a lot of diferent types of elements,the new value type gives me a analog cluster with the new value written into it, and also the control ref. Since I have all the control references stored, I would prefere to compare them instead of comprare individual elements of the cluster (to avoid a lot of unbundles and stuf), but i cannot compare this control refs (see image atached). I assume that control ref given by the Event structure is polimorfical, or weak control ref, and mine is strict. How can I convert classes?

0 Kudos
Message 7 of 10
(3,078 Views)
Under the application control menu there are nodes for casting references.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 8 of 10
(3,060 Views)

That's a picture.  That's not a VI.

0 Kudos
Message 9 of 10
(3,049 Views)
Also, you are comparing references not values.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 10 of 10
(3,039 Views)