beautypg.com

Pm designer operation manual – B&B Electronics WOP-2121V-N4AE - Manual User Manual

Page 451

background image

14

PM Designer Operation Manual

14-42

CHAPTER 14 USING MACROS

DATE2STR

Format

P1

= DATE2STR(P2 )

Data Type

U

Function

Converts the current system date to a string using the format specified by P2 and saves the result
in P1.

P1 (I)

The byte array that stores the result.

P2 (I/C)

Specifies the desired conversion format.

Format

P2

Value

Remark

YYMMDD

0

YY: year (00~99); MM: month(01~12); DD: day(01~31)

YYMM

1

YY, MM: same as above

YYMMMDD

2

YY: year (00~99); MMM: month(JAN~DEC); DD: day(01~31)

YYMMM

3

YY, MMM: same as above

Example 1

$U10

= DATE2STR(

0

)

/* Assume that the current system date is December 7, 2008. After this

command is executed, the byte array $U10 contains “081207”. */

Example 2

$U20

= DATE2STR(

3

)

/* Assume that the current system date is December 31, 2008. After this

command is executed, the byte array $U20 contains “08DEC”. */

TD2STR

Format

P1

= TD2STR(P2 )

Data Type

U

Function

Converts the current system time and date to a string using the format specified by P2 and saves
the result in P1.

P1 (I)

The byte array that stores the result.

P2 (I/C)

Specifies the desired conversion format.

Format

P2

Value

Remark

YYMMDD_hhmmss

0

YY: year (00~99); MM: month(01~12); DD: day(01~31)
hh: hour(00~23); mm: minute(00~59) ; ss: second(00~59)

YYMMMDD_hhmmss

1

YY, DD, hh, mm, ss: same as above
MMM: month(JAN~DEC)

YYMMDD_hhmm

2

YY, DD, hh, mm: same as above; MM: month(01~12)

YYMMMDD_hhmm

3

YY, DD, hh, mm: same as above;
MMM: month(JAN~DEC)

Example 1

$U10

= TD2STR(

0

)

/* Assume that the current system date is December 7, 2008 and the current

system time is 15:18:30. After this command is executed, the byte array $U10 contains
“081207_151830". */

Example 2

$U20

= TD2STR(

3

)

/* Assume that the current system date is December 31, 2008 and the current

system time is 13:30:00. After this command is executed, the byte array $U20 contains
“08DEC31_1330”. */