Skip to content

Problem to write tags Micrologix 1100 #56

@lcflorindo

Description

@lcflorindo

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions