LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding IP address of a device connected to sRIO's ethernet port

Solved!
Go to solution

Hi,

 

I am trying to find IP address of a Kollmorgen drive system connected to sbRIO via ethernet port. Attached is a snippet of my attempt but I think my approach is not right. Code in the snippet is running on RT target.

 

Device IP address is: 169.254.231.4. It is connected to eth 1.

 

Screenshot of results:

Bonkerz_0-1631203534626.png

 

Currently I am having user to enter the IP manually to establish a connection. Would like to automate this step.

 

EDIT: Questions are:

1) Is it possible?

2) If yes, what is the right way to find an IP.

 

I appreciate any guidance.

0 Kudos
Message 1 of 7
(1,653 Views)
Solution
Accepted by topic author N_743

Device discovery of ethernet devices is not something build into the TCP/IP protocol suite itself but is always a proprietary approach. This means each device implements its own methods to announce itself to potential clients.

 

Many of these are build around the principle that an interested client sends out broadcast UDP messages on a specified port and with a certain binary format and then waits for any responses. Since broadcast messages are not usually relayed by routers and switches, this also means that it only works for devices connected to the same subnet as the querying client.

 

The NI System Control Library knows how to enumerate NI hardware since it knows the NI proprietary device enumeration protocols. But since your Kollmorgen device is not manufactured by NI, this library knows nothing about how to enumerate any such device.

 

And one of the unpleasant things about this whole story is that most manufacturers consider their device enumeration protocol a trade secret or are simply too lazy to bother documenting it. Not sure about under which category Kollmorgen falls or if they have an actual documentation about how to detect their devices.

 

Are your Kollmorgen devices standard TCP/IP or rather Ethernet/IP or EtherCAT? Because if it is Ethernet/IP or EtherCAT you may anyhow want to use the NI Industrial Ethernet/IP or EtherCAT driver instead. Not quite sure if they support auto discovery of devices though.

Rolf Kalbermatter
My Blog
Message 2 of 7
(1,610 Views)

Hi rolfk,

 

Thank you for your response. You are (obviously) correct. I will contact Kollmorgen to see if they can help with this requirement.

 


@rolfk wrote:

Are your Kollmorgen devices standard TCP/IP or rather Ethernet/IP or EtherCAT? Because if it is Ethernet/IP or EtherCAT you may anyhow want to use the NI Industrial Ethernet/IP or EtherCAT driver instead. Not quite sure if they support auto discovery of devices though.


In this particular application, it is Ethernet/IP. In general they support Modbus, Profinet, Ethernet, EtherCAT and CAN over Ethernet.

 

I installed Ethernet drivers and retired using Linux command line and system configuration VIs. But as you suspected, I do not think they support auto discovery of devices.

 

But I do have a question about NI Industrial Ethernet/IP drivers, why are those required if I am able to communicate to the drive without them?

 

Only reason I initially did not install them because, I think, on the pc side they are available as an add-on at a price EDIT: and we do not have it purchased and it was never required until now. But on the RT side I could install it. But since it has no such limitation on the RT side, I installed it for this particular instance.

 

Thanking you

-N

0 Kudos
Message 3 of 7
(1,580 Views)

I didn't study their products but it seemed they use generally EtherCAT for their inter module communication and the PDMM unit then supports on its X32 connector a multitude of Ethernet based protocols, even in parallel if you want.

 

As to why you would want to use the Industrial Automation driver instead of invoking a command line tool: Mostly performance and convenience. Invoking an external command line tool for every single bus transaction you want to do is fairly slow even under Linux. Process creation under Unix is typically quite a bit faster than under Windows, but still not immediate. It works for many things under Unix and for a lot fewer things on Windows because of this, but it is relatively slow in any case, and parameter transfer to and from the child process are usually fairly cumbersome.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 7
(1,565 Views)

Sorry, I am afraid I created some confusion or I did not understand your most recent response. I would appreciate if you could clarify this one last time.

 

Task 1_Detect IP: I used System Exce.VI with "ifconfig" command to detect IP addresses (used term "command line" for mentioning this) and I also tried detecting IP using VIs on system configuration pallet.

(Result from both confirmed what you mentioned in the first response) (I think you helped me understand this part)

 

Task 2_Communicate with Drive: I have been using TCP/IP VIs to communicate with drive's terminal without installing NI Industrial Ethernet/IP drivers on the sbRIO. This is what made me wonder why do I need drivers if communication is already established and working.

 


@rolfk wrote:

Mostly performance


Okay, yes, it may make a difference. I never used a benchmark since the purpose was being served.

 


@rolfk wrote:

Invoking an external command line tool for every single bus transaction you want to do is fairly slow even under Linux.


I got confused here.

 

Are you talking about method of communication with the drive (currently using TCP/IP VIs to access drive's terminal and accessing parameters as needed)?

or

Are you meaning that if I do not have drivers Installed, I would be unknowingly invoking an external command line tool in some background process every time a command is being sent or received?

0 Kudos
Message 5 of 7
(1,556 Views)

Well, yes I got confused. I thought you were invoking the command line to communicate with the drive.

 

As to ifconfig, that only shows you the settings of the local network adapters, pretty much the same as ipconfig on Windows does. It can not detect other network devices at all.

 

You seem to communicate through TCP/IP nodes directly. I have done that with some other devices regularly but from what I see from this Kollmorgen device it would not be my first choice. Since it also supports Modbus TCP, my first try would have been to use the NI Modbus library. If that failed for whatever reason I would probably use one of the Industrial Communication libraries for either Ethernet/IP or EtherCAT.

 

 

Rolf Kalbermatter
My Blog
Message 6 of 7
(1,547 Views)

Hi rolfk,

 

Thanks again for your response. Unfortunately, my knowledge about Modbus is absolutely 0 and based on my initial reads, it surely did sound faster and more deterministic way to communicate but it also scared me off, having to deal with registers. I will eventually learn it and implement it but I was using TCP/IP in the mean time to get the job done.

 

Thanks again for sharing the knowledge.

0 Kudos
Message 7 of 7
(1,541 Views)