beautypg.com

Predefined variables, Month, day, year, hours, minutes, & seconds, Predefined variables -7 – Sensaphone SCADA 3000 Users manual User Manual

Page 193: Month, day, year, hours, minutes, & seconds -7

background image

16-7

Chapter 16: Programming in C

PReDeFINeD VARIABLeS

SCADA 3000’s C language has several variables that are predefined. These variables are

automatically updated with the proper information outside of the C program and cannot be

changed by the user. They include:

input year
output month
timer day
counter

day_of_week

bit

hours

ladder_variable

minutes

c_variable

seconds

alarm off
diagnostic

mONTH, DAY, YeAR, HOURS, mINUTeS, & SeCONDS

These variables represent the values from the real-time clock. They are defined as integer

type. Their internal definitions look like the following:

int year;

int month;

int day;

int day_of_week;

int hours;

int minutes;

int seconds;

Note: You do not need to define these at the beginning of your program to use

them.

Description:
YEAR—Holds the present value from 1999 to 2100.
MONTH—Holds the present value from 1 to 12.
DAY—Holds the present value from 1 to 31.
DAY OF WEEK—Holds the present value from 0(Monday) to 6(Sunday).
HOURS—Holds the present value in 24 hour time from 0 to 23.
MINUTES & SECONDS—Holds the present value from 0 to 59.

Example: This program will turn on output 0 at midnight.

main ()

{

if ((hours==23)&&(minutes==59))

{

write_uaf(output,0,0,on);

}

}