Technical Reference > CtAPI Functions > Function Reference

Function Reference

The CTAPI functions allow access to CitectSCADA I/O variable tags via a DLL interface. This allows third-party developers to create applications in C or other languages to read and write to the I/O Devices.

Function

Argument(s)

Type

Description

ctCancelIO

hCTAPI, pctOverlapped

Boolean

Cancels a pending overlapped I/O operation.

ctCiCode

hCTAPI, sCmd, hWin, nMode, sResult, dwLength, pctOverlapped

DWORD

Executes a Cicode function.

ctClientCreate () n/a Initializes the resources for a new CtAPI client instance
ctClientDestroy hCTAPI Boolean The handle to the CTAPI as returned from ctOpen().

ctClose

hCTAPI

Boolean

Closes a connection to the CitectSCADA API.

ctCloseEx hCTAPI,bDestroy Handle The handle to the CTAPI as returned from ctOpen().

ctEngToRaw

pResult, dValue, pScale, dwMode

Boolean

Converts the engineering scale variable into raw I/O Device scale.

ctFindClose

hnd

Boolean

Closes a search initiated by ctFindFirst().

ctFindFirst

hCTAPI, szTableName, szFilter, pObjHnd, dwFlags

Handle

Searches for the first object in the specified database which satisfies the filter string.

ctFindFirstEx

hCTAPI, szTableName, szFilter, szCluster, pObjHnd, dwFlags

Handle

Searches for the first object in the specified database which satisfies the filter string specified by cluster.

ctFindNext

hnd, pObjHnd

Boolean

Retrieves the next object in a search initiated by ctFindFirst().

ctFindPrev

hnd, pObjHnd

Boolean

Retrieves the previous object in a search initiated by ctFindFirst().

ctFindScroll

hnd, dwMode, dwOffset, pObjHnd

Handle

Scrolls to the necessary object in a search initiated by ctFindFirst().

ctGetOverlappedResult

hCTAPI, lpctOverlapped, pBytes, bWait

Boolean

Returns the results of an overlapped operation.

ctGetProperty

hnd, szName, pData, dwBufferLength, dwResultLength, dwType

Boolean

Retrieves an object property.

ctHasOverlappedIoCompleted

lpctOverlapped

Boolean

Checks for the completion of an outstanding I/O operation.

ctListAdd

hList, sTag

Handle

Adds a tag to the list.

ctListAddEx

hList, sTag, bRaw, nPollPeriodMS, dDeadband

Handle

Adds a tag to the list with a specified poll period.

ctListData

hTag, pBuffer, dwLength, dwMode

Boolean

Gets the value of a tag on the list.

ctListDelete

hTag

Boolean

Frees a tag created with ctListAdd().

ctListEvent

hCTAPI, dwMode

Handle

Returns the elements in the list which have changed state since they were last read using the ctListRead() function.

ctListFree

hList

Boolean

Frees a list created with ctListNew().

ctListItem

hTag, dwitem, pBuffer, dwLength, dwMode Boolean Gets the tag element item data.

ctListNew

hCTAPI, dwMode

Handle

Creates a new list.

ctListRead

hList, pctOverlapped

Boolean

Reads every tag on the list.

ctListWrite

hTag, sValue, pctOverlapped

Boolean

Writes to a single tag on the list.

ctOpen

sComputer, sUser, sPassword, nMode

Handle

Opens a connection to the CitectSCADA API.

ctOpenEx

sComputer, sUser, sPassword, nMode, hCTAPI

Handle

Establishes the connection to the CtAPI server using the given client instance.

ctRawToEng

pResult, dValue, pScale, dwMode

Boolean

Converts the raw I/O Device scale variable into engineering scale.

ctTagGetProperty

hCTAPI, szTagName,
szProperty, pData, dwBufferLength, dwType

Boolean

Gets the given property of the given tag.

ctTagRead

hCTAPI, sTag, sValue, dwLength

Boolean

Reads the current value from the given I/O Device variable tag.

ctTagReadEx hCTAPI, sTag, sValue, dwLength, pctTagvalueItems Boolean Performs the same as ctTagRead, but with an additional new argument

ctTagWrite

hCTAPI, sTag, sValue

Boolean

Writes the given value to the I/O Device variable tag.

ctTagWriteEx

hCTAPI, sTag, sValue, pctOverlapped

Boolean

Performs the same as ctTagWrite, but with an additional new argument.