From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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
(2,726 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
(2,719 Views)

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

0 Kudos
Message 3 of 5
(2,715 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:

http://www.ni.com/white-paper/9330/en/

 

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

 

Regards,

DanC12

 

Download All
0 Kudos
Message 4 of 5
(2,639 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,633 Views)