beautypg.com

ProSoft Technology MVI56E-LDM User Manual

Page 159

background image

ControlLogix Platform ♦ "C" Programmable

CIP API Functions

Linux Application Development Module

Developer's Manual

ProSoft Technology, Inc.

Page 153 of 264

March 12, 2014

CSTOffset is the positive offset in microseconds from the current system CST
(Coordinated System Time). In a system that uses a CST Time Master, this
value allows the Wall Clock Time to be precisely synchronized among multiple
devices that support CST and WCT.
LocalTimeAdj is obsolete and is no longer used. It is retained in the structure for
backwards compatibility only and should not be used.
SystemTime is a structure of type SYSTEMTIME. The time and date returned in
this structure is the local adjusted time on the device. The SYSTEMTIME
structure is as shown:
typedef struct_SYSTEMTIME
{
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME, *PSYSTEMTIME;

Return Value

OCX_SUCCESS

WCT object was retrieved successfully

OCX_ERR_NOACCESS

apihandle does not have access

OCX_ERR_MEMALLOC

returned if not enough memory is available

OCX_ERR_BADPARAM

returned if parameter was invalid

OCX_ERR_NODEVICE

the device does not exist

OCX)CIP_INVALID_REQUEST the device does not support the object

Example

OCXHANDLE apihandle;
OCXCIPWCT Wct;
BYTE Path[]="p:1,s:0";
int rc;

rc=OCXcip_GetWCTime(apiHandle, &Path, &wCT, 3000);

if (rc !=OCX_SUCCESS)
{
printf ("\n\rOCXcip_GetWCTime failed: %d\n\r",rc);
}
else
{
printf("\nWall Clock Time: %02d/%02d/%d: %02d:%02d.%03d",