beautypg.com

ProSoft Technology MVI56E-LDM User Manual

Page 162

background image

CIP API Functions

ControlLogix Platform ♦ "C" Programmable

Developer's Manual

Linux Application Development Module

Page 156 of 264

ProSoft Technology, Inc.

March 12, 2014

OCXcip_SetWCTime

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 to be set

timeout

number of milliseconds to wait for the read to complete

Description

OCXcip_SetWCTime

writes to the Wall Clock Time object in the specified device.

This function allows the time to be specified in two different ways; a specified
data/time, or automatically set to the local system time. See the description of
the

pWCT

parameter for more information.

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. See
Appendix A for information on specifying paths.

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 ignored by this function.
TimeZone is obsolete and is no longer used. It is retained in the structure for
backwards compatibility only and should not be used.