Skip to content
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

Feature/modbus optimizer #1744

Merged
merged 10 commits into from
Sep 5, 2024
Merged

Feature/modbus optimizer #1744

merged 10 commits into from
Sep 5, 2024

Conversation

chrisdutz
Copy link
Contributor

Implemented an optimizer for Modbus in Java, that groups together individual items and loads chunks of bytes.
This needed quite a bit of updating which also had an effect on the generated code of almost every language we have.

However with this update the read speed of the ManualModbusTest increased by a factor of more than 10.

@chrisdutz chrisdutz requested review from hutcheb and ottlukas and removed request for hutcheb September 4, 2024 15:54
@chrisdutz
Copy link
Contributor Author

@hutcheb and @ottlukas I could use your help on the python stuff ... should not be a huge change ... in other languages, if I have an array of byte byte that it uses the PlcRawByteArray instead of a List.

@chrisdutz chrisdutz marked this pull request as draft September 4, 2024 15:56
@ottlukas ottlukas marked this pull request as ready for review September 4, 2024 20:09
@hutcheb
Copy link
Contributor

hutcheb commented Sep 4, 2024

@chrisdutz Yeah have to spend some time on fixing things when it comes to using the PlcValues, the Modbus write PR will include some fixes for it. But for now it passes the tests.

@chrisdutz
Copy link
Contributor Author

Did I break anything with my addition?

@hutcheb
Copy link
Contributor

hutcheb commented Sep 4, 2024

No, it was just a Byte Array branch in the code gen that hadn't been used before. It was generating code that had a syntax error in it, that's why black couldn't reformat the file.

By the way we are using black to firstly check for syntax errors, as well as clean up some of the formatting in the code gen output. That way we can be lazy and don't have to get the formatting in the code gen output exactly right.

@ottlukas
Copy link
Contributor

ottlukas commented Sep 5, 2024

No, it was just a Byte Array branch in the code gen that hadn't been used before. It was generating code that had a syntax error in it, that's why black couldn't reformat the file.

By the way we are using black to firstly check for syntax errors, as well as clean up some of the formatting in the code gen output. That way we can be lazy and don't have to get the formatting in the code gen output exactly right.

Black - The uncompromising code formatter

…eature/modbus-optimizer

# Conflicts:
#	plc4py/plc4py/protocols/modbus/readwrite/DataItem.py
#	plc4py/plc4py/protocols/modbus/readwrite/ModbusDataType.py
#	plc4py/plc4py/protocols/simulated/readwrite/DataItem.py
…dressable in one request to the modbus driver.
@chrisdutz
Copy link
Contributor Author

No, it was just a Byte Array branch in the code gen that hadn't been used before. It was generating code that had a syntax error in it, that's why black couldn't reformat the file.

By the way we are using black to firstly check for syntax errors, as well as clean up some of the formatting in the code gen output. That way we can be lazy and don't have to get the formatting in the code gen output exactly right.

As long as the output gives you a hint to what the problem is ... admittedly I was a bit lost and commented out black in order to get a sensible error report.

@chrisdutz chrisdutz merged commit 079dd60 into develop Sep 5, 2024
28 checks passed
@chrisdutz chrisdutz deleted the feature/modbus-optimizer branch September 5, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants