pjkundert / cpppo

Communications Protocol Python Parser and Originator -- EtherNet/IP CIP
https://hardconsulting.com/products/6-cpppo-enip-api
Other
340 stars 112 forks source link

Unable To Record Tag History #82

Open Yuvaraj-22 opened 4 years ago

Yuvaraj-22 commented 4 years ago

Hi Perry I tried to take the log of tag history but log file some_file.hst is not updating After that i have done the below modifications in files.py

def _append( self, msg, encoding=None ):
    """Appends the raw msg str (which should contain a newline) to the file (open if
    necessary).  Raises an exception on any failure.

    The default encoding is 'ascii'; no non-ASCII UTF-8 symbols allowed in the provided string.

    """
    if not self.f:
        assert self.open(), "Could not open file %s for writing" % self.path
    self.f.write( msg.encode( encoding or 'ascii' ))
    self.f.flush()

$ python -m cpppo.server.enip.historize some_file.hst SCADA=INT[10] $ python -m cpppo.server.enip.client 'SCADA[0-3]=0, 1, 2, 3'

Now I am getting Tag logs