Time script

Ones_Zeros

Member
Join Date
Feb 2014
Location
at work
Posts
367
Hey guys,
Working with Wonderware to write a time
Script that I’m using for a calculation.

How is best way to do this?

For example if I write it like this my time
Script doesn’t change.

Script triggering by condition $Minute

If $hour == 22 AND $Minute == 15
Then timescript = 22.25

Else
If $Hour == 22 AND $Minute == 30
Then timescript = 22.50

Else
If $Hour == 22 AND $Minute == 45
Then timescript =22.75

Does this look right? For some reason I can’t get
The values to 22.25,22.50,22.75 to
Populate in my memory real tag.

I appreciate the help!
 
Last edited:
Try putting parenthesis around your conditions. Without them, your logic would scan like this ((($hour == 22) AND $Minute) == 15).

Also, you probably already know this but the script wont validate if you don't have ";" at the end of the timescripts statements and you need endif's.
 

Similar Topics

Hello, I am learning to create shapes and VB Scripts in HMIWeb Display Builder. I wanted to change color of my rounded rectangle by script. I...
Replies
0
Views
71
Hello, I have a quick question. I have been using scripts to change the color of buttons. The reason, I am usually using multiple hmiruntime.tags...
Replies
1
Views
81
Hi All, I'm keep getting double quotes in between selections rather than the beginning and the end. Here's the script and please help to find...
Replies
7
Views
773
Dear guys, I am not a programmer but I can do simple things myself. I'm stuck with the following. if I want to extract a value from my rx3i...
Replies
46
Views
4,653
Hi guys, I'm busy on the migration of old 3G/RS232 modems to 4-5G / Ethernet modems on about 200 pumping stations across the country. To...
Replies
0
Views
426
Back
Top Bottom