Lenze PLC Designer PLC Designer (R2-x) Instrukcja Użytkownika Strona 494

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 844
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 493
L-force | PLC Designer
IEC Operators and additional norm extending functions
492 DMS 3.2 EN 02/2011 TD29
9.9.7 DATE_TO/DT_TO Conversions
Converting from the variable type DATE or DATE_AND_TIME to a different type:
The date will be stored internally in a DWORD in seconds since Jan. 1, 1970. This value
will then be converted.
When you perform a type conversion from a larger to a smaller type, you risk losing
some information
For STRING type variables, the result is the date constant.
Examples in IL:
LD D#1970-01-01
DATE_TO_BOOL
ST b
(* Result is FALSE *)
LD D#1970-01-15
DATE_TO_INT
ST i
(* Result is 29952 *)
LD DT#1970-01-15-05:05:05
DT_TO_BYTE
ST byt
(* Result is 129 *)
LD DT#1998-02-13-14:20
DT_TO STRING
ST str
(* Result is 'DT#1998-02-
13-14:20' *)
Examples in ST:
b :=DATE_TO_BOOL(D#1970-01-01); (* Result is FALSE *)
i :=DATE_TO_INT(D#1970-01-15); (* Result is 29952 *)
byt :=DT_TO_BYTE(DT#1970-01-15-
05:05:05);
(* Result is 129 *)
str:=DT_TO_STRING(DT#1998-02-13-
14:20);
(* Result is
'DT#1998-02-13-14:20' *)
Przeglądanie stron 493
1 2 ... 489 490 491 492 493 494 495 496 497 498 499 ... 843 844

Komentarze do niniejszej Instrukcji

Brak uwag