07-20-2023, 12:01 AM
(This post was last modified: 07-20-2023, 12:02 AM by iliaslamprou.)
Hi,
I think it is not easy.
The easier way to do this is to use a "Counter".
But you don't describe to us how the variable will be on.
Add a switch to enable the variable V2. let's say this is the ON-OFF variable you want to send to PLC
1. Open the "Select Widget" window. Add a "Pop-Up Value Editor". Select the variable Emulator V0
2. Add a widget "Button".
On the button settings select the type "Button".
You don't need to select a Variable.
Add the "Action": "Show PopUp window". Select the "Value editor".
Now every time you click on the button the "Value editor" will be displayed.
Using the "Value editor" you can send a value to the Variable V0.
You can see this variable if you add a "Value Display"
3. Add a "Counter"
Input: V0
True if input >0
Time Variable: V1
4. Go to "Script add tools". Add the script "If Then"
if V1>V0 then Send the value 0 to Emulator V0
This function will reset the counter.
5. Go to "Script add tools". Add the script "If Then"
if V1>V0 then Send the value 0 to V2 (PLC)
This function will disable the your output
You don't describe to us how the variable will be off. Click the button to enable the output
or you can do this if you want to enable it every time you insert a new time:
6. Go to "Script add tools". Add the script "If Then"
if V0>0 then Send the value 1 to V2 (PLC)
Please check this tutorial.
https://virtuino.com/downloads/videos/auto_off.mov
I think it is not easy.
The easier way to do this is to use a "Counter".
But you don't describe to us how the variable will be on.
Add a switch to enable the variable V2. let's say this is the ON-OFF variable you want to send to PLC
1. Open the "Select Widget" window. Add a "Pop-Up Value Editor". Select the variable Emulator V0
2. Add a widget "Button".
On the button settings select the type "Button".
You don't need to select a Variable.
Add the "Action": "Show PopUp window". Select the "Value editor".
Now every time you click on the button the "Value editor" will be displayed.
Using the "Value editor" you can send a value to the Variable V0.
You can see this variable if you add a "Value Display"
3. Add a "Counter"
Input: V0
True if input >0
Time Variable: V1
4. Go to "Script add tools". Add the script "If Then"
if V1>V0 then Send the value 0 to Emulator V0
This function will reset the counter.
5. Go to "Script add tools". Add the script "If Then"
if V1>V0 then Send the value 0 to V2 (PLC)
This function will disable the your output
You don't describe to us how the variable will be off. Click the button to enable the output
or you can do this if you want to enable it every time you insert a new time:
6. Go to "Script add tools". Add the script "If Then"
if V0>0 then Send the value 1 to V2 (PLC)
Please check this tutorial.
https://virtuino.com/downloads/videos/auto_off.mov