LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -2147352571 occurred at Variant To Data

I am attempting to "Fetch Element Data" (FED) from an SQL table using the Database Connectivity Toolkit.  The data that's coming out is an array of numeric values (one column, length varies significantly).  I have wired an array constant (double precision numeric) to the type terminal on the FED block.  The variant coming out is wired to a "Variant to Data" vi with the same array constant connected to it's type terminal and an array indicator (also double precision) on it's output.  This is returning the error message listed in the subject block, which is undefined at this point.  I have had no luck with variant data conversion in the past, and have always found a way around using it.  It does not appear, at least to my rookie eye, that there is a way around using it now.  Can anyone advise me in the appropriate way to use variant data conversions or a better way to get the data I want?
 
Thank you,
Jason
0 Kudos
Message 1 of 18
(4,535 Views)
Jason,

I cannot be sure, but I believe the error may be caused because LabVIEW cannot translate the data being received from the database into double precision numerics. What data type is contained in the database from which you are reading? You might try converting the variant to an array of text data incase the type defined in the database is actually text.

Aside from this suggestion, I can also suggest to take the database read out of the equation to see if the error still persists. That may provide more information as to why you are receiving the error in your application. I hope this is useful for you. Please let me know if I can be of any further assistance. Thanks,

Mike
National Instruments
Applications Engineer
0 Kudos
Message 2 of 18
(4,520 Views)
Mike,
Thanks for the recommendations, but I still have the same problem occurring.  I have tried changing the array to an array of strings, no luck.
 
Still befuddled in Bellefontaine...
0 Kudos
Message 3 of 18
(4,508 Views)
Jason,

This is interesting... The error code you are seeing basically means type mismatch, so we are reading the data incorrectly. Do you know the exact data type of the data being written to the database?  Was the data written from LabVIEW? Without this information, it will probably be trial and error to find the right data type.  You may want to wire a Variant as the datatype in and create an indicator to the output to see what the data looks like.
--Paul Mandeltort
Automotive and Industrial Communications Product Marketing
0 Kudos
Message 4 of 18
(4,494 Views)
Paul,
Yes, the data was written to the SQL table using the database connectivity toolkit in LabVIEW.  Everything was formatted into a string when fed to the execution vi on the block diagram, although some of it resides in the table as a number.  I have wired a Variant indicator to see what is coming out, one column doesn't return a value and the other 3 appear to be valid strings.
 
Jason
0 Kudos
Message 5 of 18
(4,482 Views)
There is a function in the Database palette called Database Variant To Data.  It expands the functionality of the Variant To Data specifically for database data.  It should do what you need.
0 Kudos
Message 6 of 18
(4,469 Views)

I can see the VI you speak of in the pallette, but it will not let me put on a block diagram.  I tried opening a blank vi and placing on the block, but that didn't work.  I looked it up in help so that I could place it on the block diagram from there, but it didn't give me the option.  I have all the latest software installed, including the toolkit.

Am I just not holding my head in the right position or something?

0 Kudos
Message 7 of 18
(4,464 Views)
Jason,

That is quite interesting that you are not able to place that VI on the block diagram. What actually happens when you try to place the VI? Does it show a circle with a slash through it as if you were trying to drag it onto the front panel? Does it give an error message? When you try to drag from the functions pallet, does the cursor change from the selection tool?

If you are not able to place the VI, I immediately start to wonder about the integrity of the Database Connectivity Toolkit installation. It sounds as if the reset of the toolkit is working correctly, but have you made any modifications at all to the VI library? Have you tried a reinstallation of this toolkit? These would be useful to know so that we can help to get this working for you. Thanks,

Mike
0 Kudos
Message 8 of 18
(4,458 Views)

Mike,

No circles with slashes, no error messages and the cursor does not change, it simply gives you the "donk" sound that windows likes to give if you try to do something it doesn't want you to do.  I have not modified the VI library and I have not yet tried to re-install the toolkit.

Jason

0 Kudos
Message 9 of 18
(4,452 Views)
FYI...I found in the knowledgebase where it was suggested that replacing the dir.mnu file would fix the problem I am seeing where you can't place the function on the block diagram.  I tried it and it didn't work.
0 Kudos
Message 10 of 18
(4,446 Views)