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.
 

Machine generated alternative text:
IntTimeConvertExtension Int Time Convert Extension 
Format 
Priority 
time 
inlO 
Conversion Ok true 
Time

 

As the date/time slot is a standard Niagara AbsTime value, it can be widely used in the control logic and editors.

 

Machine generated alternative text:
Num I 
N u meric Writab le 
Inio 
310119 ok 
310119.0 ok 
CurrentTime 
Cu rrentTlme 
31-Jan-1g c 
NumberTime 
Numeric Writable 
152356.0 
Inio 
In 16 
N u m berDate 
Numeric Wr 
290215 
Inio 
In 16 
Num2 
eric Write b le 
122709. ok 
122709.0 ok 
Inio 
In16 
Time 
Num3 
N u meric Writab le 
152356.0 ok 
152356.0 ok 
Inio 
Time2 
conversionOk 
Num4 
N u meric Writab le 
Inio 
Date 
conversionOk 
290215.0 ok 
280215.0 ok 
28-Feb-15

 

Created with Microsoft OneNote 2016.