-
Notifications
You must be signed in to change notification settings - Fork 184
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
cannot import name 'Adapter' from 'pylogix' #207
Comments
Pylogix does not have an Adapter class to my knowledge, on which example did you see Adapter being imported?
|
Pylogix does have an Adapter class, but only in the experimental branch. Since this is not in the main branch, you must download the project from here on GH, then switch to the experimental branch. |
Ah ooppss, sorry for the wrong information, wasn't aware of it until now. |
Did you posted a comment and accidentally deleted? I see it on the notifications but is not here. |
Hi, |
The L5X is the I/O adapter, not a complete program. You would import it into the I/O tree of your existing program. |
I tried to import L5X IO adapter as ENBT child module. I made some correction to add as a remote child module of ENBT. My project IO tree have adaptor module as above. |
Logix is probably being picky because I exported the module from a CompactLogix. I'm guessing that it doesn't like importing to the ENBT. Your image above doesn't tell me how you configured the module. The example expects that you configured it like the image: The adapter in the I/O tree needs the IP address of the machine that will be running the pylogix adapter. And your adapter script needs to be configured for your ENBT's IP address. If that is not working, post a screenshot of your I/O adapter configuration, you exact python script and your IP adddresses. |
As I mentioned, Logix is not letting you import the module because it is terrible. I had the module in a CompactLogix, you have a ControlLogix, it is not smart enough to disregard that difference, unfortunately :) Is your computer's network adapter configured for the IP Address 192.168.1.23? Is your ENBT's IP Address 192.168.1.10? |
Can you capture it via wireshark and email the result to me? I do have a ControlLogix and ENBT, though I won't be able to test until Friday. Edit: My instinct is that there is some confusion on network adapters, I'd probably try disabling all unnecessary adapters. When you run your script, is there any error or any feedback? |
Is your script running in that instance? All I see is list identity, which is not pylogix, it is probably RSLinx. To minimize wireshark traffic, shut down RSLinx and LogixDesigner. Run Wireshark, run your script. Edit: Wait, why does your generic adapter report that is a Rockwell device? Something else is going on here, like another Rockwell device at the .23 address? The pylogix adapter has not implemented the services that would respond to the request that the module info tab would send. |
Here is the problem I'm having. You show the screenshot of your generic module's Module Info tab, it is reporting a Rockwell Software Communication Adapter. You are telling me that your computers IP address is 192.168.1.23 and that generic module is configured for 192.168.1.23, which looks to be the case and that would be correct. There's something up with your screenshot though. When you open the Module Info of your generic module, it is sending out a List Identity request to the address of 192.168.1.23. Some Rockwell device is responding. If it is your computer that is configured for 192.168.1.23, and it should be based on your script, nothing should respond. The only thing that should be at .23 is your computer, which would not respond to a List Identity request. |
Wait, can you go to the Network and Sharing Center and check if your adapter is set to "public network"? I had trouble with this, the firewall was blocking the connect request from the PLC. |
Okay, you are getting close. I don't think RSLinx would cause what you were seeing but maybe RSlinx Enterprise, I can't say for sure. The timeout is what I would expect because the pylogix adapter hasn't implemented the list identity response. You may have some more firewall work to do. I think there should be a register session, which I don't see. After both the register session and forward open, the connection switches to UDP, port 2222. |
Can you email me that wireshark packet capture? What's odd about your capture is that the forward open response, which should be coming from pylogix is the wrong size, which makes me think that there is something else responding. Edit: Edit line 388 in adapter.py: CIPVendorID = 0x1337 Then run that capture and send it to me. |
Hi, You are right, I didnt noticed any change with Adapter Script running or not in Wireshark. Can you please share your mail address. my email is [email protected]. |
have you tried disabling keys in your Adapter Module? ControlLogix modules can return with errors if keying is set to exact or compatible: https://literature.rockwellautomation.com/idc/groups/literature/documents/at/logix-at001_-en-p.pdf |
Preflight checks
Before you post an issue, ensure you have tried the minimal examples within the repo, or tried the pylogix-tester.
Type of issue
Import Error
Description of issue
Unable to Start Pylogix Adaptor
Expected behavior
Actual behavior
Code
Please provide a minimal, reproducible example
Screenshots
Stacktrace
Versions
Include versions to
The text was updated successfully, but these errors were encountered: