Technical FAQs

Ask a Question

Can I set the Magelis date using scripting in Vijeo Designer?

Yes, you can set the Magelis date using scripting in Vijeo Designer. By using the Sys.setDate command.
Function

Changes the date on the target machine.

You can also change the date from the Configuration menu, but using scripts makes it possible to change the date while still running Vijeo-Designer Runtime.

Format

    • public static boolean Sys.setDate(int year4, int month, int day);
Parameters
        • Parameter
        • Description
        • int year4
        • First parameter defines a four-digit year. Acceptable values are 1980 to 2037.
        • int month
        • Second parameter defines the one- or two-digit month. Acceptable values are 1 to 12.
        • int day
        • Third parameter defines the one- or two-digit day. Acceptable values are 1 to 31.

Use  1 as any of the parameters to ignore that parameter.

Example:

    • Sys.setDate(2003, 12, -1);

      // set the year to 2003, month to 12, and do not change the day

    • For the month and day parameters, use only single digits for the numbers 1 to 9. Using two digits, such as "08" or "09", may produce unexpected results.
Return Value
        • Value
        • Description
        • false
        • Failed to set the date on the target machine. Usually indicates invalid parameters, but may also indicate a communication error.
        • true
        • Successfully set the date on the target machine.

Was this helpful?
What can we do to improve the information ?