Hi! I'm trying to read data from high-speed counter HC202 (DWord, see the screenshot below) inside Delta AS228T PLC using libmodbus TCP:
uint16_t test_data[10];
modbus_read_registers(mb, 64715, 1, test_data);
Does it perhaps work with uneven adress?
Mvh
Hans
Try adjusting your address up or down one number and see if that works.
Look up zero based addressing verses one based addressing.
--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "libmodbus".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse libmodbus+...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.
--
I just noticed that your statement is not correct.
modbus_read_registers(mb, 64715, 1, test_data);
Change the 1 to 2. This is the number of 16 bit registers. For a DWord, you need to read at least two 16 bit registers.
From: libm...@googlegroups.com <libm...@googlegroups.com> On Behalf Of ????????? ?????????
Sent: Monday, December 24, 2018 5:34 AM
To: libmodbus <libm...@googlegroups.com>
Subject: Error reading DWord type device
Hi! I'm trying to read data from high-speed counter HC202 (DWord, see the screenshot below) inside Delta AS228T PLC using libmodbus TCP:
--
The other thing to try is to use Kepware software for testing. It runs for free in demo mode for an hour and is simple to use. If I am having problems with a device, using Kepware is the first test I do.
With Kepware, you can:
modpoll -m tcp -t4:int -e -r 64715 -c 1 -1 192.168.0.2
Try with another slave then, just to rule out the possibility that the PLC can't handle it.
uint16_t test_data[2];num = modbus_read_registers(mb, 64714, 1, test_data);
Form1->Caption = (long)test_data[0] << 16 | test_data[1];
1135. rc = check_confirmation(ctx, req, rsp, rc);1136. if (rc == -1)1137. return -1;