support set_attributes_all (service 0x02)#116
Open
filterdev wants to merge 1 commit intopjkundert:masterfrom
Open
support set_attributes_all (service 0x02)#116filterdev wants to merge 1 commit intopjkundert:masterfrom
filterdev wants to merge 1 commit intopjkundert:masterfrom
Conversation
5d7841f to
00e38df
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
i needed support for set_attributes_all for simulation purposes, using
pycomm3as a client library andcpppoas the Ethernet/IP server (no Logix). i am pretty sure someone else can benefit from this.example/how to
set up server with two attributes in the same object
0x80/1:python3 -m cpppo.server.enip --print my_uint32@0x80/1/1=UDINT my_int16@0x80/1/2=INTset all the objects attributes at once using a byte array (hex parsing is supported). in this example, the first four bytes
b'\x13\x00\x00\x00' == UDINT.produce(19)target the unsigned 32-bit integer and the last two bytesb'\xfe\xff' == INT.produce(-2)are meant for the signed 16-bit integer:python3 -m cpppo.server.enip.get_attribute -a localhost @0x80/1=0x13,0x00,0x00,0x00,0xfe,0xffthis will result in the following output on the server side
and on the client side
Fri Sep 27 15:51:43 2024: 0: Single S_A_A @0x0080/1 == Truedetails
set_attributes_allrequests in server and clientserver.enip.get_attributeto naturally supportset_attributes_allserver.enip.client