10-17-2012 06:44 AM - edited 10-17-2012 06:50 AM
Christian,
unsupported hint: Search on the RT target for files which might contain the MAC.
Norbert
EDIT: Maybe, this KB (bottom line "Using Command Line") helps you as well.
10-18-2012 01:14 AM
I think what you REALLY want to do is use the NI System Config API - it has a standardized library that can be accessed from within a C/C++ DLL that can query system information. All of the VIs you traditionally use call into the "guts" of the Real-Time OS, which may or may not have published APIs and may or may not exist on all systems/controllers. The NI System Config API is guaranteed to provide access to APIs that always "work."
https://decibel.ni.com/content/docs/DOC-13216
-Danny
10-18-2012 01:54 AM
@Norbert_B:
As far as I understand, using the command line works if I ping the RT target from a host machine that runs Windows.
But I need to retrieve the MAC address on the RT target itself, without any other systems involved.
@Texas_Diaz
This NI System Config API looks interesting. I will search the examples and documentation and try to find the functionality I need.
Christian
10-31-2012 02:47 AM
Hello,
I just want to let you know that there is a file on RT targets that seem to contain the mac address. This is what Norbert_B suggested.
At least on my PXI running LabVIEW RT, there is the file netconf.ini in /ni-rt/system/ethernet which provides information about the network interface.
Unfortunately, I have only one RT system, but want to make sure that this file is available in the same folder and format on other systems as well.
To be on the save side: Is it possible that whoever has as RT system, checks if there is this file and if yes, send it to me so that I can check the internal format and adapt my parser if needed?
Thank you in advance,
Christian
10-31-2012 07:04 AM
Christian,
The reason I didn't recommend looking in the netconf.ini file, and instead to use the System Config API, is because not all systems will have a netconf.ini file. Also, systems with multiple NICs will have multiple entries in the netconf.ini file, and you're not guaranteed to always have a "primary NIC" listed in that file. A year ago I would have told you to just use the netconf.ini file, but with recent <cough> "changes" </cough> this is not something I would recommend any more.
-Danny
10-31-2012 07:35 AM
Danny,
I have checked the System Configuration API, but as far as I understood, it can be used to get the MAC address of a target system, but the application that gets the MAC address needs to run on a host (Windows) system.
Do you know if the System Configuration API is intended to run on the target directly?
If you have any experience with this API, could you please let me know how to use it on the target itself (which functions to call, which libraries to link etc.)?
Thank you,
Christian
10-31-2012 12:52 PM
Yes, the System Config API can be run on the target itself - it's fairly host/target agnostic, customers have used this API on the targets to reconfigure network settings "automagically" without access to a host machine.
I myself have not used the System Config API, unfortunately. But I do know this was one of the expected/standard use cases for it. Maybe an NI Applications Engineer can guide you in using this API.
-Danny
11-02-2012 03:42 AM
Ok, I did some more investigation on the System Config API and you're right, it can run on the target itself.
But unfortunately, I found the VIs only, but no interface that can be used from C++.
The documentation also gives no information if there is such an API.
Christian
11-05-2012 07:02 AM - edited 11-05-2012 07:03 AM
Christian,
i have not done that before, so i am not sure if this works out correctly..... BUT: You are running a LV RT system. Correct?
So, it is possible to wrap the System Config API (LV code) as a DLL which you call within your "primary DLL". This is of course some hack (require to deploy two DLLs in addition), but might come close to your needs.
Norbert
EDIT: This construct must not be called within your time critical section of code of course. It could break determinism.
11-05-2012 07:10 AM
Norbert,
deploying additional Dlls is ok. And yes, I am running LV RT.
But how can I wrap the LV code for calls of System Config API into a DLL, i.e. creating a DLL from a VI?
I have no idea how this can be done?
Can you please let me know how I can do this.
Thanks,
Christian