NI Home > Community > NI Discussion Forums

LabVIEW

Reply
Member
Nikolce
Posts: 4
0 Kudos

Using TCP/IP with SIemens PLC LOGO! 0ba7

Hi everyone,

 

I am using Siemens PLC, LOGO! 0ba7 230RCE and I want to make communication between the LOGO and LabVIEW using TCP/IP or if it's possible UDP.

The LOGO is connected using an Ethernet cable to a wireless router on LAN port and I want using LabVIEW to receive the data that the LOGO sends to its Ethernet port.

The default port of every LOGO is 10001.

 

I have problems receiving any data in LabVIEW. I have simple program, where I open a connection using an IP address and the specific port and I use Read block to receive the data that the LOGO sends. But I don't receive any data.

 

I also use WireShark to sniff the data and I have detected that the LOGO! sends an Gratuitous ARP request and there is not any answer.

 

I would be very grateful if anyone could help me.

 

Thanks in advance!

 
Active Participant
Texas_Diaz
Posts: 261
0 Kudos

Re: Using TCP/IP with SIemens PLC LOGO! 0ba7

Likely your firewall is to blame.  Try temporarily shutting it down and see if you can communicate, if so then you can begin working through the Firewall to allow ports/apps.

 

-Danny

Member
Nikolce
Posts: 4
0 Kudos

Re: Using TCP/IP with SIemens PLC LOGO! 0ba7

Thank you for the answer. But the firewall is not the problem, I have tried withe firewall ON and OFF.

Active Participant
Texas_Diaz
Posts: 261
0 Kudos

Re: Using TCP/IP with SIemens PLC LOGO! 0ba7

[ Edited ]

Maybe I have a better understanding of what's overall going on now.  Let's discuss a few topics.

 

A Gratuitous ARP really isn't a request for information - it's a "Oooh, Oooh, Look at me, I'm here on the network!" kind of message.  Most often Gratuitous ARP messages are sent out from systems so that they're added to ARP tables automatically, can be configured to a switch quicker, and other benefits - a Gratuitous ARP message is actually a "forced ARP Reply" even though there was never an ARP Request (it rarely ever solicits a reply from anyone else on the system).  

 

If you're trying to listen to data on a TCP port, a system would have to specifically open a socket to your specific IP address (or you'd have to connect to the port on the remote system) - TCP is targeted, meaning it's a 1-to-1 protocol.  Unless your Siemens PLC knows about your presence and directly sends you information, you won't receive anything from it.  You cannot "listen in" on TCP conversations happening (without specific hardware, hardware configurations, or packet mirroring/monitoring functionality on the switches being used).  You likely will never see this traffic in WireShark unless the traffic is specifically being sent to YOU, or you've got one of the aforementioned hardware/software configurations that allows you to see it.  In short, it's not likely you're ever going to be able to just "eaves drop" on a TCP conversation.  With TCP, your best bet is to initiate the conversation yourself (though you have to know how to do that with the Siemens PLC).

 

If you're trying to listen to data on a UDP port, you've got a much better chance of hearing what someone is saying.  UDP Broadcast or UDP Multicast (where you're registered to the same multicast address) allows you to "listen in" on what's going on, but only if the system is "broadcasting to the world" the information.  You'd see this traffic loud and clear in Wireshark, though.  If you aren't seeing this traffic clear-as-day in Wireshark, then likely it isn't being transmitted.  And you cannot listen in on a conversation (even a one-way conversation) that isn't happening.

 

So, to wrap a bow on this, everything is likely working properly.  Your Siemens PLC is just not sending out any data that your LabVIEW app can listen to (LabVIEW isn't a mind reader, after all).  You likely need help from a Siemens PLC forum, not a LabVIEW forum.

 

EDIT:  Page 32 of the Siemen's LOGO! user manual says that you can only create a network topology with a Siemen's LOGO! through the use of their LOGO!Soft Comfort V7.0 software.  This usually means the network communication is proprietary, and they're not going to tell you how to communicate with the device via generic TCP/IP.  I guess that's what happens when you use a PLC.  :smileyembarrassed:

 

-Danny

Member
Nikolce
Posts: 4
0 Kudos

Re: Using TCP/IP with SIemens PLC LOGO! 0ba7

[ Edited ]

Thank you for the answer.

 

I also want to mention this. Siemens has an Android application, LOGO! App, for monitoring the LOGO! (inputs, outputs, flags etc.).To connect to the LOGO! using this app I only enter the IP address that is LOGO!s IP network addres. It connects very simple and I receive the state of the inputs, outputs etc. I can monitor the data that the LOGO sends while I am trying to use LabVIEW. I am telling you this to point out that the LOGO! sends data. 

But, the program is created by Siemens and I don't know how they communicate with the PLC.

 

I forgot to mention another thing. There is a product from a Dutch company, LOGO! Monitor, which can be used to make a small SCADA, monitoring inputs, outputs, and also controlling the PLC. Using this program is very simple, the LOGO PLC connects to the PC using an ethernet cable and you can continue to build the program. I got the idea to use LabVIEW from this program, I thought if they can make this great program, I can do something simple in LabVIEW.