This article will show how to use Edit-Box objects to change/assign time and date values to the localhost system.
In this example, I have created a simple screen that contains six(6) EditBox-Displays from Objects category in the Toolbox within the Movicon 11 development environment. Also, a button that will be used to execute the update/change command. The EditBox-Display have the following variables:
1- _SysVar_:StrobeHourLocalTime
2- _SysVar_:StrobeMinuteLocalTime
3- _SysVar_:StrobeSecondLocalTime
4- _SysVar_:StrobeMonthLocalTime
5- _SysVar_:StrobeDayLocalTime
6- _SysVar_:StrobeSecondLocalTime
7- Button with the following Command associated with it: _SysVar_:StrobeLocalTime
Add these tags to the associated EditBox display variable fields in the Properties Explorer.
*Make to set the Min and Maximum Value allowed in the field under the "Style" section in the Properties Explorer. EX. Hours can only be from 0 to 23; Minutes - 0-59*
Next, in the Button Properties menu, you need to add a new command on the "Command On Release" and add a "New Command".
1- Choose: SysVar_:StrobeLocalTime in the variable field
2- Action is "Set"
3- Change the "Value" field to 1. (Movicon will automatically change back to 0 after execution)
In run-time, you can enter in the values that you want the system clock to change to and then hit the button that you have the SysVar_StrobeLocalTime Command associated with. This will update your system time and date without having to exit the runtime.
Thanks for reading! As always, send me a message if you have any questions on this, or any other questions on Movicon 11 or Movicon.NExT platform!
Comments
Please sign in to leave a comment.