Trigger HMI button action based on process value change

Hello everyone,

I am looking for the best method to automatically trigger an action from my HMI in TIA Portal (WinCC Comfort). My objective is the following: when a process value appears or updates on the HMI screen, I want to evaluate a specific logic condition. If the condition is true, the system should behave exactly as if the operator pressed the STOP button. If the condition is false, nothing should happen.

So far, I have tried using the process value as a kind of clock on the HMI. On each rising edge, I perform the logical check and, if the result is true, I trigger the STOP command; otherwise I do nothing. This approach works partially, but I am not fully confident that it is the best or safest method.

I would like to know what the recommended practice is in TIA Portal and WinCC for simulating a button press based on a process value. Also, would it be better to implement this logic in the PLC instead of the HMI? Any feedback or best-practice recommendations would be greatly appreciated.

Thank you in advance.
 
The problem is with your description of the task. The task has nothing to do with button presses.
You would get better answers if you had written it like this:
'How can I let the PLC know when the HMI can access a file location. This to let the PLC only start an operation when the HMI file location is accessible.'

I suggest, let the PLC increment a counter (not a bit) every time you need to make the test.
Let the HMI variable that reads the counter have an 'on change' event task of calling the script where you check for the file location.
In the script, if the file location is OK, you write the counter value to a separate return variable when the check goes OK. If the check fails you write -1 in the return variable.
In the PLC, you compare the outgoing and returning counter values. If they match, then the check was OK (set 'hmi_folder_check_ok' = true), if they do not match after a certain time you can trigger a timeout alarm (and set 'hmi_folder_check_ok' = false), if if the return value is -1 then you also trigger an alarm (and set 'hmi_folder_check_ok' = false).

NB. Add a safety that inhibits the counter to increment too quickly. If due to a program error the script trigger 100 times, it will fail and will not be able to recover without a power cycle.
 
What you have is two independent systems exchanging data with some handshaking needed.

It's not complicated, but besides what mentioned above you also need to consider how one side knows that the other side is actually responding. And what should happen if it doesn't.



That said, I'm not a fan of having the HMI and the PLC intertwined with logic.
I like the HMI to be stateless and the PLC to work with or without one or several HMIs present.

Having the PLC stop the machine because there is no USB memory/SD card in the HMI...that sounds problematic to me.
Usually production is more important than logging.
And when logging is really important (for complicance for example) then the HMI is usually often not robust and reliable enough for this task.

But sometimes you gotta do what you gotta do...
 

Similar Topics

Hello everyone, I’d like to execute exactly the same logic as the button’s Press event (press and release), but programmatically. What are your...
11
Replies
886
Views
hi, sorry if this was already asked i used the search and havent found anything similar. i have a data log defined in the historical data with a...
0
Replies
658
Views
Hi All, I am a newby to this group with only intermediate knowledge of automation. Our client has a system using a Delta DOP110is to control a...
1
Replies
699
Views
Hello ladies and gents I’ve hit a road block on a project, it’s AB for preface this is a converting line including Winder tailsealer and...
4
Replies
1,851
Views
so im not sure if what i have come up with is the proper way to accomplish what im looking to do so hopefully someone here can straighten me out...
9
Replies
4,174
Views
Top