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

[BUG] - Alias Tags With Identical Structure Return Errors on Some PLCs #308

Open
3 tasks done
Colt-H opened this issue Dec 7, 2023 · 0 comments
Open
3 tasks done
Labels
bug Something isn't working

Comments

@Colt-H
Copy link
Contributor

Colt-H commented Dec 7, 2023

Pre-checks

  • running latest version
  • enabled logging
  • consulted the docs

Description
Have two PLCs with identical UDTs, and a tag Aliased off of one of the UDT members. Upload tag DB from PLC1, pass to LogixDriver when uploading tag value from PLC2. When passing the Alias tag to plc.read() on PLC2, it returns a "Destination unknown, class unsupported, instance undefined or structure element undefined (see extended status)" error with an exerr of "Extended Status out of Memory". The reason I'm filing a bug report is because if I don't use the tag alias (as in query the UDT directly via pycomm), it works as expected and gives me the tag value. I can also send a CIP Data table read from a 3rd controller to both with the alias tag as the source element and it works. The UDTs are identical and at the same scope.

It may very well be an issue with how the controllers map the tag alias that's out of scope of pycomm3, but it's odd that it works with a MSG instruction from a 3rd controller if it were an issue with tag structure.

Target PLC
Model: Both 1756-L72
Firmware Revision: Both 24
Other Devices in CIP Path: Both 1756-ENBT V6.006

Code Sample
Minimal reproduceable code sample

  from pycomm3 import LogixDriver

def initalize_tags(addr):
    with LogixDriver(addr, init_program_tags=False) as plc:
        return plc._tags

def read_value(addr, tag, tag_list):
    with LogixDriver(addr, init_tags=False) as plc:
        plc._tags = tag_list
        return plc.read(tag)
    
tag_list = initalize_tags("10.10.10.10/0")

plc1_value_alias = read_value("10.10.10.10/0", "Alias_Tag", tag_list) #no error
plc2_value_alias = read_value("10.10.10.11/0", "Alias_Tag", tag_list) #type error

plc1_value_UDT = read_value("10.10.10.10/0", "UDT.REAL[0]", tag_list) #no error
plc2_value_UDT = read_value("10.10.10.11/0", "UDT.REAL[0]", tag_list) #no error

Additional context
Verbose Logging showing the initialization and tag read request on the error PLC.
2023-12-07 12:33:11,311 [DEBUG] pycomm3.cip_driver.CIPDriver.send(): Received: GenericConnectedResponsePacket(service=b'\x01', command=b'p\x00', error=None)
2023-12-07 12:33:11,312 [INFO] pycomm3.cip_driver.CIPDriver.generic_message(): Generic message 'get_plc_name' completed
2023-12-07 12:33:11,312 [INFO] pycomm3.logix_driver.LogixDriver._initialize_driver(): Initialization complete.
2023-12-07 12:33:11,312 [VERBOSE] pycomm3.cip_driver.CIPDriver._verbose(): >>> SEND >>>
(0000) 70 00 20 00 00 b1 02 1f 00 00 00 00 5f 70 79 63 p• •••••••••pyc
(0010) 6f 6d 6d 5f 00 00 00 00 00 00 00 00 0a 00 02 00 omm
••••••••••••
(0020) a1 00 04 00 0d b9 33 04 b1 00 0c 00 02 00 4c 03 ••••••3•••••••L•
(0030) 20 6b 25 00 1f 02 01 00 k%•••••
2023-12-07 12:33:11,312 [DEBUG] pycomm3.cip_driver.CIPDriver.send(): Sent: ReadTagRequestPacket(message=[b'\x02\x00', b'L\x03 k%\x0...f\x02\x01\x00'])
2023-12-07 12:33:11,320 [VERBOSE] pycomm3.cip_driver.CIPDriver._verbose(): <<< RECEIVE <<<
(0000) 70 00 1c 00 00 b1 02 1f 00 00 00 00 00 00 00 00 p•••••••••••••••
(0010) 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 ••••••••••••••••
(0020) a1 00 04 00 53 f1 b5 54 b1 00 08 00 02 00 cc 00 ••••S••T••••••••
(0030) 05 01 00 00 ••••
2023-12-07 12:33:11,320 [DEBUG] pycomm3.cip_driver.CIPDriver.send(): Received: ReadTagResponsePacket(None, None, 5)
2023-12-07 12:33:11,320 [INFO] pycomm3.cip_driver.CIPDriver.generic_message(): Sending generic message: forward_close
2023-12-07 12:33:11,320 [VERBOSE] pycomm3.cip_driver.CIPDriver._verbose(): >>> SEND >>>
(0000) 6f 00 28 00 00 b1 02 1f 00 00 00 00 5f 70 79 63 o•(•••••••••pyc
(0010) 6f 6d 6d 5f 00 00 00 00 00 00 00 00 0a 00 02 00 omm
••••••••••••
(0030) 27 04 09 10 eb 0b 7b 12 03 00 01 00 20 02 24 01 '•••••{••••• •$•
2023-12-07 12:33:11,320 [DEBUG] pycomm3.cip_driver.CIPDriver.send(): Sent: GenericUnconnectedRequestPacket(message=[b'N', b'\x02 \x06$\x01', b"\n\x05'\x04...\xeb\x0b{\x12", b'\x03\x00\x01\x00 \x02$\x01'])
2023-12-07 12:33:11,361 [VERBOSE] pycomm3.cip_driver.CIPDriver._verbose(): <<< RECEIVE <<<
(0000) 6f 00 1e 00 00 b1 02 1f 00 00 00 00 5f 70 79 63 o•••••••••••pyc
(0010) 6f 6d 6d 5f 00 00 00 00 00 00 00 00 0a 00 02 00 omm
••••••••••••
(0020) 00 00 00 00 b2 00 0e 00 ce 00 00 00 27 04 09 10 ••••••••••••'•••
(0030) eb 0b 7b 12 00 00 ••{•••
2023-12-07 12:33:11,361 [DEBUG] pycomm3.cip_driver.CIPDriver.send(): Received: GenericUnconnectedResponsePacket(service=b'N', command=b'o\x00', error=None)
2023-12-07 12:33:11,361 [INFO] pycomm3.cip_driver.CIPDriver._forward_close(): Forward Close succeeded.
2023-12-07 12:33:11,361 [VERBOSE] pycomm3.cip_driver.CIPDriver._verbose(): >>> SEND >>>
(0000) 66 00 00 00 00 b1 02 1f 00 00 00 00 5f 70 79 63 f•••••••••••pyc
(0010) 6f 6d 6d 5f 00 00 00 00 omm
••••
2023-12-07 12:33:11,361 [DEBUG] pycomm3.cip_driver.CIPDriver.send(): Sent: UnRegisterSessionRequestPacket(message=[])
2023-12-07 12:33:11,361 [DEBUG] pycomm3.cip_driver.CIPDriver.send(): Received: UnRegisterSessionResponsePacket()
2023-12-07 12:33:11,361 [INFO] pycomm3.cip_driver.CIPDriver._un_register_session(): Session Unregistered
SpdCmd_CPM, None, None, Destination unknown, class unsupported, instance undefined or structure element undefined (see extended status) - Extended status out of memory (05, 00)

@Colt-H Colt-H added the bug Something isn't working label Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant