Hi all,
I’m new to Node-Red, but have relatively simple task to accomplish.
We have Siemens LOGO PLC (6ED1052-1MD08-0BA2) that we program using Logo!Soft. The one has Network Output block that should send Modbus package to Windows PC and Node-Red should catch it and trigger further commands (SMS – already works). Did anyone had experience with this?
Logo!Soft Network Output block:
Write value to: remote device
IP: 192.168.3.170 (Windows PC IP address)
Device type: Modbus-compatible device
Port: 502
Unit ID: 1
ModBus Type: Coil (can’t be changed)
ModBus address: 1
Node-Red on Windows PC side has Modbus Read block:
Name: Read PLC
Unit-Id: 1
FC: FC 1: Read Coil Status
Address: 502
Quantity: 1
Poll Rate: 10 seconds
Server: modbus-tcp@192.168.3.171:502 (PLC IP address)
What I’m missing? See attached screenshot.
Thank you in advance!
To read the Q1 output, you need to set the address within the correct range and specify the number of outputs to read in the quantity field.
I've also noticed that the address space is likely zero-indexed, so the first Coil (Q1) can often be found at address 8192. However, I haven't fully dug into the offset issue, so you may need to experiment a bit.
A couple of key points to check:
Modbus Read Address: The address in the Modbus Read node should not be the port (502) but rather an address within the Modbus memory space.
Correct Function Code (FC): Make sure you select the right FC based on the type of register you're trying to read.
LOGO! IP Addresses: The Siemens LOGO! PLC actually uses two IP addresses: the one you configured and the next one (+1), so keep that in mind when troubleshooting.
SMS thoughts: You might need to create a function to bind the coil status values and only send an sms when the state goes from low to high or the opposite high to low, since the read output is a stream of data.
Thank you for advice! I will check address space. I've just realized that maybe I'm doing it wrong. PLC will be Modbus client and Node-Red will be Modbus server. The other way around PLC's port 502 was closed. Need to figure out how to configure that flow. Maybe something like: