Good morning Team,
Hopefully a simple question this morning.
I have created a toggle switch that runs a namedQuery to update a db with a simple enable or disable feature.
My question is: Is there a way to have the the script I created read the db once the screen is open in order to ensure the toggle switch is set to the correct mode, either disabled or enabled?
UPDATE storage
SET data = :data
WHERE attribute = 'Crane_6_P1_Enable'
data = self.props.label.text
category = "HMI"
source = "ASCADA Client"
usr = self.session.props.auth.user.id
message = str(usr) + " Changed Crane 2 to " + str(data)
data9 = usr
# Update Crane Mode
system.db.runNamedQuery("CFG Queries/crane_2_enable_mode",{
"data": data
})
#Update Syslog
system.db.runNamedQuery("Tables/syslog_update",{
"category": category,
"source": source,
"message": message,
"data9": data9
})