ProSoft Technology MVI56E-LDM User Manual
Page 158

CIP API Functions
ControlLogix Platform ♦ "C" Programmable
Developer's Manual
Linux Application Development Module
Page 152 of 264
ProSoft Technology, Inc.
March 12, 2014
OCXcip_GetWCTime
Syntax
int OCXcip_GetWCTime (OCXHANDLE apihandle,
BYTE *pPathStr,
OCXCIPWCT *pWCT,
WORD timeout);
Parameters
apihandle
handle returned by previous call to OCXcip_Open
pPathStr
path to device being read
pWCT
Pointer to OCXCIPWCT structure to be filled with Wall Clock Time
data
timeout
number of milliseconds to wait for the read to complete
Description
OCXcip_GetWCTime
retrieves information from the Wall CLock object in the
specified device. The information is returned both in 'raw' format and
conventional time/date format.
apihandle
must be a valid handle returned from
OCXcip_Open
.
pPathStr
must be a pointer to a string containing the path to a device which
supports the Wall Clock Time object, such as a ControlLogix controller.
pWCT
is a pointer to a structure of type
OCXCIPWCT
, which on success will be filled
with the data read from the device. As a special case,
pWCT
may also be NULL.
If
pWCT
is NULL, the system time is set with the local time returned from the WCT
object. This is a convenient way to synchronize the system time with the
controller time (Note: The user account must have appropriate privileges to set
the system time.)
timeout
is used to specify the amount of time in milliseconds the application
should wait for a response from the device.
The following example defines the
OCXCIPWCT
structure:
typedef struct tagOCXCIPWCT
{
ULARGE_INTEGER CurrentValue;
WORD TimeZone;
ULARGE_INTEGER CSTOffset;
WORD LocalTimeAdj;
SYSTEMTIME SystemTime;
} OCXCIPWCT;
CurrentValue is the 64-bit Wall Clock Time counter value (adjusted for local
time), which is the number of microseconds since 1/1/1972, 00:00 hours. This is
the 'raw' Wall Clock Time as presented by the device.
TimeZone is obsolete and is no longer used. It is retained in the structure for
backwards compatibility only and should not be used.