• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NetHat + Ethernet/IP + APIs or SDKs
#1
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.
  Reply
#2
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
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#3
(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
  Reply
#4
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
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#5
(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
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pi + netHAT + NodeRed + EtherCAT effendi 1 536 August-19th-2021, 09:52 AM
Last Post: Armin@netPI
  Using Powerlink firmware with netHAT and config nxd thp9 3 2,751 August-25th-2020, 01:49 PM
Last Post: Armin@netPI
  NetHAT SPI configuration thp9 1 2,747 June-10th-2020, 02:05 PM
Last Post: Armin@netPI
  How can i set a EtherCAT node in netHAT 52-RTE? JGLee 6 3,989 June-9th-2020, 12:38 PM
Last Post: Armin@netPI
  cifX drivers EtherCAT read/write performance with NetHat over STM32 thp9 21 6,477 June-5th-2020, 10:17 AM
Last Post: Armin@netPI
  netHAT as Ethernet/IP Adapter with Codesys lstiegler 11 4,937 May-26th-2020, 06:40 PM
Last Post: Armin@netPI
  netHat configuration via config packets pitau 6 3,525 May-25th-2020, 02:21 PM
Last Post: Armin@netPI
  NetHAT temperature question thp9 1 2,714 May-14th-2020, 09:21 PM
Last Post: Armin@netPI
  Using netHAT drivers with custom linux (not Raspbian) FrankS 5 3,358 September-11th-2019, 06:16 AM
Last Post: Armin@netPI
  Ethernet/IP usage inovahw 3 1,742 February-18th-2019, 10:53 AM
Last Post: inovahw

Forum Jump:


Users browsing this thread: 1 Guest(s)