-
Notifications
You must be signed in to change notification settings - Fork 388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: modbusrtu is not success now #1212
Comments
I think the serial transports need a bit of testing ... unfortunately my previous setup seems to be unavailable to me and I'm struggling a bit with testing. Could you please give version 0.12.0-SNAPSHOT a try, as we already addressed some configuration issues for serial there. |
Ok .. so I've spotted an error in the Serial Transports and fixed it ... currently looking for a Serial Modbus device to do some further testing, but could you please test the latest SNAPSHOT version? |
Ok ... so I've tweaked quite a bit of stuff around the Serial Transport and Modbus in general ... could you please give this another try and tell us if it's working now? |
I tried using the 0.12 version, but it says that the transfer serial is not supported, is there something that has happened to the connection string |
MODBUS_RTU_CONNECT_OPTION = "modbus-rtu:serial://COM30?request-timeout=5000&unit-identifier=1&baud-rate=9600&num-data-bits=8&num-stop-bits=1&parity=NO_PARITY"; |
If you are using 0.12.0, then please have a look at the online documentation. The parameters for baud-rate etc need a prefix now |
sorry,it also exist when i use
|
What type of device are you trying to communicate with?
Gesendet von Outlook für Android<https://aka.ms/AAb9ysg>
…________________________________
From: StrawberryBlue ***@***.***>
Sent: Tuesday, February 20, 2024 3:05:00 PM
To: apache/plc4x ***@***.***>
Cc: Christofer Dutz ***@***.***>; Assign ***@***.***>
Subject: Re: [apache/plc4x] [Bug]: modbusrtu is not success now (Issue #1212)
sorry,it also exist when i use
MODBUS_RTU_CONNECT_OPTION = "modbus-rtu:serial://COM30?request-timeout=5000&unit-identifier=1&serial.baud-rate=9600&serial.num-data-bits=8&serial.num-stop-bits=1&serial.parity=NO_PARITY";
—
Reply to this email directly, view it on GitHub<#1212 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAE66YLPSMVAGUABKYQUZYTYUSUQZAVCNFSM6AAAAAA7PL2LTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJUGI4DKMJWGU>.
You are receiving this because you were assigned.Message ID: ***@***.***>
|
I am using a serial device on Windows,
Like the code , when attempting to establish a connection, the program throws an exception. |
It looks like the transport attribute does not support serial. |
I debugged the code and it seems that TcpTransport was used instead of SerialTransport.class, so I manually introduced the plc4j-transport-serial package. At this point, the data can be successfully read once, followed by frequent occurrences of |
I continued to check the input logs, and it seems that the previous agent closed the channel after reading it once |
I continued testing, and when I looped read the data, there was an incomplete message. The test code is as follows
After a period of program execution, there may be a half package situation, The complete response message should be '0103c8000100000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064a2ba', but the program cannot correctly parse the message due to two returns. Should length verification be added to the modbus return message. The error message is as follows java.lang.ArrayIndexOutOfBoundsException: Index 159 out of bounds for length 159 2024-02-22 09:41:33.471 WARN 19404 --- [ntLoopGroup-2-1] .p.j.s.GeneratedDriverByteToMessageCodec : Error decoding package with content [0000000000000000000000000000000000000000000000000000000000000000000000000000000000000064a2ba]: Unsupported case for discriminated type parameters [errorFlag=false functionFlag=0 response=true] org.apache.plc4x.java.spi.generation.ParseException: Unsupported case for discriminated type parameters [errorFlag=false functionFlag=0 response=true] |
Currently at a conference... Will look into this as soon as I'm back home. And yeah... The serial transport is not included per default. We should probably change that to include all supported transports for a given driver. |
Can you reproduce this problem |
Modbus with serial functioning is broken in 0.12.0. |
@StrawberryBlue I just recently updated the Modbus driver to hopefully eliminate the half-packet problem ... could you please give that another try? |
it is fixed, great |
What happened?
Now the ModbusRTU cannot run correctly.
Version
v0.11.0
Programming Languages
Protocols
The text was updated successfully, but these errors were encountered: