ottowayi / pycomm3

A Python Ethernet/IP library for communicating with Allen-Bradley PLCs.
MIT License
397 stars 88 forks source link

handling hidden UDT and AOI attributes #221

Closed emourzi1 closed 2 years ago

emourzi1 commented 2 years ago

pycomm3.cip.data_types.DataType description states that attributes property is "List of names for each attribute in the structure. Does not include internal tags not shown in Logix, like the host DINT tag that BOOL attributes are mapped to."

However, the current code shows hidden attributes for AOIs and UDT, where this is not happening when using Logix Designer. Proposed change will show only visible attributes. I followed the CIP spec that describes the style bytes that are returned from the controller, two bytes for each template member, and made the change to exclude them. internal_tags property still shows all structure attributes regardless of the visibility status. The tests passed with the exception of the test_demo_plc.py since I have a different controller and another version of Studio 5000.

Unfortunately, I am not able to use the develop branch as described in the "contributing guidelines" as I do not have the permission to create branches in the base repository.

ottowayi commented 2 years ago

thanks for this, I just have a couple questions. What spec are you referring too? I'm not seeing the same information in the Data Access Manual, but I could just be miss reading it too. And can you undo the couple of formatting/whitespace changes? I use black for formatting, although I'm not the biggest fan of the whitespace it adds to slices.

I'll do some testing with this this afternoon and get it merged soon. Also, I changed the target branch to develop. Usually I create a new one right after I publish a release, but I must've forgotten to do that.

ottowayi commented 2 years ago

Why did you close this PR? I was starting to review the changes this morning, sorry I've been really busy and finally got some time to work on it. If what I have currently isn't correct then I would like to include your fixes

emourzi1 commented 2 years ago

Please do not include any of these fixes. Does not look like the display style documentation is published, we do want to get in trouble because of it.

From: Ian @.> Sent: Wednesday, July 27, 2022 9:44 AM To: @.> Cc: Eugene @.>; @.> Subject: EXTERNAL: Re: [ottowayi/pycomm3] handling hidden UDT and AOI attributes (PR #221)

[Use caution with links & attachments]

Why did you close this PR? I was starting to review the changes this morning, sorry I've been really busy and finally got some time to work on it. If what I have currently isn't correct then I would like to include your fixes

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/ottowayi/pycomm3/pull/221*issuecomment-1196782126__;Iw!!JhrIYaSK6lFZ!rHYMFj7xXY9JWIh24BNGjVyLr9LQqfmReAwaGJmANhLAtUZ0_AYi4H_lVCU-VTxwVdSiOKqv5-zmIDikaxN2l4qBKe8c$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AZEE4M3A6CL5TXAXNQXVEATVWE4MLANCNFSM54JCHSYA__;!!JhrIYaSK6lFZ!rHYMFj7xXY9JWIh24BNGjVyLr9LQqfmReAwaGJmANhLAtUZ0_AYi4H_lVCU-VTxwVdSiOKqv5-zmIDikaxN2l9bkD6HH$. You are receiving this because you authored the thread.Message ID: @.***>

ottowayi commented 2 years ago

well shit, I understand though. I will not include these changes.

emourzi1 commented 1 year ago

Hi Ian,

Of course, I will fix the white spaces. I am using autopep8, will make required changes.

As far as the spec, I got it from some folks in the company, not sure where this was published. Of course, Logix Designer has the code as it hides these attributes. I am checking with my sources. IMO, It has to be public enough since the backplane driver from OLDI used in 1756-Compute appliances does not show these attributes.

Separately, when getting the identity information, the product type for some Rockwell devices is not recognized in pycomm3. There is a product type 144 which is designated for analytics devices which I am working with and is titled "Information Appliance". I can find the type in the spec and create a separate pull request.

Best regards,

Eugene Mourzine, Ph.D.

Sr. Project Software Engineer – Data, Edge and Analytics

[Rockwell Automation]

• Mobile Phone: (216) 505-0902

• E-mail: @.**@.>

From: Ian @.> Sent: Monday, July 25, 2022 9:42 AM To: @.> Cc: Eugene @.>; @.> Subject: EXTERNAL: Re: [ottowayi/pycomm3] handling hidden UDT and AOI attributes (PR #221)

[Use caution with links & attachments]

thanks for this, I just have a couple questions. What spec are you referring too? I'm not seeing the same information in the Data Access Manual, but I could just be miss reading it too. And can you undo the couple of formatting/whitespace changes? I use black for formatting, although I'm not the biggest fan of the whitespace it adds to slices.

I'll do some testing with this this afternoon and get it merged soon. Also, I changed the target branch to develop. Usually I create a new one right after I publish a release, but I must've forgotten to do that.

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/ottowayi/pycomm3/pull/221*issuecomment-1194064107__;Iw!!JhrIYaSK6lFZ!qRVd3ZnQwhgJrG-KjC39SvsRLhhQBTTw-3tKE5oDteOmEX4pvyteYg0BJntgTnZV8H__qIRTavrU6wxez2CpuGM4fOwR$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AZEE4M62TYZGTCPTNMEKWN3VV2KVTANCNFSM54JCHSYA__;!!JhrIYaSK6lFZ!qRVd3ZnQwhgJrG-KjC39SvsRLhhQBTTw-3tKE5oDteOmEX4pvyteYg0BJntgTnZV8H__qIRTavrU6wxez2CpuJd2XU-p$. You are receiving this because you authored the thread.Message ID: @.***>

emourzi1 commented 1 year ago

Thank you, much appreciated. I will reopen if I get a permission.

As a side note, you did a marvelous job with the package.

From: Ian @.> Sent: Wednesday, July 27, 2022 10:02 AM To: @.> Cc: Eugene @.>; @.> Subject: EXTERNAL: Re: [ottowayi/pycomm3] handling hidden UDT and AOI attributes (PR #221)

[Use caution with links & attachments]

well shit, I understand though. I will not include these changes.

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/ottowayi/pycomm3/pull/221*issuecomment-1196803513__;Iw!!JhrIYaSK6lFZ!pNz9u8DBJvvyITTC7vCjHXHWVCJzViYjxMVwi3WgbYUYxxL58i8y6J-ZJWTONNIIfSGFCLWYqJdnGgckDBlK5OyWY7-G$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AZEE4M4XCUNDOE22TY63FXTVWE6PXANCNFSM54JCHSYA__;!!JhrIYaSK6lFZ!pNz9u8DBJvvyITTC7vCjHXHWVCJzViYjxMVwi3WgbYUYxxL58i8y6J-ZJWTONNIIfSGFCLWYqJdnGgckDBlK5DqLh2Ot$. You are receiving this because you authored the thread.Message ID: @.***>

emourzi1 commented 1 year ago

I am not getting an answer on where the display style documentation is published. I cancelled the pull request and deleted the fork until I get a definite answer. Please do not merge the changes until then.

Thanks, Eugene

From: Ian @.> Sent: Monday, July 25, 2022 9:42 AM To: @.> Cc: Eugene @.>; @.> Subject: EXTERNAL: Re: [ottowayi/pycomm3] handling hidden UDT and AOI attributes (PR #221)

[Use caution with links & attachments]

thanks for this, I just have a couple questions. What spec are you referring too? I'm not seeing the same information in the Data Access Manual, but I could just be miss reading it too. And can you undo the couple of formatting/whitespace changes? I use black for formatting, although I'm not the biggest fan of the whitespace it adds to slices.

I'll do some testing with this this afternoon and get it merged soon. Also, I changed the target branch to develop. Usually I create a new one right after I publish a release, but I must've forgotten to do that.

— Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/ottowayi/pycomm3/pull/221*issuecomment-1194064107__;Iw!!JhrIYaSK6lFZ!qRVd3ZnQwhgJrG-KjC39SvsRLhhQBTTw-3tKE5oDteOmEX4pvyteYg0BJntgTnZV8H__qIRTavrU6wxez2CpuGM4fOwR$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AZEE4M62TYZGTCPTNMEKWN3VV2KVTANCNFSM54JCHSYA__;!!JhrIYaSK6lFZ!qRVd3ZnQwhgJrG-KjC39SvsRLhhQBTTw-3tKE5oDteOmEX4pvyteYg0BJntgTnZV8H__qIRTavrU6wxez2CpuJd2XU-p$. You are receiving this because you authored the thread.Message ID: @.***>