ProSoft Technology MVI69-ADM User Manual

Page 322

Advertising
background image

Side-Connect API Library Functions

MVI-ADM ♦ 'C' Programmable

Developer's Guide

'C' Programmable Application Development Module

Page 322 of 342

ProSoft Technology, Inc.

February 20, 2013

MVIsc_GetPLCClock

Syntax

int MVIsc_GetPLCClock(HANDLE handle, MVISCCLOCK *clock);

Parameters

handle

Handle returned by previous call to MVIsc_Open

clock

Pointer to structure of type MVISCCLOCK

Description
MVIsc_GetPLCClock retrieves the current date and time from the PLC-5 clock.
The information is returned in the structure pointed to by clock.

handle must be a valid handle returned from MVIsc_Open. The MVISCCLOCK
structure is defined as follows:

typedef struct tagMVISCCLOCK
{
WORD year;
WORD month;
WORD day;
WORD hour;
WORD minute;
WORD second;
} MVISCCLOCK;

Return Value

MVISC_SUCCESS

The clock information was read successfully.

MVISC_ERR_NOACCESS

handle does not have access

MVISC_ERR_PLCTIMEOUT

PLC-5 did not respond

Example

HANDLE Handle;
MVISCCLOCK clock;
/* print time and date from PLC */
MVIsc_GetPLCClock(Handle, &clock);
printf("Time: %d:%02d Date: %d/%d/%d",
clock.hour, clock.minute, clock.month, clock.day, clock.year);

Advertising