Can someone tell me whats wrong with my code, whenever i delete something, a new error pops up the code is a dumpster fire to be honest. tkinter is having errors with simple task, most of the pip installs aren't required, and the code doesn't connect to the plc. The task the code is supposed to connect to the plc and give the status of the tag into microsoft SQL server management Studio. Would very much appreciate any ideas or help. Thanks. import threading import tkinter as tk from tkinter import ttk import datetime import time import logging import pyodbc from pylogix import PLC import matplotlib.pyplot as plt from matplotlib.dates import DateFormatter import tkinter as tk import threading # ... other necessary imports ... # Define global variables root = None tree = None plc_thread = None running = False # Flag to control the PLC reading thread def read_and_write_plc_data(): """Read data from PLC and write to database.""" global runn
A site where you can share knowledge