DateTimePicker

DateTimePicker (Date/Time Selector)

The DateTimePicker is a control object that provides a standard, calendar-based interface for the operator to select a date, a time, or both.

This object prevents users from entering date/time data as free text, thereby eliminating format inconsistencies (e.g., 25/12/2023 vs. 12-25-2023) and invalid dates (e.g., “February 30th”).

Key Use Cases
  • Reporting: Selecting a “Start Date” and “End Date” for a report.
  • Historical Data: Selecting a specific date/time range to query past alarm or trend records.
  • Scheduling: Programming when a process (e.g., a recipe) will start.
Basic Configuration and Operation

1. Defining the Format (Advanced Panel) The object’s primary behavior is determined by the Format property in the “Advanced” panel. This setting defines whether the object displays a date, a time, or a custom combination.

2. Binding the Value (Properties Panel) The date/time value selected by the operator is linked to a SCADA tag via the Value property in the Properties panel.

  • Note: This tag is typically of the DATETIME data type.

Properties Panel – Key Properties

Value

  • Tag
    • Function: This provides a two-way link connecting the date and time information selected by the operator to a tag.
    • Read: If the linked tag is changed by a script or the PLC, the picker automatically updates to display that new date.
    • Write: If the operator selects a new date from the calendar (e.g., “25.12.2023”), this value is written to the linked tag.

Advanced Panel – Key Properties

Format

  • Determines the type of the object.
  • Long: Displays the date in a long format (e.g., “Tuesday, November 11, 2025”).
  • Short (Recommended for SCADA): Displays the date in a short, regional format (e.g., “11.11.2025”).
  • Time: Used to display time only (e.g., “10:05:30”).
  • Custom: Allows you to use a special format defined in the CustomFormat property.

CustomFormat

  • This field becomes active when the Format property is set to Custom.
  • Example: You can type yyyy-MM to show only the year and month. To show both date and time, a format like yyyy-MM-dd HH:mm:ss can be defined.

ShowUpDown

  • This is useful when the Format property is set to Time.
  • If set to True, it displays numeric arrows (spin box) to increase or decrease the hour/minute instead of the standard calendar drop-down arrow.

MinDate / MaxDate

  • Restricts the date range the operator is allowed to select.
  • Use Case: By binding the MinDate property of an “End Date” selector to the value of a “Start Date” selector, you can prevent the operator from choosing an end date that occurs before the start date.

Common Usage Examples

Example 1: Selecting a Start Date for a Report

  1. Add a DateTimePicker to the screen.
  2. Set Advanced -> Format to Short.
  3. Bind Properties -> Value -> Tag to a DATETIME tag named Report_Start_Date.

Result: When the operator selects “15.10.2025” from the calendar, the value of the Report_Start_Date tag updates with this date.

Example 2: Setting a Process Start Time

The operator is required to select only the time.

  1. Add a DateTimePicker to the screen.
  2. Set Advanced -> Format to Time.
  3. Set Advanced -> ShowUpDown to True (to display arrows instead of a calendar).
  4. Bind Properties -> Value -> Tag to the Process_Start_Time tag.

Result: The operator can select the time (e.g., 14:30:00) using the arrows, and this value is written to the tag.

Leave a Reply