<< Click to Display Table of Contents >> Navigation: 3. Script Language > Date and Time Calculation > TCA. - Time Calculation > TCA.Add |
MiniRobotLanguage (MRL)
TCA.Add - Command
Add 2 Timestamps
Intention
Using TCA. you can easily add Timestamps in this Standard-Format:
HH:MM:SS.ddd
Hereby the
- HH is Hours (0 to 99 - not limited to 12 or 24)
- MM is the Minutes limited 59
- SS is the Seconds limited 59
- ddd is the Milliseconds limited to 999
The Format of the Milliseconds is internally rounded to 3 places by prefixing zeroes.
If you specify 00:00:23 this will be treated as 00:00:00.023
If you specify 00:00:00.023 this will be treated as 00:00:00.023
If the addition of any of the values goes beyond their limit, the Carry is added to the next higher Parameter.
' Technically the robot works with 08:09:59:098
$$LAA=08:14:59.98
' Technically the robot works with 12:00:00:002
$$LAB=12:59:5.2
TCA.Add|$$LAA|$$LAB|$$LAC
' Result is 21:14:04:100
MBX.$$LAC
ENR.
Syntax
TCA.Add|P1|P2[|P3]
Parameter Explanation
P1 - Timestamp A
P2 - Timestamp B
P3 - Variable for Result Timestamp. If omitted the result is placed on TOS.
Example
'**********************************************
' TCA. - Sample
'**********************************************
'
$$LAA=08:11:12.124
$$LAB=12:11:12.123
$$ERG=20:22:24.247
$$MSG=Teste TCA. 1
TCA.Add|$$LAA|$$LAB|$$LAC
NAT.@$$LAC|$$ERG
MBX.Result is wrong.
ELS.
MBX.Result is $$ERG
EIF.
ENR.
'**********************************************
' TCA. / IAT. - Sample
' Timeloop will produce Timestamps with an Interval
'**********************************************
'
$$TIA=08:09:59.000
$$TIB=08:10:01.000
$$LOP=$$TIA
$$INC=00:00:00.010
$$LOV=0
DOL.
TCA.Add|$$LOP|$$INC|$$LOP
PRT.Looping: $$LOP
IAT.$$LOP|$$TIB
$$LOV=1
EIF.
OOP.$$LOV
MBX.$$LOP
ENR.
Remarks
-
Limitations:
-
See also:
• DAT. - Date and Time Information (System independent)
• DTC. - Date and Time Calculation
• IDC. / NDC. - If Date Command
• CAL. - mathematical CALculation