Hi, I need to convert TOD and date to string, I have seen Siemens has a package to do that :
http://support.automation.siemens.com/W ... n/25629271
Is there any chance to have it free?
Thanks
[Source]: Function converter TOD and date to string
-
- Posts: 103
- Joined: Fri Aug 31, 2007 8:17 pm
- Location: Europe
-
- Posts: 8
- Joined: Mon Jan 24, 2011 5:32 pm
-
- Posts: 508
- Joined: Mon Jul 16, 2007 12:28 pm
- Location: Europe
Re: [?]: Function converter TOD and date to string
Hello Daniel,
I am also curious. Could you share it with us?
Best regards,
I am also curious. Could you share it with us?
Best regards,
-
- Posts: 25
- Joined: Mon Apr 07, 2008 3:53 pm
- Location: Turkey
Re: [?]: Function converter TOD and date to string
I needed same conversation several months ago. I used this code and it worked fine.
u can try this. This is just small part of code. just copy-paste code and insert month-days-years-minute.. etc
u can try this. This is just small part of code. just copy-paste code and insert month-days-years-minute.. etc
Kalle
The converted string starts from MB100 ..
Code: Select all
L bHH // hours byte in BCD-format L bHH SLW 4 OW AW W#16#F0F //Mask out rubbish OW W#16#3030 // ASCII for '0'=30h T MW100 L ':' T MB102 L bMM // the same procedure for minutes : : : T MW103
-
- Posts: 8
- Joined: Mon Jan 24, 2011 5:32 pm
Re: [?]: Function converter TOD and date to string
Sure, it's written in SCL. If you need a compiled block let me know.Umencho wrote:Hello Daniel,
I am also curious. Could you share it with us?
Best regards,
Code: Select all
FUNCTION_BLOCK FB_DT_TO_STRING
(*==============================================================================*)
(*
AUTHOR: daniel-=AT=-da.myftp.org
DATE: October 2010.
REVISION: v1.00 First edition.
NOTES:
LIMITATIONS:
DISCLAIMER: This code comes with no guarantee or warranty of any kind
and its author are not liable for any damage that its
utilization may cause.
*)
(*==============================================================================*)
KNOW_HOW_PROTECT
CONST
strZero := '0';
str2K := '20';
END_CONST
VAR
nState : INT;
fbTON : TON;
nRetVal_READ_CLK : INT;
nLen : INT;
strYearTemp : STRING[3];
strMonthTemp : STRING[3];
strDateTemp : STRING[3];
strHourTemp : STRING[3];
strMinTemp : STRING[3];
strSecTemp : STRING[3];
strMs2MSDTemp : STRING[3];
strMsLSDTemp : STRING[3];
strYear : STRING[5];
strMonth : STRING[3];
strDate : STRING[3];
strHour : STRING[3];
strMin : STRING[3];
strSec : STRING[3];
strMs2MSD : STRING[3];
strMsLSD : STRING[3];
strDateAndTime : STRING[23];
tempDT : DT;
tempPointer AT tempDT : STRUCT // Split 64 bits DT VAR into BYTE
BYTE0 : BYTE; // Year
BYTE1 : BYTE; // Month
BYTE2 : BYTE; // Date
BYTE3 : BYTE; // Hour
BYTE4 : BYTE; // Min
BYTE5 : BYTE; // Sec
BYTE6 : BYTE; // 2 MSD of ms
BYTE7 : BYTE; // 4 MSB = LSD of ms, 4 LSB = day of week
END_STRUCT;
END_VAR
VAR_INPUT
bIN_ExecOneShoot : BOOL; // Creates a new string on rising edge. USE ONLY ONE OF THE EXEC INPUTS
nIN_ExecTimeInterval : REAL; // Creates a new string at given time interval. USE ONLY ONE OF THE EXEC INPUTS
bIN_ExecContinuously : BOOL; // Creates a new string every cycle. USE ONLY ONE OF THE EXEC INPUTS
END_VAR
VAR_OUTPUT
strOUT_Date : STRING[10]; // STRING with the following format. YYYY-MM-DD
strOUT_Time : STRING[8]; // STRING with the following format. hh:mm:ss
strOUT_TimeMs : STRING[12]; // STRING with the following format. hh:mm:ss:uuu
strOUT_DT : STRING[19]; // STRING with the following format. YYYY-MM-DD hh:mm:ss
strOUT_DTms : STRING[23]; // STRING with the following format. YYYY-MM-DD hh:mm:ss:mmm
END_VAR
VAR_IN_OUT
END_VAR
BEGIN
CASE nState OF
0: // Exec...
IF bIN_ExecOneShoot THEN
fbTON(IN := FALSE);
nState := 10;
END_IF;
IF nIN_ExecTimeInterval > 0.0 THEN
fbTON(IN := true, PT := DINT_TO_TIME(REAL_TO_DINT(nIN_ExecTimeInterval * 1000)));
IF fbTON.Q THEN
fbTON(IN := FALSE);
nState := 10;
END_IF;
END_IF;
IF bIN_ExecContinuously THEN
fbTON(IN := FALSE);
nState := 10;
END_IF;
10: //
// Read clock
nRetVal_READ_CLK := READ_CLK(CDT := tempDT);
//////////
// Create small strings of date and time
// The ugly way of using string functions is necessary because of the limitation of 256 byte header i S7 300 CPU's
//////////
// Year
strYearTemp := INT_TO_STRING(BCD_TO_INT(tempPointer.BYTE0));
strYearTemp := DELETE(IN := strYearTemp, L := 1, P := 1);
// Fill string with a zero (0) if year < 2010
nLen := LEN(S := strYearTemp);
IF nLen = 1 THEN
strYear := CONCAT(IN1 := str2K, IN2 :=strZero);
strYear := CONCAT(IN1 := strYear, IN2 :=strYearTemp);
ELSE
strYear := CONCAT(IN1 := str2K, IN2 := strYearTemp);
END_IF;
// Month
strMonthTemp := INT_TO_STRING(BCD_TO_INT(tempPointer.BYTE1));
strMonthTemp := DELETE(IN := strMonthTemp, L := 1, P := 1);
// Fill string with a zero (0) if month < 10
nLen := LEN(S := strMonthTemp);
IF nLen = 1 THEN
strMonth := CONCAT(IN1 := strZero, IN2 := strMonthTemp);
ELSE
strMonth := strMonthTemp;
END_IF;
// Date
strDateTemp := INT_TO_STRING(BCD_TO_INT(tempPointer.BYTE2));
strDateTemp := DELETE(IN := strDateTemp, L := 1, P := 1);
// Fill string with a zero (0) if date < 10
nLen := LEN(S := strDateTemp);
IF nLen = 1 THEN
strDate := CONCAT(IN1 := strZero, IN2 := strDateTemp);
ELSE
strDate := strDateTemp;
END_IF;
// Hour
strHourTemp := INT_TO_STRING(BCD_TO_INT(tempPointer.BYTE3));
strHourTemp := DELETE(IN := strHourTemp, L := 1, P := 1);
// Fill string with a zero (0) if hour < 10
nLen := LEN(S := strHourTemp);
IF nLen = 1 THEN
strHour := CONCAT(IN1 := strZero, IN2 := strHourTemp);
ELSE
strHour := strHourTemp;
END_IF;
// Min
strMinTemp := INT_TO_STRING(BCD_TO_INT(tempPointer.BYTE4));
strMinTemp := DELETE(IN := strMinTemp, L := 1, P := 1);
// Fill string with a zero (0) if min < 10
nLen := LEN(S := strMinTemp);
IF nLen = 1 THEN
strMin := CONCAT(IN1 := strZero, IN2 := strMinTemp);
ELSE
strMin := strMinTemp;
END_IF;
// Sec
strSecTemp := INT_TO_STRING(BCD_TO_INT(tempPointer.BYTE5));
strSecTemp := DELETE(IN := strSecTemp, L := 1, P := 1);
// Fill string with a zero (0) if sec < 10
nLen := LEN(S := strSecTemp);
IF nLen = 1 THEN
strSec := CONCAT(IN1 := strZero, IN2 := strSecTemp);
ELSE
strSec := strSecTemp;
END_IF;
// 2 MSD of ms
strMs2MSDTemp := INT_TO_STRING(BCD_TO_INT(tempPointer.BYTE6));
strMs2MSDTemp := DELETE(IN := strMs2MSDTemp, L := 1, P := 1);
// Fill string with a zero (0) if < 10
nLen := LEN(S := strMs2MSDTemp);
IF nLen = 1 THEN
strMs2MSD := CONCAT(IN1 := strZero, IN2 := strMs2MSDTemp);
ELSE
strMs2MSD := strMs2MSDTemp;
END_IF;
// 2 LSD of ms
strMsLSDTemp := INT_TO_STRING(BCD_TO_INT(tempPointer.BYTE7));
strMsLSDTemp := DELETE(IN := strMsLSDTemp, L := 1, P := 1);
// Fill string with a zero (0) if < 10
nLen := LEN(S := strMsLSDTemp);
IF nLen = 1 THEN
strMsLSD := CONCAT(IN1 := strZero, IN2 := strMsLSD);
ELSE
strMsLSD := strMsLSDTemp;
END_IF;
(*
// 2 MSD of ms
strMs2MSDTemp := BYTE_TO_STRING(B := tempPointer.BYTE6);
// Fill string with a zero (0) if < 10
nLen := LEN(S := strMs2MSDTemp);
IF nLen = 1 THEN
strMs2MSD := CONCAT(IN1 := strZero, IN2 := strMs2MSDTemp);
ELSE
strMs2MSD := strMs2MSDTemp;
END_IF;
// 2 LSD of ms
strMsLSDTemp := BYTE_TO_STRING(B := tempPointer.BYTE7);
// Fill string with a zero (0) if < 10
nLen := LEN(S := strMsLSDTemp);
IF nLen = 1 THEN
strMsLSD := CONCAT(IN1 := strZero, IN2 := strMsLSD);
ELSE
strMsLSD := strMsLSDTemp;
END_IF;
*)
//////////
// Build a string with actual date and time
// The ugly way of using string functions is necessary because of the limitation of 256 byte header i S7300 CPU's
//////////
strDateAndTime := CONCAT(IN1 := strYear, IN2 := '-'); // 2008-
strDateAndTime := CONCAT(IN1 := strDateAndTime, IN2 := strMonth); // 2008-02
strDateAndTime := CONCAT(IN1 := strDateAndTime, IN2 := '-'); // 2008-02-
strDateAndTime := CONCAT(IN1 := strDateAndTime, IN2 := strDate); // 2008-02-11
strDateAndTime := CONCAT(IN1 := strDateAndTime, IN2 := ' '); // 2008-02-11
strDateAndTime := CONCAT(IN1 := strDateAndTime, IN2 := strHour); // 2008-02-11 16
strDateAndTime := CONCAT(IN1 := strDateAndTime, IN2 := ':'); // 2008-02-11 16:
strDateAndTime := CONCAT(IN1 := strDateAndTime, IN2 := strMin); // 2008-02-11 16:26
strDateAndTime := CONCAT(IN1 := strDateAndTime, IN2 := ':'); // 2008-02-11 16:26:
strDateAndTime := CONCAT(IN1 := strDateAndTime, IN2 := strSec); // 2008-02-11 16:26:50
strDateAndTime := CONCAT(IN1 := strDateAndTime, IN2 := ':'); // 2008-02-11 16:26:
strDateAndTime := CONCAT(IN1 := strDateAndTime, IN2 := strMs2MSD); // 2008-02-11 16:26:50:12
strDateAndTime := CONCAT(IN1 := strDateAndTime, IN2 := strMsLSD); // 2008-02-11 16:26:50:123
// Create output strings
strOUT_Date := LEFT(IN := strDateAndTime, L := 10); // YYYY-MM-DD
strOUT_TimeMs := RIGHT(IN := strDateAndTime, L := 12); // hh:mm:ss:mmm
strOUT_Time := LEFT(IN := strOUT_TimeMs, L := 8); // hh:mm:ss
strOUT_DT := LEFT(IN := strDateAndTime, L := 19); // YYYY-MM-DD hh:mm:ss
strOUT_DTms := strDateAndTime; // YYYY-MM-DD hh:mm:ss:mmm
nState := 20;
20: //
IF NOT bIN_ExecOneShoot OR bIN_ExecContinuously THEN
nState := 0;
END_IF;
END_CASE;
END_FUNCTION_BLOCK
-
- Posts: 56
- Joined: Sun Jul 13, 2008 10:48 am
- Location: Europe
Re: [?]: Function converter TOD and date to string
Very nice code!
-
- Posts: 103
- Joined: Fri Aug 31, 2007 8:17 pm
- Location: Europe
Re: [Source]: Function converter TOD and date to string
Hi Daniel,
Please could you compile it to awl font? Many thanks
Please could you compile it to awl font? Many thanks
-
- Posts: 8
- Joined: Mon Jan 24, 2011 5:32 pm
Re: [Source]: Function converter TOD and date to string
Hello!
Here it comes as AWL.
Here it comes as AWL.
Code: Select all
FUNCTION_BLOCK "FB_DT_TO_STRING"
TITLE =
VERSION : 0.0
VAR_INPUT
bIN_ExecOneShoot : BOOL ; //Creates a new string on rising edge. USE ONLY ONE OF THE EXEC INPUTS
nIN_ExecTimeInterval : REAL ; //Creates a new string at given time interval. USE ONLY ONE OF THE EXEC INPUTS
bIN_ExecContinuously : BOOL ; //Creates a new string every cycle. USE ONLY ONE OF THE EXEC INPUTS
END_VAR
VAR_OUTPUT
strOUT_Date : STRING [10 ]; //STRING with the following format. YYYY-MM-DD
strOUT_Time : STRING [8 ]; //STRING with the following format. hh:mm:ss
strOUT_TimeMs : STRING [12 ]; //STRING with the following format. hh:mm:ss:uuu
strOUT_DT : STRING [19 ]; //STRING with the following format. YYYY-MM-DD hh:mm:ss
strOUT_DTms : STRING [23 ]; //STRING with the following format. YYYY-MM-DD hh:mm:ss:mmm
END_VAR
VAR
nState : INT ;
fbTON : "TON";
nRetVal_READ_CLK : INT ;
nLen : INT ;
strYearTemp : STRING [3 ];
strMonthTemp : STRING [3 ];
strDateTemp : STRING [3 ];
strHourTemp : STRING [3 ];
strMinTemp : STRING [3 ];
strSecTemp : STRING [3 ];
strMs2MSDTemp : STRING [3 ];
strMsLSDTemp : STRING [3 ];
strYear : STRING [5 ];
strMonth : STRING [3 ];
strDate : STRING [3 ];
strHour : STRING [3 ];
strMin : STRING [3 ];
strSec : STRING [3 ];
strMs2MSD : STRING [3 ];
strMsLSD : STRING [3 ];
strDateAndTime : STRING [23 ];
tempDT : DATE_AND_TIME ;
END_VAR
BEGIN
NETWORK
TITLE =
SET ;
SAVE ;
= L 0.1;
L #nState;
L 0;
TAK ;
==I ;
T LW 2;
JC A7d1;
JU A7d2;
A7d1: CLR ;
A #bIN_ExecOneShoot;
JCN A7d3;
CLR ;
= #fbTON.IN;
+AR2 P#94.0;
UC "TON";
+AR2 P#8098.0;
L 10;
T #nState;
A7d3: L #nIN_ExecTimeInterval;
L 0.000000e+000;
>R ;
JCN A7d4;
SET ;
= #fbTON.IN;
L #nIN_ExecTimeInterval;
L 1.000000e+003;
*R ;
RND ;
T #fbTON.PT;
+AR2 P#94.0;
UC "TON";
+AR2 P#8098.0;
A #fbTON.Q;
JCN A7d4;
CLR ;
= #fbTON.IN;
+AR2 P#94.0;
UC "TON";
+AR2 P#8098.0;
L 10;
T #nState;
A7d4: CLR ;
A #bIN_ExecContinuously;
JCN A7d0;
CLR ;
= #fbTON.IN;
+AR2 P#94.0;
UC "TON";
+AR2 P#8098.0;
L 10;
T #nState;
JU A7d0;
A7d2: L 10;
L LW 2;
==I ;
JC A7d7;
JU A7d8;
A7d7: L DINO;
T LW 4;
TAR2 ;
+ L#1952;
T LD 6;
TAR2 LD 10;
UC "READ_CLK" {
P#L 14.0,
P#L 4.0};
LAR2 LD 10;
L LW 14;
T #nRetVal_READ_CLK;
L DIB [AR2,P#244.0];
AD DW#16#FF;
BTI ;
T LW 4;
L DINO;
T LW 14;
TAR2 ;
+ L#960;
T LD 16;
TAR2 LD 10;
UC "I_STRNG" {
P#L 4.0,
P#L 14.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#960;
T LD 6;
L 1;
T LW 14;
T LW 16;
L DINO;
T LW 18;
TAR2 ;
+ L#960;
T LD 20;
TAR2 LD 10;
UC "DELETE" {
P#L 4.0,
P#L 14.0,
P#L 16.0,
P#L 18.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#960;
T LD 6;
TAR2 LD 10;
UC "LEN" {
P#L 4.0,
P#L 14.0};
LAR2 LD 10;
L LW 14;
T #nLen;
L #nLen;
L 1;
==I ;
JCN A7d9;
L W#16#200;
T LW 4;
L W#16#202;
T LW 4;
L B#16#32;
T LB 6;
L B#16#30;
T LB 7;
L W#16#0;
T LW 14;
L DW#16#87000020;
T LD 16;
L W#16#100;
T LW 20;
L W#16#101;
T LW 20;
L B#16#30;
T LB 22;
L W#16#0;
T LW 24;
L DW#16#870000A0;
T LD 26;
L DINO;
T LW 30;
TAR2 ;
+ L#1344;
T LD 32;
TAR2 LD 10;
UC "CONCAT" {
P#L 14.0,
P#L 24.0,
P#L 30.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1344;
T LD 6;
L DINO;
T LW 14;
TAR2 ;
+ L#960;
T LD 16;
L DINO;
T LW 20;
TAR2 ;
+ L#1344;
T LD 22;
TAR2 LD 10;
UC "CONCAT" {
P#L 4.0,
P#L 14.0,
P#L 20.0};
LAR2 LD 10;
JU A7da;
A7d9: L W#16#200;
T LW 4;
L W#16#202;
T LW 4;
L B#16#32;
T LB 6;
L B#16#30;
T LB 7;
L W#16#0;
T LW 14;
L DW#16#87000020;
T LD 16;
L DINO;
T LW 20;
TAR2 ;
+ L#960;
T LD 22;
L DINO;
T LW 26;
TAR2 ;
+ L#1344;
T LD 28;
TAR2 LD 10;
UC "CONCAT" {
P#L 14.0,
P#L 20.0,
P#L 26.0};
LAR2 LD 10;
A7da: L DIB [AR2,P#245.0];
AD DW#16#FF;
BTI ;
T LW 4;
L DINO;
T LW 14;
TAR2 ;
+ L#1008;
T LD 16;
TAR2 LD 10;
UC "I_STRNG" {
P#L 4.0,
P#L 14.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1008;
T LD 6;
L 1;
T LW 14;
T LW 16;
L DINO;
T LW 18;
TAR2 ;
+ L#1008;
T LD 20;
TAR2 LD 10;
UC "DELETE" {
P#L 4.0,
P#L 14.0,
P#L 16.0,
P#L 18.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1008;
T LD 6;
TAR2 LD 10;
UC "LEN" {
P#L 4.0,
P#L 14.0};
LAR2 LD 10;
L LW 14;
T #nLen;
L #nLen;
L 1;
==I ;
JCN A7db;
L W#16#100;
T LW 4;
L W#16#101;
T LW 4;
L B#16#30;
T LB 6;
L W#16#0;
T LW 14;
L DW#16#87000020;
T LD 16;
L DINO;
T LW 20;
TAR2 ;
+ L#1008;
T LD 22;
L DINO;
T LW 26;
TAR2 ;
+ L#1408;
T LD 28;
TAR2 LD 10;
UC "CONCAT" {
P#L 14.0,
P#L 20.0,
P#L 26.0};
LAR2 LD 10;
JU A7dc;
A7db: L DW#16#10130001;
T LD 14;
L DINO;
T LW 18;
TAR2 ;
+ L#1008;
T LD 20;
L B#16#3;
T DIB [AR2,P#176.0];
L DW#16#10130001;
T LD 24;
L DINO;
T LW 28;
TAR2 ;
+ L#1408;
T LD 30;
TAR2 LD 10;
UC "BLKMOV" {
P#L 14.0,
P#L 4.0,
P#L 24.0};
LAR2 LD 10;
A7dc: L DIB [AR2,P#246.0];
AD DW#16#FF;
BTI ;
T LW 4;
L DINO;
T LW 14;
TAR2 ;
+ L#1056;
T LD 16;
TAR2 LD 10;
UC "I_STRNG" {
P#L 4.0,
P#L 14.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1056;
T LD 6;
L 1;
T LW 14;
T LW 16;
L DINO;
T LW 18;
TAR2 ;
+ L#1056;
T LD 20;
TAR2 LD 10;
UC "DELETE" {
P#L 4.0,
P#L 14.0,
P#L 16.0,
P#L 18.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1056;
T LD 6;
TAR2 LD 10;
UC "LEN" {
P#L 4.0,
P#L 14.0};
LAR2 LD 10;
L LW 14;
T #nLen;
L #nLen;
L 1;
==I ;
JCN A7dd;
L W#16#100;
T LW 4;
L W#16#101;
T LW 4;
L B#16#30;
T LB 6;
L W#16#0;
T LW 14;
L DW#16#87000020;
T LD 16;
L DINO;
T LW 20;
TAR2 ;
+ L#1056;
T LD 22;
L DINO;
T LW 26;
TAR2 ;
+ L#1456;
T LD 28;
TAR2 LD 10;
UC "CONCAT" {
P#L 14.0,
P#L 20.0,
P#L 26.0};
LAR2 LD 10;
JU A7de;
A7dd: L DW#16#10130001;
T LD 14;
L DINO;
T LW 18;
TAR2 ;
+ L#1056;
T LD 20;
L B#16#3;
T DIB [AR2,P#182.0];
L DW#16#10130001;
T LD 24;
L DINO;
T LW 28;
TAR2 ;
+ L#1456;
T LD 30;
TAR2 LD 10;
UC "BLKMOV" {
P#L 14.0,
P#L 4.0,
P#L 24.0};
LAR2 LD 10;
A7de: L DIB [AR2,P#247.0];
AD DW#16#FF;
BTI ;
T LW 4;
L DINO;
T LW 14;
TAR2 ;
+ L#1104;
T LD 16;
TAR2 LD 10;
UC "I_STRNG" {
P#L 4.0,
P#L 14.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1104;
T LD 6;
L 1;
T LW 14;
T LW 16;
L DINO;
T LW 18;
TAR2 ;
+ L#1104;
T LD 20;
TAR2 LD 10;
UC "DELETE" {
P#L 4.0,
P#L 14.0,
P#L 16.0,
P#L 18.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1104;
T LD 6;
TAR2 LD 10;
UC "LEN" {
P#L 4.0,
P#L 14.0};
LAR2 LD 10;
L LW 14;
T #nLen;
L #nLen;
L 1;
==I ;
JCN A7df;
L W#16#100;
T LW 4;
L W#16#101;
T LW 4;
L B#16#30;
T LB 6;
L W#16#0;
T LW 14;
L DW#16#87000020;
T LD 16;
L DINO;
T LW 20;
TAR2 ;
+ L#1104;
T LD 22;
L DINO;
T LW 26;
TAR2 ;
+ L#1504;
T LD 28;
TAR2 LD 10;
UC "CONCAT" {
P#L 14.0,
P#L 20.0,
P#L 26.0};
LAR2 LD 10;
JU A7e0;
A7df: L DW#16#10130001;
T LD 14;
L DINO;
T LW 18;
TAR2 ;
+ L#1104;
T LD 20;
L B#16#3;
T DIB [AR2,P#188.0];
L DW#16#10130001;
T LD 24;
L DINO;
T LW 28;
TAR2 ;
+ L#1504;
T LD 30;
TAR2 LD 10;
UC "BLKMOV" {
P#L 14.0,
P#L 4.0,
P#L 24.0};
LAR2 LD 10;
A7e0: L DIB [AR2,P#248.0];
AD DW#16#FF;
BTI ;
T LW 4;
L DINO;
T LW 14;
TAR2 ;
+ L#1152;
T LD 16;
TAR2 LD 10;
UC "I_STRNG" {
P#L 4.0,
P#L 14.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1152;
T LD 6;
L 1;
T LW 14;
T LW 16;
L DINO;
T LW 18;
TAR2 ;
+ L#1152;
T LD 20;
TAR2 LD 10;
UC "DELETE" {
P#L 4.0,
P#L 14.0,
P#L 16.0,
P#L 18.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1152;
T LD 6;
TAR2 LD 10;
UC "LEN" {
P#L 4.0,
P#L 14.0};
LAR2 LD 10;
L LW 14;
T #nLen;
L #nLen;
L 1;
==I ;
JCN A7e1;
L W#16#100;
T LW 4;
L W#16#101;
T LW 4;
L B#16#30;
T LB 6;
L W#16#0;
T LW 14;
L DW#16#87000020;
T LD 16;
L DINO;
T LW 20;
TAR2 ;
+ L#1152;
T LD 22;
L DINO;
T LW 26;
TAR2 ;
+ L#1552;
T LD 28;
TAR2 LD 10;
UC "CONCAT" {
P#L 14.0,
P#L 20.0,
P#L 26.0};
LAR2 LD 10;
JU A7e2;
A7e1: L DW#16#10130001;
T LD 14;
L DINO;
T LW 18;
TAR2 ;
+ L#1152;
T LD 20;
L B#16#3;
T DIB [AR2,P#194.0];
L DW#16#10130001;
T LD 24;
L DINO;
T LW 28;
TAR2 ;
+ L#1552;
T LD 30;
TAR2 LD 10;
UC "BLKMOV" {
P#L 14.0,
P#L 4.0,
P#L 24.0};
LAR2 LD 10;
A7e2: L DIB [AR2,P#249.0];
AD DW#16#FF;
BTI ;
T LW 4;
L DINO;
T LW 14;
TAR2 ;
+ L#1200;
T LD 16;
TAR2 LD 10;
UC "I_STRNG" {
P#L 4.0,
P#L 14.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1200;
T LD 6;
L 1;
T LW 14;
T LW 16;
L DINO;
T LW 18;
TAR2 ;
+ L#1200;
T LD 20;
TAR2 LD 10;
UC "DELETE" {
P#L 4.0,
P#L 14.0,
P#L 16.0,
P#L 18.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1200;
T LD 6;
TAR2 LD 10;
UC "LEN" {
P#L 4.0,
P#L 14.0};
LAR2 LD 10;
L LW 14;
T #nLen;
L #nLen;
L 1;
==I ;
JCN A7e3;
L W#16#100;
T LW 4;
L W#16#101;
T LW 4;
L B#16#30;
T LB 6;
L W#16#0;
T LW 14;
L DW#16#87000020;
T LD 16;
L DINO;
T LW 20;
TAR2 ;
+ L#1200;
T LD 22;
L DINO;
T LW 26;
TAR2 ;
+ L#1600;
T LD 28;
TAR2 LD 10;
UC "CONCAT" {
P#L 14.0,
P#L 20.0,
P#L 26.0};
LAR2 LD 10;
JU A7e4;
A7e3: L DW#16#10130001;
T LD 14;
L DINO;
T LW 18;
TAR2 ;
+ L#1200;
T LD 20;
L B#16#3;
T DIB [AR2,P#200.0];
L DW#16#10130001;
T LD 24;
L DINO;
T LW 28;
TAR2 ;
+ L#1600;
T LD 30;
TAR2 LD 10;
UC "BLKMOV" {
P#L 14.0,
P#L 4.0,
P#L 24.0};
LAR2 LD 10;
A7e4: L DIB [AR2,P#250.0];
AD DW#16#FF;
BTI ;
T LW 4;
L DINO;
T LW 14;
TAR2 ;
+ L#1248;
T LD 16;
TAR2 LD 10;
UC "I_STRNG" {
P#L 4.0,
P#L 14.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1248;
T LD 6;
L 1;
T LW 14;
T LW 16;
L DINO;
T LW 18;
TAR2 ;
+ L#1248;
T LD 20;
TAR2 LD 10;
UC "DELETE" {
P#L 4.0,
P#L 14.0,
P#L 16.0,
P#L 18.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1248;
T LD 6;
TAR2 LD 10;
UC "LEN" {
P#L 4.0,
P#L 14.0};
LAR2 LD 10;
L LW 14;
T #nLen;
L #nLen;
L 1;
==I ;
JCN A7e5;
L W#16#100;
T LW 4;
L W#16#101;
T LW 4;
L B#16#30;
T LB 6;
L W#16#0;
T LW 14;
L DW#16#87000020;
T LD 16;
L DINO;
T LW 20;
TAR2 ;
+ L#1248;
T LD 22;
L DINO;
T LW 26;
TAR2 ;
+ L#1648;
T LD 28;
TAR2 LD 10;
UC "CONCAT" {
P#L 14.0,
P#L 20.0,
P#L 26.0};
LAR2 LD 10;
JU A7e6;
A7e5: L DW#16#10130001;
T LD 14;
L DINO;
T LW 18;
TAR2 ;
+ L#1248;
T LD 20;
L B#16#3;
T DIB [AR2,P#206.0];
L DW#16#10130001;
T LD 24;
L DINO;
T LW 28;
TAR2 ;
+ L#1648;
T LD 30;
TAR2 LD 10;
UC "BLKMOV" {
P#L 14.0,
P#L 4.0,
P#L 24.0};
LAR2 LD 10;
A7e6: L DIB [AR2,P#251.0];
AD DW#16#FF;
BTI ;
T LW 4;
L DINO;
T LW 14;
TAR2 ;
+ L#1296;
T LD 16;
TAR2 LD 10;
UC "I_STRNG" {
P#L 4.0,
P#L 14.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1296;
T LD 6;
L 1;
T LW 14;
T LW 16;
L DINO;
T LW 18;
TAR2 ;
+ L#1296;
T LD 20;
TAR2 LD 10;
UC "DELETE" {
P#L 4.0,
P#L 14.0,
P#L 16.0,
P#L 18.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1296;
T LD 6;
TAR2 LD 10;
UC "LEN" {
P#L 4.0,
P#L 14.0};
LAR2 LD 10;
L LW 14;
T #nLen;
L #nLen;
L 1;
==I ;
JCN A7e7;
L W#16#100;
T LW 4;
L W#16#101;
T LW 4;
L B#16#30;
T LB 6;
L W#16#0;
T LW 14;
L DW#16#87000020;
T LD 16;
L DINO;
T LW 20;
TAR2 ;
+ L#1696;
T LD 22;
L DINO;
T LW 26;
TAR2 ;
+ L#1696;
T LD 28;
TAR2 LD 10;
UC "CONCAT" {
P#L 14.0,
P#L 20.0,
P#L 26.0};
LAR2 LD 10;
JU A7e8;
A7e7: L DW#16#10130001;
T LD 14;
L DINO;
T LW 18;
TAR2 ;
+ L#1296;
T LD 20;
L B#16#3;
T DIB [AR2,P#212.0];
L DW#16#10130001;
T LD 24;
L DINO;
T LW 28;
TAR2 ;
+ L#1696;
T LD 30;
TAR2 LD 10;
UC "BLKMOV" {
P#L 14.0,
P#L 4.0,
P#L 24.0};
LAR2 LD 10;
A7e8: L DINO;
T LW 4;
TAR2 ;
+ L#1344;
T LD 6;
L W#16#100;
T LW 14;
L W#16#101;
T LW 14;
L B#16#2D;
T LB 16;
L W#16#0;
T LW 18;
L DW#16#87000070;
T LD 20;
L DINO;
T LW 24;
TAR2 ;
+ L#1744;
T LD 26;
TAR2 LD 10;
UC "CONCAT" {
P#L 4.0,
P#L 18.0,
P#L 24.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1744;
T LD 6;
L DINO;
T LW 14;
TAR2 ;
+ L#1408;
T LD 16;
L DINO;
T LW 20;
TAR2 ;
+ L#1744;
T LD 22;
TAR2 LD 10;
UC "CONCAT" {
P#L 4.0,
P#L 14.0,
P#L 20.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1744;
T LD 6;
L W#16#100;
T LW 14;
L W#16#101;
T LW 14;
L B#16#2D;
T LB 16;
L W#16#0;
T LW 18;
L DW#16#87000070;
T LD 20;
L DINO;
T LW 24;
TAR2 ;
+ L#1744;
T LD 26;
TAR2 LD 10;
UC "CONCAT" {
P#L 4.0,
P#L 18.0,
P#L 24.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1744;
T LD 6;
L DINO;
T LW 14;
TAR2 ;
+ L#1456;
T LD 16;
L DINO;
T LW 20;
TAR2 ;
+ L#1744;
T LD 22;
TAR2 LD 10;
UC "CONCAT" {
P#L 4.0,
P#L 14.0,
P#L 20.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1744;
T LD 6;
L W#16#100;
T LW 14;
L W#16#101;
T LW 14;
L B#16#20;
T LB 16;
L W#16#0;
T LW 18;
L DW#16#87000070;
T LD 20;
L DINO;
T LW 24;
TAR2 ;
+ L#1744;
T LD 26;
TAR2 LD 10;
UC "CONCAT" {
P#L 4.0,
P#L 18.0,
P#L 24.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1744;
T LD 6;
L DINO;
T LW 14;
TAR2 ;
+ L#1504;
T LD 16;
L DINO;
T LW 20;
TAR2 ;
+ L#1744;
T LD 22;
TAR2 LD 10;
UC "CONCAT" {
P#L 4.0,
P#L 14.0,
P#L 20.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1744;
T LD 6;
L W#16#100;
T LW 14;
L W#16#101;
T LW 14;
L B#16#3A;
T LB 16;
L W#16#0;
T LW 18;
L DW#16#87000070;
T LD 20;
L DINO;
T LW 24;
TAR2 ;
+ L#1744;
T LD 26;
TAR2 LD 10;
UC "CONCAT" {
P#L 4.0,
P#L 18.0,
P#L 24.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1744;
T LD 6;
L DINO;
T LW 14;
TAR2 ;
+ L#1552;
T LD 16;
L DINO;
T LW 20;
TAR2 ;
+ L#1744;
T LD 22;
TAR2 LD 10;
UC "CONCAT" {
P#L 4.0,
P#L 14.0,
P#L 20.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1744;
T LD 6;
L W#16#100;
T LW 14;
L W#16#101;
T LW 14;
L B#16#3A;
T LB 16;
L W#16#0;
T LW 18;
L DW#16#87000070;
T LD 20;
L DINO;
T LW 24;
TAR2 ;
+ L#1744;
T LD 26;
TAR2 LD 10;
UC "CONCAT" {
P#L 4.0,
P#L 18.0,
P#L 24.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1744;
T LD 6;
L DINO;
T LW 14;
TAR2 ;
+ L#1600;
T LD 16;
L DINO;
T LW 20;
TAR2 ;
+ L#1744;
T LD 22;
TAR2 LD 10;
UC "CONCAT" {
P#L 4.0,
P#L 14.0,
P#L 20.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1744;
T LD 6;
L W#16#100;
T LW 14;
L W#16#101;
T LW 14;
L B#16#3A;
T LB 16;
L W#16#0;
T LW 18;
L DW#16#87000070;
T LD 20;
L DINO;
T LW 24;
TAR2 ;
+ L#1744;
T LD 26;
TAR2 LD 10;
UC "CONCAT" {
P#L 4.0,
P#L 18.0,
P#L 24.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1744;
T LD 6;
L DINO;
T LW 14;
TAR2 ;
+ L#1648;
T LD 16;
L DINO;
T LW 20;
TAR2 ;
+ L#1744;
T LD 22;
TAR2 LD 10;
UC "CONCAT" {
P#L 4.0,
P#L 14.0,
P#L 20.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1744;
T LD 6;
L DINO;
T LW 14;
TAR2 ;
+ L#1696;
T LD 16;
L DINO;
T LW 20;
TAR2 ;
+ L#1744;
T LD 22;
TAR2 LD 10;
UC "CONCAT" {
P#L 4.0,
P#L 14.0,
P#L 20.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1744;
T LD 6;
L 10;
T LW 14;
L DINO;
T LW 16;
TAR2 ;
+ L#64;
T LD 18;
TAR2 LD 10;
UC "LEFT" {
P#L 4.0,
P#L 14.0,
P#L 16.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1744;
T LD 6;
L 12;
T LW 14;
L DINO;
T LW 16;
TAR2 ;
+ L#240;
T LD 18;
TAR2 LD 10;
UC "RIGHT" {
P#L 4.0,
P#L 14.0,
P#L 16.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#240;
T LD 6;
L 8;
T LW 14;
L DINO;
T LW 16;
TAR2 ;
+ L#160;
T LD 18;
TAR2 LD 10;
UC "LEFT" {
P#L 4.0,
P#L 14.0,
P#L 16.0};
LAR2 LD 10;
L DINO;
T LW 4;
TAR2 ;
+ L#1744;
T LD 6;
L 19;
T LW 14;
L DINO;
T LW 16;
TAR2 ;
+ L#352;
T LD 18;
TAR2 LD 10;
UC "LEFT" {
P#L 4.0,
P#L 14.0,
P#L 16.0};
LAR2 LD 10;
L DW#16#10130001;
T LD 14;
L DINO;
T LW 18;
TAR2 ;
+ L#1744;
T LD 20;
L B#16#17;
T DIB [AR2,P#66.0];
L DW#16#10130001;
T LD 24;
L DINO;
T LW 28;
TAR2 ;
+ L#528;
T LD 30;
TAR2 LD 10;
UC "BLKMOV" {
P#L 14.0,
P#L 4.0,
P#L 24.0};
LAR2 LD 10;
L 20;
T #nState;
JU A7d0;
A7d8: L 20;
L LW 2;
==I ;
JC A7e9;
JU A7d0;
A7e9: CLR ;
A #bIN_ExecOneShoot;
NOT ;
O #bIN_ExecContinuously;
JCN A7eb;
L 0;
T #nState;
A7eb: CLR ;
A7d0: CLR ;
A L 0.1;
SAVE ;
BE ;
END_FUNCTION_BLOCK
-
- Posts: 6
- Joined: Sun Dec 12, 2010 9:32 am
Re: [Source]: Function converter TOD and date to string
hello ,
I have the block , send me your email address then i will email to you.
Thanks
Jason
I have the block , send me your email address then i will email to you.
Thanks
Jason