Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Does the NetworkVariable .NET library support custom controls?

I'm trying to develop software with Measurement Studio 8.6 that communicates to a machine running LabVIEW RT.

 

The software deployed in the RT machine uses a custom control to group data (It is a cluster of string arrays and double arrays). 

 

I've been able to connect and disconnect, get/set values of simpler types such as Booleans, but the .NET library (specifically the NetworkVariableReader<Object> type) throws an exception when I use the ReadData() function on my custom control data.

 

NetworkVariable cannot convert from n to an equivalent .NET type 

 

If there is no way to send Network variable data that is of a custom control, then I see only two options...

 

1) Break the data down to simpler types, which would change the implementation of the RT software significantly

 

2) Cast the custom control data to an array of bytes and send it through the network, which I can then cast on the .NET recieving end into a structure. 

 

However, it is not that easy to work with an array of bytes, I suspect other issues will pop-up, and I was wondering if there is a way I can recieve the custom control data directly. Else I'll probably go with approach #1 😞

 

I also store the custom control data as an xml file on the RT harddisk.  Maybe this file can somehow be used to get the data? Any suggestions?

 

Thank you

0 Kudos
Message 1 of 3
(3,642 Views)

Hi Tavak,

 

Unfortunately, the .NET Network Variable Class only supports primitive data types, and so you will have to implement one of the two methods you described.

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 2 of 3
(3,618 Views)

I'd like to clarify Al B's answer. Al B's answer is 100% correct in the context of using the .NET Network Variable class library to exchange data with LabVIEW or CVI.

However, when you use the .NET Network Variable class library for both writing and reading the data, it is possible to transfer complex data types if the complex data types are serializable. This is described in the "Supported Data Types" section of the "Key Measurement Studio Network Variable .NET Library Features" topic in the Measurement Studio help.

0 Kudos
Message 3 of 3
(3,609 Views)