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.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

is it possible to get the serial number from external C++ code?

Solved!
Go to solution

Hi,

 

I have a C++ library called by a CLF in the LabVIEW RT from my cRIO. I am trying to use the cRIO serial number in my C++ code for licensing purposes. Is it possible to get the cRIO serial number using the C++ API?

 

I found information on how to do this from LabVIEW itself (http://digital.ni.com/public.nsf/allkb/74924FEE303440998625727D005197FA), but it would be really helpful to be able to do it from the C++ code.

 

Thanks in advance!

0 Kudos
Message 1 of 5
(4,854 Views)

You know how to call the VISA library from C++ code ?

Then do it in the same way as described in the first method for Labview.

Open a VISA Session for your RIO device and use viGetAttribute() to read the Instrument description property ( VI_ATTR_INTF_INST_NAME)

0 Kudos
Message 2 of 5
(4,845 Views)

Hi mkossmann,

 

Thanks for your suggestion. I have never used the VISA library from C++ or from LabVIEW, actually. I'm a newbie using NI hardware so sorry if the questions are too basic. 

Is there documentation on the VISA library? I have found the DLLs on my windows machine, but I don't find any other documentation.

 

Thanks,

Sara

0 Kudos
Message 3 of 5
(4,840 Views)
Solution
Accepted by topic author SaraGr

The more modern way would be to use the System Configuration API to query this information. This is the same API that MAX and other software internally uses to get this information for display. This API is available in C (nisyscfg.h) and I assume should work on RT controllers as well.

0 Kudos
Message 4 of 5
(4,822 Views)

Hi BlueCheese,

 

Thanks for your answer. That's exactly what I was looking for!! I will give it a try and let you know if it actually supported in the RT controllers.

0 Kudos
Message 5 of 5
(4,786 Views)