Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus Object Bug?

Another problem with modbus object?  Maybe so.

PLCs are Koyo DL06, same program, exactly just different modbus addresses.  Sites poll every 60 seconds. I have the modbus objects copied exactly the same settings (except station address of course). 

PLC1:  Connection on 40889 sets a 1 on every other poll. Polls. Updates. Done.  All good.
PLC2:  Connection on 40889 sets a 1 on every other poll. Polls. Updates. Polls. Updates. Polls. Updates....  It doesnt stop.

Heres the funny thing.  If i make a new modbus object:
PLC2TEMP:  Connection on 40889 sets a 1 on every other poll. Polls. Updates.  Done.


My modbus.ini settings:
[all]
UpdateOutputs=2
RefreshOutputs=1

Thanks for the help
Mike

Mike Crabtree - Lead Developer
Destek of Nevada, Inc. / Digital Telemetry Systems, Inc.
(866) 964-6948 / (760) 247-9512
0 Kudos
Message 1 of 13
(8,014 Views)
I do the same configuration and test on my computer.  It polls every 15 sec. UpdateOutputs=2 RefreshOutputs=1, "immediately write" checked.
The below is the log file on serial port.
[01][01][00][00][00][01][FD][CA] is the read on every poll. See, if the write output is not changed, there is no write function sent out. On every poll, it just reads the value back, no write.
After I change the switch to ON, it sends out [01][05][00][00][FF][00][8C][3A] immediately. [05] is write single coil.
So, when immediately write is checked, UpdateOutputs is almost meaningless, because the output will be updated immediately.
 
What do you mean by "Updates. Done.  All good." I think if you set polls=60 sec, it should poll every 60sec, it should not stop polling.
So could you also make the log file on serial port? With the log file, we may find something.
 
 
15:23:37.2 - Modbus1 ->
[01][01][00][00][00][01][FD][CA]
15:23:37.3 - Modbus1 <-
[01][01][01][00][51][88]
15:23:52.2 - Modbus1 ->
[01][01][00][00][00][01][FD][CA]
15:23:52.3 - Modbus1 <-
[01][01][01][00][51][88]
15:23:52.6 - Modbus1 ->
[01][01][00][00][00][01][FD][CA]
15:23:52.6 - Modbus1 <-
[01][01][01][00][51][88]
15:23:52.6 - Modbus1 ->
[01][05][00][00][FF][00][8C][3A]
15:23:52.7 - Modbus1 <-
[01][05][00][00][FF][00][8C][3A]
15:24:07.3 - Modbus1 ->
[01][01][00][00][00][01][FD][CA]
15:24:07.3 - Modbus1 <-
[01][01][01][01][90][48]
15:24:22.3 - Modbus1 ->
[01][01][00][00][00][01][FD][CA]
15:24:22.3 - Modbus1 <-
Ryan Shi
National Instruments
0 Kudos
Message 2 of 13
(7,992 Views)
The object does not stop polling.  PollTime=60 secs., it polls ALL the time not every minute like it should.

It will just keep polling non-stop, the 40889 is a static 1, it is a confirmation to the plc (heartbeat time setting) So it doesnt transition.
I will try to log it.
Thanks
Mike
Mike Crabtree - Lead Developer
Destek of Nevada, Inc. / Digital Telemetry Systems, Inc.
(866) 964-6948 / (760) 247-9512
0 Kudos
Message 3 of 13
(7,985 Views)
This is not the first time i have run into it.  Going to log it today.

Mike
Mike Crabtree - Lead Developer
Destek of Nevada, Inc. / Digital Telemetry Systems, Inc.
(866) 964-6948 / (760) 247-9512
0 Kudos
Message 4 of 13
(7,926 Views)
Here is the quick log of when i attach to the point.  Site should poll every 3 minutes, update outputs every 2 polls.  Site is MB3



Mike Crabtree - Lead Developer
Destek of Nevada, Inc. / Digital Telemetry Systems, Inc.
(866) 964-6948 / (760) 247-9512
0 Kudos
Message 5 of 13
(7,825 Views)
Is it the original diagnostic file? It seems scrambled.
For example,
19/03/08 14:13:59 - MB3 ->
[0C][06][03]x[00][01][C9]J
MB3 - RTS low
19/03/08 14:14:00 - MB3 <-
[9F]/h[F9]
 
function code 06 is write single register. As its response, if successful it will be an echo of the request, which means the same data sent back.
 
But I only see the scrambled or missing characters everywhere...
Ryan Shi
National Instruments
0 Kudos
Message 6 of 13
(7,813 Views)
Exactly, and the retries are set at 5, timeout 1200.  It just keeps going, doesnt stop.

The communications at this site are not great (radio behind a very large hill), so garbled comms are expected.  The driver just goes into a loop.
Mike Crabtree - Lead Developer
Destek of Nevada, Inc. / Digital Telemetry Systems, Inc.
(866) 964-6948 / (760) 247-9512
0 Kudos
Message 7 of 13
(7,809 Views)
I guess you don't check "value in HEX" when configure the serial diagnostic file. That's why we see some single characters in the file. But I notice that almost all the response to [0c] [06] are incorrect, while most of response to [0c] [10] are correct.
 
Could you give me an example of how you configure the connections? I see there are both function code [06] and [10] sent out, I want to have a look at the process. Just an example is ok.
Ryan Shi
National Instruments
0 Kudos
Message 8 of 13
(7,767 Views)
Here is the data member config.  This is the connections on the driver.
Mike Crabtree - Lead Developer
Destek of Nevada, Inc. / Digital Telemetry Systems, Inc.
(866) 964-6948 / (760) 247-9512
0 Kudos
Message 9 of 13
(7,758 Views)
What does the dignostic file look like on the good modbus object? We can compare them.
 
From this dignostic file, after MB3 writes to address [03][3D] by function code [10], it writes to [03][78]. The response seems incorrect, and then it rewrites [03][3D].... it's a loop as you said.
[03][78] is 40889, named "CommReset" in the excel file. What does the "CommReset" do? What should happen after 40889 is set 1?
 
I guess that if you set the retry attempts to 0, it will not keep updating, right? If so, also make a diagnostic file on "retry attempts"=0.
Ryan Shi
National Instruments
0 Kudos
Message 10 of 13
(7,748 Views)