PLC.py 587 Bytes
from common.models import *
from .Device import DeviceController
from enum import Enum
import configparser

CONFIG_FILE = "../simulators/socket_config.ini"

class PLCController(DeviceController):

    def __init__(self):
        super().__init__()

        self.set_msgs = [
        ]

        self.get_msgs = [
            "STATUS",
        ]

        self.do_msgs = [
        ]

        config = configparser.ConfigParser()
        config.read(CONFIG_FILE)

        self.ip = config.get("PLC", "ip")
        self.port = int(config.get("PLC", "port"))

        print(self.ip, self.port)