SBC Date/Time Format Converter Extension
Dienstag, 29. Januar 2019
14:27
Purpose:
This point extension converts from a numeric value representing a date/time of a SBC PLC into a native Niagara time format that can be used in a Niagara control logic and vice versa.
NOTE: This componets requires an S-Bus driver license.
Mode of operation:
Time:
On the SBC PLC controller, the data values which uses the time format are stored as 32-bit value .
The time with 3 digits HH:MM:SS like 10 hour, 22 minutes and 45 seconds are stored like this:
102245 (in decimal)
The time with 2 digits HH:MM like 10 hour and 22 minutes are stored like this:
1022 (in decimal)
The time with 2 digits MM:SS like 22 minutes 45 seconds are stored like this:
2245 (in decimal)
Date:
For the date the values are also stored on a 32-bit value:
The date with 3 digits DD:MM:YY like 12th of October 2018 is stored like this:
181012
The date with 2 digits DD:MM like 12th of October is are stored like this:
1012 (in decimal)
Time |
|
Format |
Out / Register content |
MM:SS (10:59) |
1059 (MMSS) |
HH:MM:SS (23:53:59) |
235359 (HHMMSS) |
HH:MM (23:59) |
2359 (HHMM) |
Date |
|
Format |
Out / Register content |
DD.MM (31.12) |
1231 (MMDD) |
DD.MM.YY (31.12.18) |
181231 (YYMMDD) |
MM.YY (12.18) |
1812 (YYMM) |
Usage:
From the “honUtilityIntTime” palette, take the “Int Time Conversion” component and drag it onto a Numeric Point as a point extension.
Select the format of the desired time/date conversion.
A
date/time Slot is created that reflects the numeric value according to the
conversion selected.
Any change of the output value will be reflected there,
and any write to the date/time slot will be converted and pushed into the
In-Slot which is configured.
When
converting fom a numeric value to a date/time, any violations of the ranges will
be reflected in the "Conversion Ok" slot.
E.g. if the value for minutes
exceeds 59, it will be limited to that maximum number, and the conversion will
be flagged as false.
Range checking is done for all aspects, also days of
month and leap days.
The 2 digits of the year part are mapped to
1970..2069.
As the date/time slot is a standard Niagara AbsTime value, it can be widely used in the control logic and editors.
Created with Microsoft OneNote 2016.