Another newbie question - Does this work for me ?

284 views
Skip to first unread message

Sergio Andrade

unread,
May 25, 2020, 10:23:55 AM5/25/20
to EIP Stack Group OpENer users
Hi and thank you for allowing me to participate.

I have been studying EtherNet/IP for some days and I still haven't realized if this will work or not for my application.

My application is intended to provide a way of fast communication for non standard I/O devices . An I/O Server (Adaptor).
Ex: I have two (or more) i/o devices, each one has a serial (maybe usb) port and proprietary protocol. I will write an app that load these devices as a plugin and  make them avilable in a standard way of access in a low cost.

I am also going to write an MES Application that will consume that data comming from i/o sever. An I/O Client (scanner).

My first question is:
From the EtherNet/IP concept, the server(adapter) and client(scanner) are correct ?

The second question is about this sentence: 
"It supports multiple I/O and explicit connections ..."
Does the library support only EXPLICIT messages?
I read that i/o communications are done using IMPLICIT messages throught UDP. 
Am I right or just confusing things ?

Third:
From the documentation, I need only to give the right permission to use raw sockets, no need extra drivers. Is that all ?

And finally:
Does it work with Raspberry Pi 4 and Raspbian ? 


I wold like to thank in advance for those who can help me.

Martin Melik-Merkumians

unread,
May 25, 2020, 11:02:36 AM5/25/20
to EIP Stack Group OpENer users
Hi,
From the EtherNet/IP concept, the server(adapter) and client(scanner) are correct ?
Yes, this is correct

The second question is about this sentence: 
"It supports multiple I/O and explicit connections ..."
You are right I/O connections are implicit connections. As the sentence says both I/O (implicit) and explicit connections are supported. 

Third:
From the documentation, I need only to give the right permission to use raw sockets, no need extra drivers. Is that all ?
Yes, this is one of the mahor benefits of ENIP. It is based on unchanged, standard ethernet technology up to the TCP/IP layer. Raw sockets are only necessary to fix the source port for outgoing UDP packets.

And finally:
Does it work with Raspberry Pi 4 and Raspbian ?
Is works on Raspbian on my Pi 3B+, so it should also work on a RPi 4  with Raspbian.

Best regards,
Martin

Sergio Andrade

unread,
May 26, 2020, 3:03:25 PM5/26/20
to EIP Stack Group OpENer users
Hi Martin;

First thank you for the quick reply and I am really sorry for the long text that follows.

After your reply I cloned the repo and was able to compile (with some warnings) and run OpENer in my NOTEBOOK (running Debian in a VM) and Raspberry Pi 4. 
For Raspberry I enabled OPENER_RT and it also worked. 

I launched 2 EnIP Explorer (one of them in Win10 and other in a VM running Win7) and added the instances of assembly attributes (100, 150 and 151) on each EnIP Explorer.
So far, everything seemed OK. 

Then in the Win10->EnIPExplorer->Function->Implicit (I/O) Messaging I dropped the respective assembly->instance->attribute in panels Config, Output , Input and left Cicle Time in 200. Then pressed the button [(Large) Forward Open]. 
Once again, everything OK.

But when I tried to repeat the last step for Win7, it returned an error and didn't work. I looked in the file opener_user_conf.h, but could not realize what to change.
Implicit Messaging from two scanners to the same input/output at the same time. Is it possible to do that ?
Any help here would be appreciated.

I am still confused with the flow I have to follow to correctly instanciate things before starting my own app.
Maybe there are some DOCs I can read.

As I said before, I am going to write the server(adapter) and the client(scanner), but I haven't found any example of a client(scanner).
Can you point me the directions, if the library is also capable of (intended for) that, of course.

And, for the last, where do I change the default ports for both tcp and UDP.
I could see using netstat that port 44818 TCP,  2222 UDP and another raw connection, but not in the code.

Once again, thank you so much for the help.

Martin Melik-Merkumians

unread,
May 27, 2020, 4:14:54 AM5/27/20
to EIP Stack Group OpENer users
Hi,

great to hear that the setup process went rather smooth.

Implicit Messaging from two scanners to the same input/output at the same time. Is it possible to do that ?
No, this is forbidden by the protocol, as it would not be clear who is allowed to write to the outputs.
If multiple scanners need input data, they have to establish an input only or listen only connection. 

Documents can be found at the ODVA (https://www.odva.org/). they also offer webinars for starters (https://www.odva.org/communities/developer-hub/)
Also there are some free documents available https://www.odva.org/technology-standards/document-library/
I recommend reading the Quick Start for Vendors.

As I said before, I am going to write the server(adapter) and the client(scanner), but I haven't found any example of a client(scanner).
Can you point me the directions, if the library is also capable of (intended for) that, of course.
Writing a new adapter sounds a like reinventing the wheel. You can use OpENer freely in commercial products, as long as you adhere to the terms of the license (so getting a Vendor ID, which you have anyhow and to put the license to source and binaries)
You can surely use OpENer as a base library for a Scanner, and there are some implementations out there like the ENIP explorer. OpENer was not intended to be used in this way, but the basic operations should be the same.
Unfortunately there is not much material on scanner requirements, so for either case I would also recommend registering for an ODVA PlugFest as soon as you have a workring prototype for either Adapter or Scanner device.

For the TCP listener port there is the constant kOpenerEthernetPort defining the port. But changing that does not make any sense, as you would violate the ENIP specification. This is the registered listener port.
For implicit connections, the source port is coded into the SendUdpData function. Again, you can change this, but it is not recommended, as this is the registered port for implicit messages, and the specification highly recommends to use this source port. The destination port is either chosen by the originator or 2222 if the originator does not specify a different port.
For receiving UDP ports this is again either chosen by the originator or 2222 as default.
Changing anything of these settings does not make any sense from the ENIP perspective

Best regards,
Martin

Sergio Andrade

unread,
May 27, 2020, 2:12:04 PM5/27/20
to EIP Stack Group OpENer users
Hi;

I will take a very good look at the links you sent me, mainly in Quick Start for Vendors.
About the TCP and UDP ports, I totally agree with you and the questions were just to get a better comprehension.
You said that I might be reinventing the wheel, but this is being made because the company I work for has 1000 I/O modules (4 inputs and 4 outputs) and they want to offer this feature for those who might need that.

After your help I am quite near to stop bothering you and begin my app, but I still have some questions.

1 - "... they have to establish an input only or listen only connection."
I could see in sampleapplication.c that instance 152 is input only and instance 153 is listen only.
I assumed that I must register the scanner to keep receiving input data.
I tried to test it with EnIPExplorer, but no success.

2 - "... and there are some implementations out there like the ENIP explorer."
I downloaded EnIPExplorer source code and it is all written in C# and of course will help to understand the flow.
But I was talking about a sample code written in C of a client/scanner using OpENer Stack.
I know that I may be asking too much, but it would be just a minimum example showing how to start things (just like sampleapplication.c and main.c). 
Properly Init and finish OpENer Stack.
Stablish a TCP connection, Read and Write some Explict Message.
Receiving and Sending Implicit Message.

After a while I could also share this example with a GUI interface for Linux just for learning purposes. I know there is EnIPExplorer, but it is not written for OpENer.

Maybe these questions should be in the EIP Stack Group OpENer Developers.

And again .... thank you very much.


Em segunda-feira, 25 de maio de 2020 11:23:55 UTC-3, Sergio Andrade escreveu:

Martin Melik-Merkumians

unread,
May 27, 2020, 4:58:24 PM5/27/20
to EIP Stack Group OpENer users
Hi.
You said that I might be reinventing the wheel, but this is being made because the company I work for has 1000 I/O modules (4 inputs and 4 outputs) and they want to offer this feature for those who might need that
Still, I do not get why you have to implement that yourself. You could use OpENer as a library and just add the necessary CIP Objects yourself. 

I could see in sampleapplication.c that instance 152 is input only and instance 153 is listen only.
I assumed that I must register the scanner to keep receiving input data.
You assume right, although I cannot say why this didn't work with ENIPExplorer. Please note that listen-only connections need another type of connections to work.

But I was talking about a sample code written in C of a client/scanner using OpENer Stack.
It is not as simple, as all the inner workings of OpENer are designed for an Adapter. You can still take some of this stuff to implement a working scanner, but I cannot give a simple example.
And yes, perhaps this question is better suited for the developers group.

Best regards,
Martin 

Sergio Andrade

unread,
May 28, 2020, 8:15:47 AM5/28/20
to EIP Stack Group OpENer users
"Still, I do not get why you have to implement that yourself. You could use OpENer as a library and just add the necessary CIP Objects yourself."

Yes, this is what I am going to do. I'll just embed in my app and create the objects according to the loaded I/O attached.
Reply all
Reply to author
Forward
0 new messages