Problems with Micro820 communication as Modbus RTU Master

kemosabian

Member
Join Date
Jan 2024
Location
Stirling
Posts
2
Hi Guys,

I am a new member and this is my first post!

I have a little PLC experience but it is mostly with siemens logo and using ladder logic. I have had training on Beckhoff and I've got a bit of experience in Python, C, C++ and I've done some basic Arduino programming.

I've recently started a new project to upgrade an existing control system by adding Modbus devices, the original PLC was a Rievtech micro PLC. The new modbus registers provided the data as 32bit floats and from a cost, size, performance point of view the Micro820 looked like the best option. However, I have two problems:

1) I have went in a bit gun ho and I think I've changed my IP address setting so I cant communicate with the PLC. To make matters worse I've tried folloing advice on here and youtube to update the firmware and to connect over RS232 and neither has worked. But I will persevere to re-establish comms!

2) I have managed to poll the device (set to address 2) using the built in RS485 connnection and the device recognises that it is being polled (and is presumably responding). The Micro820 does not receive any response though and doesn't recognise a time-out either. I thought perhaps the issue was "message turnaround delay" of the slave device noted in the manual (see attachment) so I tried adjusting the Micro820 protocol control to compensate for this to no avail.

Am I barking up the wrong tree? HELP!

Modbus slave.png
 
1) What is the the current IP address and netmask of the PC? What is the current IP address and netmask of the Micro820?

2) See here: https://literature.rockwellautomati.../documents/um/2080-um005_-en-e.pdf#G4.1045129

If you are sure the Modbus (slave) device is Modbus RTU using RS-485, try reversing the wires on the Micro820 serial port pins 1 and 2.

Are you strobing the MSG_MODBUS instruction with a rising edge on its enable pin?

Post the Micro820/CCW code (screenshot or PDF) that runs the Modbus RTU Master instruction, including the contents of the LocalCfg/MODBUSLOCPARA and TargetCfg/MODBUSTARPARA input parameter blocks.

Welcome to the forum!
 
Hi Brian,

Thanks for the help:
1a) PC ethernet adapter is set to the below, I beleive subnet mask is 255.255.255.0:

Link speed (Receive/Transmit): 100/100 (Mbps)
Link-local IPv6 address: fe80::2dac:32b3:2854:ef1%8
IPv6 DNS servers: fec0:0:0:ffff::1%1
fec0:0:0:ffff::2%1
fec0:0:0:ffff::3%1
IPv4 address: 169.254.0.1
Manufacturer: Realtek
Description: Realtek USB GbE Family Controller #3
Driver version: 10.56.20.1104
Physical address (MAC): 20-7B-D5-2C-5E-98

1b) PLC is set to 169.254.120.50 and subnet mask is 255.255.0.0 I believe, but I lost comms while trying to set a static IP for the PLC which may have had a typo. I could kick myself for that one!

2) I have tried to reverse the wires multiple times, early on the device display was showing that it was receiving requests and it recognised that it was for it's address (so it was presumably responding)

I am not strobing the modbus enable pin, it is permanently high. I thought the Trigger.Type = 1 was the best way to ensure ongoing polling of the device

My program is really basic, it has no contents other than the modbus communications at the moment, I plan to add the rest of the program once I have established the communication.

Modbus settings.png
 
1) If you set the PC netmask to 255.255.0.0, then you should be able to communicate with the PLC.

1.1) Another solution would be to set the PC IP Address to 169.254.120.1.


2) The Modbus settings seem okay, but I don't know if I would trust TriggerType=1 over serial. The Micro8xx documentation is less than helpful, as it states the two possible values are 0 and 1, and values of 2-255 are "Reserved," but then gives an example with TriggerType=100. I would use TriggerType=0 and a repeating TON with PT=T#1024ms triggering the IN pin of the MSG_MODBUS instruction to start; if I needed data faster than that I would experiment with the TON .PT to see how small it could go before communication with the Modbus Slave device fails.
 
...

2) The Modbus settings seem okay, ...


Caveats

  • I assume the Modbus node address of the target device's data you want to read is 2
  • I assume you want to read two holding registers
  • I assume the first holding register you want to read is the 1004th holding register of the target device,
    • i.e. it is at offset 1003 from the first register of the target device.
 

Similar Topics

Hello plctalk, I am in the proces of integrating a Micro820 with the purpose of getting data out of 4 AB Powerflex 4M drives through Modbus...
Replies
1
Views
1,790
Hello everyone, I'm working on a project with an Allen-Bradley Micro820 PLC and PV800 HMI. This is my first time using A-B controllers, and I'm...
Replies
8
Views
8,551
Hi, having some issues with scalings (SCP commands) with some Vegapuls 65 guided wave radar level transmitters. I've set the min/max in the...
Replies
5
Views
129
Anyone have problems/solutions with Rehosting Studio 5000 to a new computer. Our IT department successfully Rehosted 2 laptops, but the other 2...
Replies
1
Views
145
Back
Top Bottom