Reference programming TIME1 := 15ms; (* T# is missing *) TIME1 := t#4ms13d; (*Incorrect order of entries*) 7.3.1.3 DATE constants These constants can be used to enter dates. A DATE constant is declared beginning with a "d", "D", "DATE" or "date" followed by "#". You can then enter any date with format Year-Month-Day. Examples: DATE#1996-05-06 d#1972-03-29 7.3.1.4 TIME_OF_DAY constants Use this type of constant to store times of the day. A TIME_OF_DAY declaration begins with "tod#", "TOD#", "TIME_OF_DAY#" or "time_of_day#" followed by a time with the format: Hour:Minute:Second. You can enter seconds as real numbers or you can enter fractions of a second. Examples:
TIME_OF_DAY#15:36:30.123 tod#00:00:00 7.3.1.5 DATE_AND_TIME constants Date constants and the time of day can also be combined to form so-called DATE_AND_TIME constants. DATE_AND_TIME constants begin with "dt#", "DT#", "DATE_AND_TIME#" or "date_and_time#". Place a hyphen after the date followed by the time. Examples: DATE_AND_TIME#1996-05-06-15:36:30 dt#1972-03-29-00:00:00 7.3.1.6 Number constants Number values can appear as binary numbers, octal numbers, decimal numbers and hexadecimal numbers. If an integer value is not a decimal number, you must write its base followed by the number sign (#) in front of the integer constant.
The values for the numbers 10-15 in hexadecimal numbers will be represented as always by the letters A-F. You may include the underscore character within the number. Examples: 14 (Decimal Number) 2#1001_0011 (Binary Number) 8#67 (Octal Number) 16#A (Hexadecimal Number) These number values can be from the variable types BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL or LREAL. Implicit conversions from "larger" to "smaller" variable types are not permitted. This means that a DINT variable cannot simply be used as an INT variable. You must use the type conversion functions from to be able to do this.
7.3.1.7 REAL/LREAL constants REAL and LREAL constants can be given as decimal fractions and represented exponentially. Use the standard American format with the decimal point to do this. Example: TX1200 214 Version: 1.3