Skip to content

Commit

Permalink
refactor: Fine tuning of the API and SPI (#1786)
Browse files Browse the repository at this point in the history
* refactor: Fine tuning of the API and SPI to allow ILLEGAL_ADDRESS responses for individual invalid addresses (Alongside a major cleanup)

* refactor: Major cleanup of the PlcValueHandler

* refactor: Major cleanup of the PlcValueHandler

* refactor: Added more testcases to the PlcValueHandler tests

* refactor: Updated the PlcValue types and the single item tests.

* refactor: Moved the PlcTagHandler from the driver to the PlcConnection/Protocol so we can start making connection-aware tag-handlers in the future.

* fix: Disabled another OPC-UA test, which seems to be randomly failing the build.

* doc: Updated the RELEASE_NOTES

* refactor: Renamed some of the variables in the Plc4xProtocolBase class

---------

Co-authored-by: Sebastian Rühl <[email protected]>
  • Loading branch information
chrisdutz and sruehl authored Oct 2, 2024
1 parent b03981b commit 69b8bc1
Show file tree
Hide file tree
Showing 207 changed files with 5,355 additions and 4,111 deletions.
6 changes: 6 additions & 0 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ Incompatible changes
efficient PlcRawByteArray type is used, that gives users
direct access to the bytes returned from the PLC instead of
a list of PlcValues.
- The builders for read- and write-requests now process tags
and values on a per-field level. If one field has an invalid
address it will now only fail the one item related to that.
Same applies to values. Only the tag who's value was invalid
will be considered failed and no longer an exception should
be thrown.

Bug Fixes
---------
Expand Down
38 changes: 21 additions & 17 deletions plc4go/assets/testing/protocols/ads/DriverTestsuite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1150,17 +1150,21 @@
<PlcTagRequest>
<tags isList="true">
<hurz>
<SymbolicAdsTag>
<symbolicAddress dataType="string" bitLength="128" encoding="UTF-8">MAIN.hurz_Struct</symbolicAddress>
</SymbolicAdsTag>
<PlcTagItem>
<tag>
<SymbolicAdsTag>
<symbolicAddress dataType="string" bitLength="128" encoding="UTF-8">MAIN.hurz_Struct</symbolicAddress>
</SymbolicAdsTag>
</tag>
</PlcTagItem>
</hurz>
</tags>
</PlcTagRequest>
</PlcReadRequest>
</request>
<values isList="true">
<hurz>
<ResponseItem>
<PlcResponseItem>
<code dataType="string" bitLength="16" encoding="UTF-8">OK</code>
<value>
<PlcStruct>
Expand Down Expand Up @@ -1232,7 +1236,7 @@
</hurz_DATE>
</PlcStruct>
</value>
</ResponseItem>
</PlcResponseItem>
</hurz>
</values>
</PlcReadResponse>
Expand Down Expand Up @@ -1580,12 +1584,12 @@
</PlcReadRequest>
<values isList="true">
<hurz>
<ResponseItem>
<PlcResponseItem>
<code dataType="string" bitLength="16" encoding="UTF-8">OK</code>
<value>
<PlcBOOL dataType="bit" bitLength="1">true</PlcBOOL>
</value>
</ResponseItem>
</PlcResponseItem>
</hurz>
</values>
</PlcReadResponse>
Expand Down Expand Up @@ -1754,20 +1758,20 @@
</PlcReadRequest>
<values isList="true">
<hurz1>
<ResponseItem>
<PlcResponseItem>
<code dataType="string" bitLength="16" encoding="UTF-8">OK</code>
<value>
<PlcBOOL dataType="bit" bitLength="1">true</PlcBOOL>
</value>
</ResponseItem>
</PlcResponseItem>
</hurz1>
<hurz2>
<ResponseItem>
<PlcResponseItem>
<code dataType="string" bitLength="16" encoding="UTF-8">OK</code>
<value>
<PlcBOOL dataType="bit" bitLength="1">true</PlcBOOL>
</value>
</ResponseItem>
</PlcResponseItem>
</hurz2>
</values>
</PlcReadResponse>
Expand Down Expand Up @@ -2040,12 +2044,12 @@
</PlcReadRequest>
<values isList="true">
<hurz1>
<ResponseItem>
<PlcResponseItem>
<code dataType="string" bitLength="16" encoding="UTF-8">OK</code>
<value>
<PlcBOOL dataType="bit" bitLength="1">false</PlcBOOL>
</value>
</ResponseItem>
</PlcResponseItem>
</hurz1>
</values>
</PlcReadResponse>
Expand Down Expand Up @@ -2319,12 +2323,12 @@
</PlcReadRequest>
<values isList="true">
<hurz1>
<ResponseItem>
<PlcResponseItem>
<code dataType="string" bitLength="16" encoding="UTF-8">OK</code>
<value>
<PlcBOOL dataType="bit" bitLength="1">false</PlcBOOL>
</value>
</ResponseItem>
</PlcResponseItem>
</hurz1>
</values>
</PlcReadResponse>
Expand Down Expand Up @@ -2474,12 +2478,12 @@
</PlcReadRequest>
<values isList="true">
<hurz1>
<ResponseItem>
<PlcResponseItem>
<code dataType="string" bitLength="16" encoding="UTF-8">OK</code>
<value>
<PlcBOOL dataType="bit" bitLength="1">false</PlcBOOL>
</value>
</ResponseItem>
</PlcResponseItem>
</hurz1>
</values>
</PlcReadResponse>
Expand Down
18 changes: 11 additions & 7 deletions plc4go/assets/testing/protocols/eip/DriverTestsuite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -398,24 +398,28 @@
<PlcTagRequest>
<tags isList="true">
<hurz>
<EipTag>
<node dataType="string" bitLength="40" encoding="UTF-8">%rate</node>
<type dataType="string" bitLength="32" encoding="UTF-8">DINT</type>
<elementNb dataType="uint" bitLength="16">1</elementNb>
</EipTag>
<PlcTagItem>
<tag>
<EipTag>
<node dataType="string" bitLength="40" encoding="UTF-8">%rate</node>
<type dataType="string" bitLength="32" encoding="UTF-8">DINT</type>
<elementNb dataType="uint" bitLength="16">1</elementNb>
</EipTag>
</tag>
</PlcTagItem>
</hurz>
</tags>
</PlcTagRequest>
</PlcReadRequest>
</request>
<values isList="true">
<hurz>
<ResponseItem>
<PlcResponseItem>
<code dataType="string" bitLength="16" encoding="UTF-8">OK</code>
<value>
<PlcDINT dataType="int" bitLength="32">369229824</PlcDINT>
</value>
</ResponseItem>
</PlcResponseItem>
</hurz>
</values>
</PlcReadResponse>
Expand Down
16 changes: 8 additions & 8 deletions plc4go/assets/testing/protocols/modbus/tcp/DriverTestsuite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@
</request>
<values isList="true">
<hurz>
<ResponseItem>
<PlcResponseItem>
<code dataType="string" bitLength="16" encoding="UTF-8">OK</code>
<value>
<PlcREAL dataType="float" bitLength="32">3.1415927410125732</PlcREAL>
</value>
</ResponseItem>
</PlcResponseItem>
</hurz>
</values>
</PlcReadResponse>
Expand Down Expand Up @@ -202,15 +202,15 @@
</request>
<values isList="true">
<hurz>
<ResponseItem>
<PlcResponseItem>
<code dataType="string" bitLength="16" encoding="UTF-8">OK</code>
<value>
<PlcList>
<PlcREAL dataType="float" bitLength="32">3.1415927410125732</PlcREAL>
<PlcREAL dataType="float" bitLength="32">3.1415927410125732</PlcREAL>
</PlcList>
</value>
</ResponseItem>
</PlcResponseItem>
</hurz>
</values>
</PlcReadResponse>
Expand Down Expand Up @@ -357,20 +357,20 @@
</request>
<values isList="true">
<hurz1>
<ResponseItem>
<PlcResponseItem>
<code dataType="string" bitLength="16" encoding="UTF-8">OK</code>
<value>
<PlcREAL dataType="float" bitLength="32">3.1415927410125732</PlcREAL>
</value>
</ResponseItem>
</PlcResponseItem>
</hurz1>
<hurz2>
<ResponseItem>
<PlcResponseItem>
<code dataType="string" bitLength="16" encoding="UTF-8">OK</code>
<value>
<PlcREAL dataType="float" bitLength="32">3.1415927410125732</PlcREAL>
</value>
</ResponseItem>
</PlcResponseItem>
</hurz2>
</values>
</PlcReadResponse>
Expand Down
Loading

0 comments on commit 69b8bc1

Please sign in to comment.