Hilscher Community Forum
NetHat + Ethernet/IP + APIs or SDKs - Printable Version

+- Hilscher Community Forum (https://forum.hilscher.com)
+-- Forum: netHAT - Industrial Ethernet Raspberry Pi upgrade (https://forum.hilscher.com/forum-17.html)
+--- Forum: Software (https://forum.hilscher.com/forum-19.html)
+--- Thread: NetHat + Ethernet/IP + APIs or SDKs (/thread-768.html)



NetHat + Ethernet/IP + APIs or SDKs - michela.limaco - October-8th-2021

Hello,

I am trying to use NetHat with Raspberry Pi2.

I installed Driver and Firmware for Ethernet.

Would you like to know if there are libraries or SDKs for java or C++?


And if there is any knowledge base with examples such as sending data through a GET/POST request.

Thank you in advance.


RE: NetHat + Ethernet/IP + APIs or SDKs - Armin@netPI - October-9th-2021

Hi there, I am sorry to say that neither there are examples for Java nor for C++ available for netHAT. The only sample source code we deliver is a C coded example along with the driver library.

Thank you
Armin


RE: NetHat + Ethernet/IP + APIs or SDKs - michela.limaco - October-10th-2021

(October-9th-2021, 05:47 AM)Armin@netPI Wrote: Hi there, I am sorry to say that neither there are examples for Java nor for C++ available for netHAT. The only sample source code we deliver is a C coded example along with the driver library.

Thank you
Armin

OK thanks.
By the way, is there an example of request GET/POST in C?
Considering that I'm going to read data from a sensor and send the value read to an Endpoint in the cloud.

Could you give me an example that performs a GET or POST?
Thank you


RE: NetHat + Ethernet/IP + APIs or SDKs - Armin@netPI - October-11th-2021

Hello Michela,

when you say "I am going to read data from a senser and send the value to cloud" what exactly do you mean?

netHAT is a module that embeds a Real-Time Ethernet chip that talks to PLCs like those from Siemens or from Rockwell over industrial ethernet protocols like PROFINET, EtherNet/IP or EtherCAT. So there is not any place to connect a sensor to netHAT directly. Or do you indeed mean the sensors are connected to the PLC and the PLC transfers the data to netHAT over the network where you finally read it back in your netHAT application stored on your Raspberry Pi and from there you want to forward it to a cloud system that is also connected to your Raspberry Pi? Is my understanding correct? If yes what is the industrial network protocol do you have in use by the way?

But back to your question. Since netHAT is just a module that turns industrial network data exchanged with a PLC into readable and writeable buffers on Raspberry Pi side this is where Hilscher knowledge ends and also where the provisioning of examples and drivers for netHAT ends. This means we provide just examples how to read or write the data buffers ... what an application is finally doing with this data and where it is going to after a read or where it was coming from before a write is not our business. It's 100% in the hands of the programmer. So again I am sorry to say that I can't deliver you and further sample code.

I entered the search term "HTTP POST PUT GET C coded " into google search ... and I got thousands of hits of examples for it. I think this a good approach for you to continue programming your code to the end with all the source codes available on other web sites.

Thx
Armn


RE: NetHat + Ethernet/IP + APIs or SDKs - michela.limaco - October-11th-2021

(October-11th-2021, 05:26 AM)Armin@netPI Wrote: Hello Michela,

when you say "I am going to read data from a senser and send the value to cloud" what exactly do you mean?

netHAT is a module that embeds a Real-Time Ethernet chip that talks to PLCs like those from Siemens or from Rockwell over industrial ethernet protocols like PROFINET, EtherNet/IP or EtherCAT. So there is not any place to connect a sensor to netHAT directly. Or do you indeed mean the sensors are connected to the PLC and the PLC transfers the data to netHAT over the network where you finally read it back in your netHAT application stored on your Raspberry Pi and from there you want to forward it to a cloud system that is also connected to your Raspberry Pi? Is my understanding correct? If yes what is the industrial network protocol do you have in use by the way?

But back to your question. Since netHAT is just a module that turns industrial network data exchanged with a PLC into readable and writeable buffers on Raspberry Pi side this is where Hilscher knowledge ends and also where the provisioning of examples and drivers for netHAT ends. This means we provide just examples how to read or write the data buffers ... what an application is finally doing with this data and where it is going to after a read or where it was coming from before a write is not our business. It's 100% in the hands of the programmer. So again I am sorry to say that I can't deliver you and further sample code.

I entered the search term "HTTP POST PUT GET C coded " into google search ... and I got thousands of hits of examples for it. I think this a good approach for you to continue programming your code to the end with all the source codes available on other web sites.

Thx
Armn

Oh, I think I now understand how far NetHat works. It communicates with PLCs - writes and reads data from a buffer on a port at a certain baud rate.

As for GET/POST/PUT with raspberry - no mystery.

My real question was whether I could do this with NetHat - read data from a sensor and send that data to a cloud endpoint just using the NetHat chip.
I figured I could do everything with NetHat alone - communicate with the PLC and send that data to an external endpoint.

According to what you explained I use NetHat to communicate with the PLC (read, write data on a port) and if I need to send this data to a cloud endpoint I use Raspberry's Ethernet (or Wi-Fi) PI.

Thanks for listening