06-08-2018 10:48 AM
First off I am new to the forms, so hello.
Also, I am new to coding in Labview and Wago plcs.
What I am trying to do is listen when the plc is connected and receive its IP address so that i can start transmitting data via modbus.
I am able to communicate with the plc if I have the IP address.
But, I am not sure what the Listen function are looking for as so that is could program the Wago to send the appropriate signal.
Thanks
06-08-2018 11:30 AM - edited 06-08-2018 11:31 AM
hello and welcome,
i am unfamiliar with "Wago plcs", but as far as i know Modbus is a protocol over RS485 (or Serial). But you suggest it is over IP/Ethernet.
in the first case, finding an IP address doesen't help you.
finding a device with IP address might be either via ARP protocol (if you know the MAC address) or just by brute force.
i can't say i know how to do it with labview primitives, but you could use the "System Exec.vi" to use the toolchain of your OS.
06-08-2018 01:29 PM
06-10-2018 10:17 PM
@jwscs wrote:
but as far as i know Modbus is a protocol over RS485 (or Serial). But you suggest it is over IP/Ethernet.
I have done Modbus over RS-232 and there is a standard for Modbus over Ethernet (there are just some minor tweaks between the serial and Ethernet versions).
06-11-2018 12:18 PM - edited 06-11-2018 12:19 PM
I do not have any experience using Wago plcs, but I was able to locate some documentation referencing the IP address. The link below gives insight into assigning an IP address to the controller, which must be unique within the network.
Refer to page 25 in the following link:
http://global.wago.com/media/2_products/q07500880_00000000_0en.pdf
06-12-2018 09:08 AM
@EcthelionV wrote:
Hello in this link there is a description of the library used for communication Wago to LV.
I also attach this link where you can download the library and some examples.
It looks like the WAGO device uses standard MODBUS TCP, so instead of the very old .dll described in the WAGO documentation, one could use the free MODBUS library currently provided by NI: https://forums.ni.com/t5/NI-Labs-Toolkits/LabVIEW-Modbus-API/ta-p/3524019
06-12-2018 09:22 AM
@jardeneaux wrote:
What I am trying to do is listen when the plc is connected and receive its IP address so that i can start transmitting data via modbus.
I am able to communicate with the plc if I have the IP address.
But, I am not sure what the Listen function are looking for as so that is could program the Wago to send the appropriate signal.
Do you mean that the WAGO node will have an IP address assigned before it's connected to the network, but you don't have any way to know what it is, and you want your LabVIEW application to determine it? Is this actually a PLC running its own program (and do you have access to make changes to that program), or is it just a fieldbus node, strictly a Modbus slave?
If it's a PLC that can act as a Modbus master or slave, you could program it to send its address to your PC first before switching to acting as a slave. If it's strictly a Modbus slave, it won't be able to initiate any communications itself, it only responds to requests, so I don't see any way to have the WAGO node announce its presence. Perhaps by packet-sniffing you could detect its presence on the network if you knew its MAC address, but this wouldn't be easy to implement.
Will the WAGO be the only other thing on the network, and will it be on the same subnet as your PC (that is to say, will it have a similar address)? In that case maybe you could scan for it by pinging a range of addresses continuously until you get a reply.
06-12-2018 09:54 AM
Yes the Wago node will have an IP address assigned before it is connected. Also, as of right now I do not know if the plc will be on the same subnet as the PC.
Also I do have access to make changes to the PLC code.
Currently, I have the VI listening to a port but it looks like is more of an issue with the plc coding than building a Vi.
Every time the PLC tries to make a connection the error "Socket is not connected " come up on the PLC.
06-12-2018 10:25 AM
So are you trying to have the PLC as the master make a Modbus TCP connection to the PC as slave, or vice versa? When you say you have the VI (the PC) listening to a port, do you mean you set up a Modbus slave on the PC to listen to port 502, or did you just use the TCP Listen function? It would help a lot if you could share your LabVIEW code (and maybe your PLC code too).
06-16-2018 07:59 AM
I got it working.
The problem was that my firewall was blocking the place from teytry to establish a connection .