Code Monkey home page Code Monkey logo

pycomm's People

Contributors

jdlangs avatar kgustine avatar mbuesch avatar patrickjmcd avatar ruscito avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pycomm's Issues

Problem writing arrays to ControlLogix PLC

Hi!

I am doing a project that requires reading and writing tags to Allen Bradley PLCs, so PyComm comes in very handy. I am having an issue writing arrays to the PLC however:

testarray = [12, 13, 14]
driver = clx()

if driver.open('192.168.2.111'): 
   driver.write_array('Name.Space.Tag', 'INT', testarray) 
   driver.read_array('Name.Space.Tag', 3) 
   driver.close() 

Running this, I get this rather cryptic error:

File "C:\Python27\lib\site-packages\pycomm\ab_comm\clx.py", line 453, in read_array
    addr_data=self._target_cid,
  File "C:\Python27\lib\site-packages\pycomm\cip\cip_base.py", line 591, in send_unit_data
    return self._check_reply()
  File "C:\Python27\lib\site-packages\pycomm\ab_comm\clx.py", line 337, in _check_reply
    raise DataError(e)
pycomm.cip.cip_base.DataError: unpack requires a string argument of length 2

I can do the write to the PLC, but the value in the PLC tag does not change. When I try to read it back, I get the error above.

I can read and write simple tags without any issues - but array operations seem to fail - can you point me in the direction of a fix or a workaraound for this?

Thank you!

Sincerely,

Lars Stoustrup

check for warnings

I am receiving the warning below. I would like it to throw an exception that I can handle or somehow check for this in code so I can initiate a reconnect.

WARNING:pycomm.ab_comm.clx:(3, 'send_unit_data reply:IOI syntax error. A syntax error was detected decoding the Request Path (see extended status) - Extend status:Extended status out of memory')

Connection Recovery

Hi ruscito
Sorry, I am a Git novice and newbie to Python but old die hard AB man. Figured (Issues is how to post questions?) I have scripts running between CLX & ML1100 inserting data (Floats/Reals) into mySql on a Raspberry 2. I am impressed and thankful of your efforts in concluding this project - well done. My task is to provide a 24x7 (60 second update/storage) of PLC data for compliance on Water Treatment stations in remote locations. For this reason I have been testing to ensure NOTHING will break the script (my logger script) resulting in loss of data. During the testing I have been making/breaking ethernet connections while polling data and have had several issues where comms is lost and non recoverable. Have you any suggestions on how best to handle make/break situations allowing the CIP connection reestablish gracefully without crashing. Obviously I have rapped some try/except error handling clauses in the script but am struggling with maintaining continuity during abnormal situations. Any suggestions gratefully appreciated Regards Chris

read_tag does not parse properly if plc response with a proper error packet

Hi ruscito,

read_tag() generates an error when a plc responds with a properly constructed error_packet.

Traceback (most recent call last):
  ..
  ...
  File "/home/ahnafsidd/Github/pycomm/ab_comm/clx.py", line 414, in read_tag
    raise DataError(e)

After a bit of debugging, the problem seems to lie in this section of the code (clx.py line 397 onwards) and _check_reply():

if self.send_unit_data(
    build_common_packet_format(
    DATA_ITEM['Connected'],
    ''.join(message_request),
    ADDRESS_ITEM['Connection Based'],
    addr_data=self._target_cid,
)) is None:
    raise DataError("send_unit_data returned not valid data")

if multi_requests:
    return self._parse_multiple_request_read(tag)
else:
    # Get the data type
    data_type = unpack_uint(self._reply[50:52])
    try:
        return UNPACK_DATA_FUNCTION[I_DATA_TYPE[data_type]](self._reply[52:]), I_DATA_TYPE[data_type]
    except Exception as e:
        raise DataError(e)    

as you know, _check_reply() is called by send_unit_data() which parses the error response properly, but it is not handled when send_unit_data is called as it only checks for None and hence the parsing later on raises an error.

As of now the latter half of the code is not differentiating between a malformated packet which causes a problem in parsing and a properly formatted error packet which should return with a message without raising an error. I have a fix below, but I am not sure if its the best one.

# Get the data type
if self._check_reply():  ###--- calling self._check_reply() 
    data_type = unpack_uint(self._reply[50:52])
    try:
        return UNPACK_DATA_FUNCTION[I_DATA_TYPE[data_type]](self._reply[52:]), I_DATA_TYPE[data_type]
    except Exception as e:
        raise DataError(e)
else:
    return False, "Check Encapsulation and Message Router Error" # or any messages for that matter.

If you think this is good, I can create a pull request as I have already made a modification of it in my fork.

Thanks!
-- Ahnaf

Can't write/read to arrays, but tags fine

Im trying to read/write to arrays, I can do it with tags even of the same datatype. The array functions return nothing not even an error, as if the arrays didn't exist.

import sys
from pycomm.ab_comm.clx import Driver as ClxDriver

x_array = [ ]

c= ClxDriver()

if c.open("192.168.3.144"):
x_array = c.read_array("Test",32)
for tag in x_array:
print (tag)
c.write_tag(X22,1,'BOOL')

c.close

As you can see im also writing to a tag and going on RsLogix i can see the 1 being written to tags X22. In the same tag table i've added the Test array, so everything should work. If the X22 tag which was added in the same table after adding the test array, surely if writing to X22 works, the array should work also.

Thanks .

Write_XXXX function parameters

The pycomm.ab_comm.clx.Driver has the default order of parameters (value & data type) switched for write_tag vs write_array. It seems like this would be easier to keep straight if they were the same. However, I may be all wet on this, and you might have a very good reason for doing it that way.

def write_tag(self, tag, value=None, typ=None):
...
vs
def write_array(self, tag, data_type, values, raw=False):
...

Unable to establish session

Hi,

I am a newbie to both networking protocols as well as PLCs. I am trying to connect to a CompactLogix PLC by providing the IP address as an argument for c.open('IP'). The issue is that the PLC I am supposed to access is on one of the slots, and I am unable to figure out how to enter this slot along with the IP address. Kindly help

Pycomm to micro 820

I am trying to use the pycomm to speak with a micro 820. The error I am receiving is:
Read in Values:
A session need to be registered before to call forward open
The code I am using is directly from the examples CLX code see below:

from pycomm.ab_comm.clx import Driver as ClxDriver
import logging

from time import *


if __name__ == '__main__':

    logging.basicConfig(
        filename="ClxDriver.log",
        format="%(levelname)-10s %(asctime)s %(message)s",
        level=logging.DEBUG
    )
    c = ClxDriver()

    print c['port']

    if c.open('10.1.0.6', direct_connection=True):
        print("Open Connection")
        while 1:
            try:
                print("Read in Values:")
                print(c.read_tag(['Controls']))
                print(c.read_tag(['Control_Points_1[1]', 'Control_Points_1[2]', 'Control_Points_1[3]',
                                  'Control_Points_1[4]']))

                print("Write out values:")
                print(c.write_tag('Sensor_Active', 3, 'DINT'))
                print(c.write_tag(('Sensor_Active_1', 1, 'DINT')))
                print(c.write_tag([('Control_Points_2[1]', 4.0, 'real'), ('Control_Points_2[3]', 6.0, 'real'),
                                   ('Control_Points_2[5]', 8.0, 'real'), ('Control_Points_2[7]', 10.0, 'real')]))
                time.sleep(1)

            except Exception as e:
                c.close()
                print e
                pass

        # To read an array
        r_array = c.read_array("Sensor_Value", 1750)
        print("Print an array:")
        for tag in r_array:
            print (tag)

        c.close()

Any help would be appreciated.

pack_lint return error in cip_base.py

In cip_base.py, on lines 83-85 the pack_lint function should be packing, not unpacking (code below).
Current:

def pack_lint(l):
    """unpack 4 bytes little endian to int"""
    return struct.unpack('<q', l)

Fix:


def pack_lint(l):
    """pack 4 bytes little endian to int"""
    return struct.pack('<q', l)

Version Numbers

I'm not sure if this is an "issue" or not, but the modules have version set at 0.1 and 0.2 It threw me off when I thought it should have been 1.0.8

I'm just starting to play around with this a bit. Thanks for the great work so far!

acces only to part of tag array

Hi.
First, sorry for my english and thanks for this script. It´s fantastic. Ok, my question, ¿is there any form to acces to part of the read_array?.
If i want to read the data of a tag like N30_VIT wich has a length of 255 and i only need to read the position from 30 to 60 i must to read from 0 to 60 at least.

It will be fine that we can acces directly to the position and lenght that we need.

Something like this:

read_array_len(N30_VIT, 30, 60).

Thanks for all.

Error when reading string

Error I am getting,
pycomm.cip.cip_base.DataError: local variable 'data_type' referenced before assignment.

I don't see it where the variable 'data_type' is referred before a it is assigned. Also the code throws the error above once I run it, but works fine when I try to run it again.

Thank you.

Concurrent connections on L33ER

Using two programs that both connect to L33ER causes a timeout error on read_tags().
Code:
from abpycomm.ab_comm.clx import Driver as ClxDriver
from time import sleep
PLC_IP = '192.168.100.110'
driver = ClxDriver()
driver.open(PLC_IP)
tag = ['MANUAL_LT']
for i in range(100):
print(driver.read_tag(tag))
sleep(.25)

ERROR
Traceback (most recent call last):
File "", line 2, in
File "abpycomm/ab_comm/clx.py", line 405, in read_tag
addr_data=self._target_cid,
File "/usr/local/lib/python2.7/dist-packages/pycomm/cip/cip_base.py", line 590, in send_unit_data
self._receive()
File "/usr/local/lib/python2.7/dist-packages/pycomm/cip/cip_base.py", line 770, in _receive
raise CommError(e)
pycomm.cip.cip_base.CommError: timed out

Compatibility with cpppo

Hi,

"cpppo" (https://github.com/pjkundert/cpppo) is a very cool python library that among other things can simulate a PLC locally. This is quite useful for testing without needing PLC hardware, and I've used it with other client libraries in the past with success. But somehow it does not play well with pycomm.

Here's the output of running a cpppo server and then connecting locally with pycomm from another process. The corresponding pycomm code is below.

Now I can't tell if this is an issue with pycomm or with cpppo, but to me it looks like something is missing in the client connection. Maybe I'm just not doing it right?

$ env/bin/python -m cpppo.server.enip -v a=DINT b=DINT
09-04 17:19:40.192     7f2d82de0700 enip.srv NORMAL   main       Delaying all responses by 0.0 seconds
09-04 17:19:40.192     7f2d82de0700 enip.srv NORMAL   main       Creating tag: a=DINT[1]
09-04 17:19:40.192     7f2d82de0700 enip.srv NORMAL   main       Creating tag: b=DINT[1]
09-04 17:19:40.192     7f2d82de0700 root     NORMAL   main       EtherNet/IP Simulator: ('', 44818)
09-04 17:19:40.193     7f2d82de0700 network  NORMAL   server_mai enip_srv server PID [21011] running on ('', 44818)
09-04 17:19:40.193     7f2d82de0700 network  NORMAL   server_mai enip_srv server PID [21011] responding to external done/disable signal
09-04 17:21:48.995     7f2d806b2700 enip.srv NORMAL   enip_srv   EtherNet/IP Server enip_54710 begins serving peer ('127.0.0.1', 54710)
09-04 17:21:49.005     7f2d806b2700 enip.lgx NORMAL   setup                         Logix.a             DINT[   1] == 0 Attribute   1 added
09-04 17:21:49.006     7f2d806b2700 enip.lgx NORMAL   setup                         Logix.b             DINT[   1] == 0 Attribute   2 added
09-04 17:21:49.026     7f2d806b2700 enip.dev ERROR    request    EtherNet/IP CIP error at 0 total bytes:
"N\x02 \x06$\x01\n\x05'\x04\t\x10\t\x10\x19q\x03\x00\x01\x00 \x02$\x01"
-^ (byte 0)

09-04 17:21:49.027     7f2d806b2700 enip.dev NORMAL   request    (0x9999,  1) UCMM Command 0x006f SendRRData failed with Exception: ( dfa_post.( select ) ) sub-machine terminated in a non-terminal state
Request: {
    "enip.status": 0, 
    "enip.sender_context.input": "array('c', '_pycomm_')", 
    "enip.session_handle": 2518093524, 
    "enip.length": 40, 
    "enip.CIP.send_data.interface": 0, 
    "enip.CIP.send_data.CPF.count": 2, 
    "enip.CIP.send_data.CPF.item[0].length": 0, 
    "enip.CIP.send_data.CPF.item[0].type_id": 0, 
    "enip.CIP.send_data.CPF.item[1].length": 24, 
    "enip.CIP.send_data.CPF.item[1].unconnected_send.request.input": "array('c', \"N\\x02 \\x06$\\x01\\n\\x05'\\x04\\t\\x10\\t\\x10\\x19q\\x03\\x00\\x01\\x00 \\x02$\\x01\")", 
    "enip.CIP.send_data.CPF.item[1].type_id": 178, 
    "enip.CIP.send_data.timeout": 10, 
    "enip.command": 111, 
    "enip.options": 0, 
    "addr": [
        "127.0.0.1", 
        54710
    ]
}
Traceback (most recent call last):
  File "/home/johfor/kits/cpppo/server/enip/device.py", line 990, in request
    CM.request( unc_send )
  File "/home/johfor/kits/cpppo/server/enip/device.py", line 1510, in request
    for i,(m,s) in enumerate( machine.run( path='request', source=source, data=data )):
  File "/home/johfor/kits/cpppo/automata.py", line 645, in run
    source=source, machine=machine, path=path, data=data, ending=ending ):
  File "/home/johfor/kits/cpppo/automata.py", line 1291, in delegate
    raise NonTerminal( "%s sub-machine terminated in a non-terminal state" % ( self ))
NonTerminal: ( dfa_post.( select ) ) sub-machine terminated in a non-terminal state

09-04 17:21:49.028     7f2d806b2700 enip.srv WARNING  enip_srv   Expected EtherNet/IP response encapsulated message; none found
09-04 17:21:49.028     7f2d806b2700 enip.srv WARNING  enip_srv   Session ended (server EtherNet/IP status: 0x08 == 8)
09-04 17:21:49.029     7f2d806b2700 enip.srv NORMAL   enip_srv   enip_54710 done; processed   2 requests over    92 bytes/   92 received (0 connections remain)

IPython:

In [13]: c = ClxDriver()
In [14]: c.open("127.0.0.1")
Out[14]: True

Doing something else at this point, like reading a tag, results in a "CommError: socket connection broken.".

Question: Can this library be used to test generic CIP required objects using get/set attributes?

Is this support for Explicit and Implicit messaging both?
If I want to get any attribute id for any specif objects shown below, can i do that using this library?

0x01 | Identity Objects | CIP Required Object
0x04 | Assembly Object | CIP object for Drive Device
0x06 | Connection Manager Object | Communication Object
0XF4 | Port object | Communication Object
0xA0 | Vendor Parameters Object | Vendor Specific
0xF5 | TCP/IP Interface Object | CIP Required Object
0x02 | Message Router Object | Communication Object
0xF4 | Port Object | Communication Object
0xF6 | Ethernet Link Object | CIP Required Object

If yes, please give a code snippet using your library for the same.

CPU Slot static variable

CIP_Base has a static attribute, 'cpu slot', set to 0. In many cases, the PLC you wish to communicate with is not in slot 0.

Adding an optional parameter to your open:
def open(self, ip_address, plcslot = 0, direct_connection=False):

... and then overwriting that static attribute a few lines into the routine...

self.attribs['cpu slot'] = plcslot

seems to correct the issue. No changes required to working code, but, if you need to specify a different slot, you can do so when you open the connection:

if c.open('192.168.20.50', 3):

[email protected]

Problem to write tags Micrologix 1100

Hi all,

i'm trying to write the tag N7:2/1 with 1 or 0, but everytime i get an different error:

from pycomm.ab_comm.slc import Driver as SlcDriver

plc = SlcDriver()
#Open communication to PLC
if plc.open("192.168.0.1"):
   #Write tag
   plc.write_tag(('N7:2/1', 1, 'BOOL'))
   #Read tag
   print (plc.read_tag("N7:2/1"))
#Close communication when done
plc.close()

and returns the error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-114-a1059e9943b1> in <module>
      5 if plc.open("192.168.0.1"):
      6    #Write tag
----> 7    plc.write_tag(('N7:2/1', 1, 'BOOL'))
      8    #Read tag
      9    print (plc.read_tag("N7:2/1"))

TypeError: write_tag() missing 1 required positional argument: 'value'

I already gave the 'value' argument, another one that shows up is about '3 arguments required, you gave 4' even I giving exactly 3.
can someone help me?

Problem with Micrologix1100

I tried the example "test_slc_only.py", but I am getting this error "Traceback (most recent call last):
File "test_slc_only.py", line 13, in
if c.open('192.168.0.9'):
File "/usr/local/lib/python2.7/dist-packages/pycomm/cip/cip_base.py", line 843 , in open
raise CommError(e)
pycomm.cip.cip_base.CommError: Socket timeout during connection."

I wonder if you tried this example on Micrologix 1100?

How can I do an "atomic" bit write using the write_tag()

See Wiki page for my "Read-Modify-Write" code.

When multiple clients are connected to a PLC, and the "bit write" method is accomplished at the application layer, by doing "Read-Modify-Write" operation, then there is a good possibility the PLC bit write register will become corrupted, as there are no lock semaphore across connected clients.

Thus the low-level-driver (LLD) needs to support the AB bit write.

Question: Does pycomm support device bit write ?

SLC connection

Not an issue but cannot understand how to connect retrieve data from Micrologix, CLX works a treat but unsure of SLC address format for tag read. Great work, this is a very tidy and simple implementation for a novice coder like me.
Chris.

CommError: must be str, not bytes

I tried test_clx_comm.py example to connect a network PLC. But I get an error like this:

TypeError Traceback (most recent call last)
/opt/conda/lib/python3.6/site-packages/pycomm/cip/cip_base.py in build_header(self, command, length)
616 h = command # Command UINT
--> 617 h += pack_uint(length) # Length UINT
618 h += pack_dint(self._session) # Session Handle UDINT

TypeError: must be str, not bytes

During handling of the above exception, another exception occurred:

CommError Traceback (most recent call last)
/opt/conda/lib/python3.6/site-packages/pycomm/cip/cip_base.py in open(self, ip_address)
785 self.attribs['ip address'] = ip_address
--> 786 if self.register_session() is None:
787 self._status = (13, "Session not registered")

/opt/conda/lib/python3.6/site-packages/pycomm/cip/cip_base.py in register_session(self)
634 self._session = 0
--> 635 self._message = self.build_header(ENCAPSULATION_COMMAND['register_session'], 4)
636 self._message += pack_uint(self.attribs['protocol version'])

/opt/conda/lib/python3.6/site-packages/pycomm/cip/cip_base.py in build_header(self, command, length)
623 except Exception as e:
--> 624 raise CommError(e)
625

CommError: must be str, not bytes

During handling of the above exception, another exception occurred:

CommError Traceback (most recent call last)
in
----> 1 c.open('10.21.150.175')

/opt/conda/lib/python3.6/site-packages/pycomm/cip/cip_base.py in open(self, ip_address)
791 except Exception as e:
792 #self.clean_up()
--> 793 raise CommError(e)
794
795 def close(self):

CommError: must be str, not bytes

Few weeks back, I was able to connect and read values. But now Clueless!

Micrologix , unpropriate value when reading L tag

I use this great software to read values from micrologix, when reading bool tags like B3:3/6 everything seems to be allright and i get 0/1 value.
But when i try to read tags starting from L like L9:0 the replay is "L" but should be digits?

Could anyone knows what am I doing wrong , or why i get letter from Long type instead value with digits ?

read/write UDT

Am I correct that access to UDT's is not yet available? If it is available, could you supply an example?

Micrologix 1200

So I am able to successfully read/write tags to a Micrologix 1400 over Ethernet/IP, but now I am in a situation where I need to read/write tags on a Micrologix 1200.

Can this work using a USB to Allen Bradley serial cable typically used on the PLC?

I would plug the USB end of that cable into a USB type a female to RJ45 male adapter and then plug it into my ethernet.

I'm guessing there is no chance this will work but its the only option for reading/writing tags with this library on a MicroLogix 1200 that I can think of.

Perhaps I'm just not understanding things though. Is it not possible at all to work on a MicroLogix 1200?

Multiple Connections

I am using this library to periodically read tag values. If I have more than one instance of the library running, one of the instances seem to not be able to read if they read the tag at the same time. I'm wondering whether this has anything to do with unique connection ID's or something like that? I have tried this with a single client or with different devices.

Also, this package has been very useful! Thank you for making this.

method close() may not __sock.close() on exception

I am not sure if this is a bug, but I think so.

The close() method may not close the socket when an exception occurs before the __sock.close() call
Maybe this code is better:

def close(self):
    """
    socket close
    :return: true if no error otherwise false
    """
    errStr = ''
    try:
        if self._target_is_connected:
            self.forward_close()
        if self._session != 0:
            self.un_register_session()

    except Exception as e:
        print "Error on close() -> session Err: %s" % e.message
        # http://stackoverflow.com/questions/7075200/converting-exception-to-a-string-in-python-3
        errStr += "Error {0}".format(str(e.args[0])).encode("utf-8")

    # %GLA must do a cleanup __sock.close()
    try:
        if self.__sock:
            self.__sock.close()

    except Exception as e:
        print "close() -> __sock.close Err: %s" % e.message
        errStr += "; Error {0}".format(str(e.args[0])).encode("utf-8")

    self.clean_up()

    if errStr:
        raise CommError(errStr)

Control Logix 5573 returns "None"

Communication is happening with the Control logix 5573 is in slot 1 with EN2TR module is in slot 0 where the cable is connected to EN2TR Module Port 1

Code Executed

from pycomm.ab_comm.clx import Driver as ClxDriver
import logging

if __name__ == '__main__':
    logging.basicConfig(
        filename="ClxDriver.log",
        format="%(levelname)-10s %(asctime)s %(message)s",
        level=logging.DEBUG
    )
    c = ClxDriver()
    if c.open('192.168.1.4',1):
        a = c.read_tag('Value_a')
        print(a)
        c.close()

> output was " None "

where i did the mistake ???

Connecting to Productivity PLC via pycomm

I'm trying to connect to a productivity plc with pycomm using the TCP/IP Protocol using the following code:

from pycomm.ab_comm.slc import Driver as SlcDriver
c = SlcDriver()
c.open("[MY IP ADDRESS]")

I keep getting "[Errno 111] Connection Refused".

My first question is whether or not I can use pycomm for the productivity PLC. Is the pycomm library only good for Alley Bradley PLC's?
If it is only good for AB PLC's, is there another module such as cpppo or pymodbus that would be better suited for this application?

self.forward_open()

Hey,
I am trying to run test_slc_only.py but I am getting an error in line
build_common_packet_format(DATA_ITEM['Unconnected'], ''.join(forward_open_msg),ADDRESS_ITEM['UCMM'],)):
Can you please help me in resolving it.

Re: pycomm.ab_comm.clx & Strings

Hi ruscito

On L plates here with python and github, got this up and running in no time. Firstly nice job straight up!, big thanks.

I have a query - I'm reading/writing DINT, REAL, DWORD no worries but bombing out reading STRINGS. Any thoughts

kindRegards
Mick

read_array() appends to _tag_list

The function read_array() in clx.py append continuisly to self._tag_list, so the list grows continiusly!

here a patch:

diff --git a/pycomm/ab_comm/clx.py b/pycomm/ab_comm/clx.py
index 1ccd910..e686bc3 100644
--- a/pycomm/ab_comm/clx.py
+++ b/pycomm/ab_comm/clx.py
@@ -431,6 +431,7 @@ class Driver(Base):
         self._byte_offset = 0
         self._last_position = 0

+        self._tag_list = []
         while self._byte_offset != -1:
             rp = create_tag_rp(tag)
             if rp is None:

Port to 3.5

I tried to get this working on 3.5 and came across a few issues. I started making "fixes" but having not got any documentation to work off I'm flying blind. Does anyone have any information I can have to port this over?

Also I tried to get a string back on a 2.7 build I have but it didn't seem to work. I'd like to take this further also.

Great work so far though!

Time out is not changing

I would like to set the time out so that if the network is down, I can quickly detect and try to reconnect.
I set the time out as following:

c = ClxDriver()
c.attribs['timeout']=1

But it does not work. If the network is down and if I want to read or write to the PLC, it takes 10 seconds (default value) and then it fails. Can some one please advise?

Thank you in advance

Should it work with AB Emulator 5000?

Hi,

Greats for the library, I´m trying to make it work with RSLogixEmulator 5000 running in remote machine over ethernet.

Should it work like that or only with real hardware?

When reading a tag I´m getting the error:

"pycomm.cip.cip_base.CommError: can only concatenate str (not "bytes") to str"

Strings

Is anyone having trouble retrieving strings from pycomm ?

Large Array Read and Write Speed

For an array of length 100, it takes approximately 3 ms to read/write. Proportionally, for an array of length 1000 it takes 30 ms which is way to long for my use case. I was hoping reading an array of 1000 is not 10 times slower than reading an array of 100. One transaction should be normally faster because of less overhead. Can you please advice?

"Timed out" Issue

I am using the example for Micrologix PLC. After a few minutes, I am getting "timed out". Any ideas what potentially can cause this "timed out"?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.