You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old October 18th, 2017, 05:40 AM   #1
Ones_Zeros
Member
United States

Ones_Zeros is offline
 
Join Date: Feb 2014
Location: at work
Posts: 163
Question Time script

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 by Ones_Zeros; October 18th, 2017 at 05:43 AM.
  Reply With Quote
Old October 18th, 2017, 09:03 PM   #2
DaveW
Member
United States

DaveW is offline
 
Join Date: Apr 2005
Location: SoCal
Posts: 351
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.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
[ControlLogix] Local time on PLC says PDT, but hour is +7 defcon.klaxon LIVE PLC Questions And Answers 3 May 9th, 2016 07:35 PM
Very basic ladder logic question imkzru LIVE PLC Questions And Answers 19 July 29th, 2008 03:49 PM
Setting HMI Time from VB Script theNoob LIVE PLC Questions And Answers 8 June 4th, 2008 04:37 AM
Timer Base bioplc LIVE PLC Questions And Answers 9 August 25th, 2005 01:59 PM
Electronics Questions peavey_wolfgang_2000 LIVE PLC Questions And Answers 4 May 23rd, 2005 08:05 PM


All times are GMT -5. The time now is 04:33 AM.


.