Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to serialize the objects in the ni488.2 .NET library?

I am modifying one of my existing C++/CLI programs so that my instrument objects are derived from a class that uses the national instruments ni488.2 Board^, Device^, Address^, etc.  It would be nice to be able to save the entire instrument object as a whole using serialization but the program bombs throwing an exception that states the Device object is not marked as serializable.  Since the [Serializable] property need to be in the source code (which it must not be) I don't think there is a solution, but I will ask anyway.  Is there a way to serialize the objects in the ni488.2 .NET library?

 

Thanks,

0 Kudos
Message 1 of 2
(3,124 Views)

Hi Schleprock,

 

You are correct that the Device object in the 488.2 library is not serializable, and as a result cannot be serialized (as you found). However, please clarify for us why you need to serialize the object -- there may be a better way to go about what you would like to do.

 

Have a great day!

 

John M

National Instruments
Applications Engineer
0 Kudos
Message 2 of 2
(3,089 Views)