Harvey Posted May 1, 2008 Report Share Posted May 1, 2008 I must transfer to tcp-ip protocol the extraction of ado-tools, but i have some problem in the conversion in string If I convert the array with "varinat with flattened string" or "flatten to string" i have the error or corrupted the data If I convert every variant in string, after flatten the array and rebulit the variant array, i can't retur to original data you can advise how to transfer these data via the protocol tcp-ip? Quote Link to comment
Yair Posted May 1, 2008 Report Share Posted May 1, 2008 Can you post an example of your code? Variants you get from a database are mostly the same as standard LV variants. There are some corner cases (null values is one I'm aware of) where you would want to use the DB variant to data primitive, which comes with NI's DB toolkit, but I believe should also ship in standard LabVIEW. Quote Link to comment
Harvey Posted May 1, 2008 Author Report Share Posted May 1, 2008 This is just one of many examples Quote Link to comment
Rolf Kalbermatter Posted May 2, 2008 Report Share Posted May 2, 2008 QUOTE (Yen @ Apr 30 2008, 01:04 PM) Can you post an example of your code?Variants you get from a database are mostly the same as standard LV variants. There are some corner cases (null values is one I'm aware of) where you would want to use the DB variant to data primitive, which comes with NI's DB toolkit, but I believe should also ship in standard LabVIEW. Well it's a built in node so it is in every LabVIEW version but it is not shipping with standard LabVIEW in the sense that there is nowhere a menu palette where you could select it from. And NULL is the most noteworthy speciality of that conversion routine, since LabVIEW itself does not know a canonical NULL datatype (at least on diagram level). Rolf Kalbermatter Quote Link to comment
jpdrolet Posted May 2, 2008 Report Share Posted May 2, 2008 If I understand correctly, here is how to convert to data, assuming a single type per column: Quote Link to comment
Harvey Posted May 2, 2008 Author Report Share Posted May 2, 2008 probably not much I explained well I have to convert in string the data to transmit to the client and then reconvert because being a generic function not know the type of data Quote Link to comment
jpdrolet Posted May 2, 2008 Report Share Posted May 2, 2008 QUOTE (Harvey @ May 1 2008, 11:31 AM) probably not much I explained wellI have to convert in string the data to transmit to the client and then reconvert because being a generic function not know the type of data OK. Intead of using the TD of the void variant(after TCPIP reception), take the TD of a 2D array of variants. You could also use "Unflatten from String" with a 2D array of variants as type to make the converion in a single step. For the conversion to cluster inside the loop, take my previous example for the cluster. Quote Link to comment
Harvey Posted May 2, 2008 Author Report Share Posted May 2, 2008 the problem is that the example that I made does not work, although it should be when flatten the string or give me error or corrupts the data Quote Link to comment
jpdrolet Posted May 2, 2008 Report Share Posted May 2, 2008 QUOTE (Harvey @ May 1 2008, 12:29 PM) the problem is that the example that I made does not work, although it should bewhen flatten the string or give me error or corrupts the data No. The example that you gave can't work unlless you make the modification I suggested. You have flattened a 2D array of variants so you have to unflatten a 2D array of variants after reception. Quote Link to comment
Yair Posted May 2, 2008 Report Share Posted May 2, 2008 There is a specific problem with OLE variants not keeping their values. You can see an example here. Looks like the only solution is to convert the data before sending it. For example, you can convert it to a 2D array of strings. QUOTE (rolfk @ May 1 2008, 09:04 AM) Well it's a built in node so it is in every LabVIEW version but it is not shipping with standard LabVIEW in the sense that there is nowhere a menu palette where you could select it from. At least in 8.5.1 it's in Add-ons>>DB Tools even if you don't have the toolkit installed. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.