3

I am having a problem with Pycomm. i have two files:

  1. for reading tag in a while loop
  2. is to write value in tag

    • when reading tags, it works fine and print value in console.
    • The problem arises when i try to write value in tag while the first file is running in terminal. When i run the second file to write value, in first file console its starting to print : timed out

here is the code for first file

from pycomm.ab_comm.slc import Driver as SlcDriver

c = SlcDriver()
if c.open('192.168.46.124'):
        while (1 < 3):
            try:
                print c.read_tag('N7:0')
            except Exception as e:
                print e
                pass

and code for second file

from pycomm.ab_comm.slc import Driver as SlcDriver

c = SlcDriver()
if c.open('192.168.46.124'):
        c.write_tag('N7:1',1)

this image showing output of first file: read_plc.py

and when i write tag from second file, this happens: first file console

this happens only when simultaneous read or write operation performed.

Narpat Singh
  • 126
  • 8

1 Answers1

0

The way the SLC driver is written, you can only have one connection talking to the PLC at a time. It intercepts all the communication coming from the device, so when you fire up your second file and launch the second connection, the first connection is intercepting all the data and the second one gets nothing.