LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to pass a cluster via a variant

One simple cluster includes 4 digital data of T/T/F/T..
How can I pass the cluster using a variant?
In my trial, I met Error 91 compatible error..
(I don't know why I can't use some variant functions directly for my purpose)


메시지가 06-15-2008 10:22 AM에 labmaster에 의해 편집되었음
0 Kudos
Message 1 of 12
(3,850 Views)
Hi labmaster,
what do your picture show? Can you explain please?
Mike
0 Kudos
Message 2 of 12
(3,841 Views)
I don't see anything in that picture with a variant or a cluster. In fact it looks identical to the pic you posted here.

0 Kudos
Message 3 of 12
(3,840 Views)
Sorry, I found the image was wrong just after my first posting.
 
I just used the variant simply in producer/consumer routine.
Recently, I use some more advanced contents of LV, but there are so many problem in using the features.
(Would you please explain me why the cluster is so special in variant, if you know?)


메시지가 06-15-2008 10:38 AM에 labmaster에 의해 편집되었음
0 Kudos
Message 4 of 12
(3,832 Views)
Hi labmaster,
both data has to be from the same type. It looks like you use different typs. You send something like a enum and want receive a boolean element. You will get an error with the configuration. It´s variant data type, so that you can connect every type you want without changing the structure, but you have to notice that the data you send and the data you want receive at the same time have the same data type.

Mike
0 Kudos
Message 5 of 12
(3,819 Views)
Also, I think you said you were trying to send 4 boolean values? But your cluster only has one. Clusters aren't like arrays where they will grow to fit each new element. A cluster of 1 boolean will always only have 1 boolean. You could use an array of booleans > To Variant, then when you dequeue use a boolean array on the Variant to Data function Type input.
0 Kudos
Message 6 of 12
(3,812 Views)
Thanks,
 
Only what I know about using variant is I have to use the same type as your comments.
(Actually, three boolean constants in cluster were hidden to save the area in consumer routine.)
 
The cluster variable (4 booleans) was converted to a variant in producer.
The variant was recovered to the cluster format in consumer.
 
Do you mean there is no special thing in Cluter-Variant like simeple integer - Variant?
If so, I will check my code again. 
0 Kudos
Message 7 of 12
(3,759 Views)
Dear,
 
I don't know why the variant gave me some error.
(In same principle with producer/consumer routines, "zzz.png" shows no error in other independent block diagram.)
 
I checked the cluster and variant in debugging mode (dddd.png).
All values taken after "continue" button in error message, were transferred without a problem.
 
But LV (8.2.0 version) showed the error message of "compatible between data".
What should I check to shoot my troble for the next?
 
 


메시지가 06-15-2008 07:43 PM에 labmaster에 의해 편집되었음
Download All
0 Kudos
Message 8 of 12
(3,755 Views)
That is odd that the probes show the values after the error. As far as I know, there is nothing special you have to do to convert a cluster to a variant. I went through the LabVIEW help and it didn't mention clusters in variants, but I was using 8.5.

The only thing I can think of is the desciption of items in the clusters might be throwing off the Variant to Data function. I would try right clicking the actual cluster (Digital SW I think it was called), selecting "Create Constant" then move that down to the consumer and wiring it to the "Data Type" input of the Variant to Data function. Other than that, I'm stumped.
0 Kudos
Message 9 of 12
(3,716 Views)

StevenD,

Acutually, the cluster constant was created as you mentioned.

If I press the STOP button in error message, the probe #7 (variant output) was empty and program was stopped.

In this case, I have to mention that there was a blinking in Variant to Data.vi.

 

0 Kudos
Message 10 of 12
(3,700 Views)