LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

question on event

What's the type of the new value for many condition in a event loop. The wire has a dark mauve color ?
 
Thx
0 Kudos
Message 1 of 10
(3,062 Views)

allright it's a variant

 How I'm supposed to know in which format I have to put it ? 

0 Kudos
Message 2 of 10
(3,052 Views)
The datatype of the NewVal and OldVal terminals in a value change event matches the datatype of the control the event is on. Clusters or stings can be pink or mauve colored.

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 3 of 10
(3,050 Views)
That depends on the event and the control that generated the event. In the "Cluster and Variant" palette there is a Variant to Data function for converting the variant to a G datatype.
0 Kudos
Message 4 of 10
(3,049 Views)
What's G type
0 Kudos
Message 5 of 10
(3,044 Views)
For variants it depends on the datatype that was passed to the variant control - which can be anything... Can you post a piece of the code?

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,043 Views)
What I have to do if I want to get these informations from new value :
it's from the array of boolean or from array of enumeration
if it's from the array of enumeration what I changed ?
 
Thx
0 Kudos
Message 7 of 10
(3,041 Views)
Ok, the reason that you have a variant datatype is because you have two controls with different datatypes assigned to the same event. The attached code shows how you can tell which one actually fired the event and convert the variant back into a standard LV datatype.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
Message 8 of 10
(3,030 Views)
Another option is to simply separate the events and have them handled in two separate event cases. Then, the "NewVal" dataype will match the datatype of the control that generated the event and you don't have to worry about variants.

Note: Event structures are normally run inside a while loop. Please look at the examples that ship with LabVIEW that show you how to use the Event Structure.
Message 9 of 10
(3,023 Views)
Thanks both of you
0 Kudos
Message 10 of 10
(3,017 Views)