LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read OPC VT_CY data

How do I read/convert the data type "VT_CY" using the "DataSocket Read.vi"?

0 Kudos
Message 1 of 5
(3,085 Views)

Hi Rasmus,

 

according to Google and Microsoft "VT_CY" denotes a currency value and should contain a string…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(3,078 Views)

When I try reading it as a string it returs an empty value

0 Kudos
Message 3 of 5
(3,074 Views)

Hi RasmusVistisen,

 

Thank you the post. Apologies for the delay in the reponse of the post.

 

I am unfamilar with the "VT_CY" data type,  but I think it does represent a currency string. How are you trying to pass the data type through the dataSocket read vi? Can you post a vi snippet? 

 

VI snippet:

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x2PkCAI&l=en-US

 

Ive attached examples of how to pass a string through the dataSocket Read.

 

Regards,

DanC12

 

Download All
0 Kudos
Message 4 of 5
(2,998 Views)

Hi Dan,

 

thanks for the reply. I have more or less solved the problem by some reverseengineering. I found a OPC client that could read the data to compare with. I read the data as a variant (think it was 64 bytes....) and looked for the hexadecimal values that gave the right value and converted those. its not pretty, and a little shaky, since i don't know if it will work in all cases.

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