The TIMESPAN and DATE type variables are not compatible with the DataEdit object which means there is no easy way to let the user enter a new value for these data types.
Sysmac does have keyboards which allow you to enter TIMESPAN or DATE types. These keyboards can be called manually via script.
Example: Modifying a TIMESPAN via script
1. Define your TIME variable on the PLC

2. Define your TIMESPAN variable mapping on the HMI

3. Create a “DataDisplay” object linked to your TIMESPAN variable

4. Create an action which triggers when the user clicks the DataDisplay. The action will call a subroutine.

5. Add the following code to your subroutine (adjust the variable name as required)
Sub GetTIMEKeypad
EditVariable( "HMITimeSpan")
End Sub
Your DataDisplay should now automatically show a keypad when pressed that allows you to edit the TIMESPAN variable.

Example: Modifying a DATE via script
DATE keypads can be generated in much the same way as Timespan keypads.
1. Define your DATE_AND_TIME variable on the PLC

2. Define your DATE variable mapping on the HMI

3. Create a “DateTime” object linked to your DATE variable

4. Create an action which triggers when the user clicks the DataDisplay. The action will call a subroutine.

5. Add the following code to your subroutine (adjust the variable name as required)
Sub GetDATEKeypad
EditVariable("HMIDate")
End Sub
Your DateTime object should now automatically show a keypad when pressed that allows you to edit the DATE.
