Click or drag to resize

ControllerDateTime Property

Gets or sets current date and time in the controller.

Namespace:  ABB.Robotics.Controllers
Assembly:  ABB.Robotics.Controllers (in ABB.Robotics.Controllers.dll) Version: 6.5.129.0
Syntax
C#
public DateTime DateTime { get; set; }

Return Value

Type: DateTime
A DateTime object.
Exceptions
ExceptionCondition
GeneralExceptionA General Exception has occurred.
Examples
This example retrieves the controller name and the current date and time and displays the information in a GTPUMessageBox .
private void DisplayNameNnTime(Controller myControllerRef)
{
       // Get the name of the controller
       string name = myControllerRef.Name;

       // Get current date and time
    DateTime now = myControllerRef.DateTime;

    // Compose text
    string text = string.Format("Name of controller is: {0}\r\nCurrent date is: {1}\r\n and the time is: {2}:{3}",name,
        now.Date.ToString(), now.Hour, now.Minute);

    // Display message box
    GTPUMessageBox.Show(this,
        new MessageBoxEventHandler(MyMessageBoxEventHandler),
        text,
        "System Information",
        System.Windows.Forms.MessageBoxIcon.Asterisk,
        System.Windows.Forms.MessageBoxButtons.OK);
}
See Also