<gh_stars>0
# ***************************** LOGS ********************************** #
# Importing custom Utility modules
from utility.logger import MyLogger
log = MyLogger("main") # Logger
# ********************************************************************* #

# Import essential modules
import time
from threading import Thread
# Importing custom PLC modules
from tools.pilc import step7

if __name__ == "__main__":
	# ******************************* PLC ********************************* #
    try:
        log.info("Starting PLC . . .")
        Plc = step7() # Launching PLC connection script
        log.info("PLC [OK]")
    except Exception as e:
        Plc = None
        log.exception(str(e))
        log.warning("PLC [ERROR]")
	# ********************************************************************* #

    try:
        Plc_Thread = Thread(target=Plc.startLoop, args=()) # PLC loop
        Plc_Thread.start()
    except Exception as e:
        log.exception("loop.plc" + str(e))
        
    log.info("PROGRAM STARTED")
    while 1: # Keep alive script
        time.sleep(1000)
# ***************************** LOGS ********************************** #
# Importing custom Utility modules
from utility.logger import MyLogger
log = MyLogger("main") # Logger
# ********************************************************************* #

# Import essential modules
import time
from threading import Thread
# Importing custom PLC modules
from tools.pilc import step7

if __name__ == "__main__":
	# ******************************* PLC ********************************* #
    try:
        log.info("Starting PLC . . .")
        Plc = step7() # Launching PLC connection script
        log.info("PLC [OK]")
    except Exception as e:
        Plc = None
        log.exception(str(e))
        log.warning("PLC [ERROR]")
	# ********************************************************************* #

    try:
        Plc_Thread = Thread(target=Plc.startLoop, args=()) # PLC loop
        Plc_Thread.start()
    except Exception as e:
        log.exception("loop.plc" + str(e))
        
    log.info("PROGRAM STARTED")
    while 1: # Keep alive script
        time.sleep(1000)
# ***************************** LOGS ********************************** # # Importing custom Utility modules # Logger # ********************************************************************* # # Import essential modules # Importing custom PLC modules # ******************************* PLC ********************************* # # Launching PLC connection script # ********************************************************************* # # PLC loop # Keep alive script