LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Variant To Data Executable Problem

Hello,
 
I can run the attached VI in the LabVIEW environment, but when I build an exe I get error 91. 
 
Note to have this VI work you need to have Digital output channels setup in DAQmx
 
I have a Variant array of DAQmx Physical channels that I am trying to convert to data.
 
I have found someone with a simialar problem.  Does this apply to me too?  Is this a still a bug?  Is there a workaround?
 
 
Thanks
 
Dan

Dan Shangraw, P.E.


   

Download All
0 Kudos
Message 1 of 5
(2,965 Views)
It is difficult to tell.
 
You posted the same VI twice, and there really isn't much going on in it.  Just two calls to "Delphi CCT Digital Out.vi".  Where did this subVI come from?  If you post that, (and any subVI's it might have, it may be easier to see what the problem may be.
 
One thing I did see is there is a spelling error in the type def'ed enum going into the sub VI  "Ingnition 1", but I doubt that would cause your error.
0 Kudos
Message 2 of 5
(2,937 Views)

I found a solution to my problem.

Instead of converting the variant array to a DAQmx physical channel,  I converted it to a string.  I can then type cast the string to a DAQmx physical channel data type.

Thanks

Dan

Dan Shangraw, P.E.


   

0 Kudos
Message 3 of 5
(2,935 Views)

This is a documented bug all the way up to 2011.  The CAR isn't listed on 2012 so it appears they've fixed it.

 

https://www.ni.com/en/support/documentation/bugs/11/archived--labview-2011-and-2011-sp1-known-issues...

 

Two listed workarounds:

 

1) Update the variant type by generating a new one. (In an empty VI wire the typedef into the "data to variant" prim and run the VI. Then create a constant from the indicator and use this constant as the new type for the variant.)

2) Use a Flatten Variant to String and then an Unflatten from String (not the variant version). If you wire in the control you're trying to extract from the variant, it will work like a charm.

 

I've used number 2 and it works for me.  Sorry to dig up the old post, but I figured someone else could use the information if they find it via search.

The Colex Group
Lead Software Engineer
Certified LabVIEW Developer
0 Kudos
Message 4 of 5
(2,628 Views)

 

I did this very thing and in one vi it worked and another  I keep getting errors because it won't wire correctly.

works.png works

doesntWork.png contains unwired or bad terminals

0 Kudos
Message 5 of 5
(2,574 Views)