Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

ctTagWrite

  • Last UpdatedJul 13, 2023
  • 1 minute read

Writes to the given Plant SCADA I/O Device variable tag. The value, quality and timestamp, not only a value, is converted into the correct data type, then scaled and then written to the tag. If writing to an array element only a single element of the array is written to. This function will generate a write request to the I/O Server. The time taken to complete this function will be dependent on the performance of the I/O Device. The calling thread is blocked until the write is completed. Writing operation will succeed only for those tag elements which have read/write access.

Syntax

ctTagWrite(hCTAPI, sTag, sValue)

hCTAPI

Type: Handle
Input/output: Input
Description: The handle to the CTAPI as returned from ctOpen().

sTag

Type: LPCSTR
Input/output: Input
Description: The tag name or tag name and element name, separated by a dot. If the element name is not specified, it will be resolved at runtime as for an unqualified tag reference. You may use the array syntax [] to select an element of an array.

Variable tags can be specified as a string in multiple forms. Refer to Tag Names for more information.

sValue

Type: LPCSTR
Input/output: Input
Description: The value to write to the tag as a string.

Return Value

TRUE if successful, otherwise FALSE. Use GetLastError() to get extended error information.

ctOpen, ctTagWrite, ctTagRead

Example

HANDLE hCTAPI = ctOpen(NULL, NULL, NULL, 0);

ctTagWrite (hCTAPI,"PV123", "123.12");

ctTagWrite (hCTAPI,"PV123.Field", "123.12");

ctTagWrite (hCTAPI,"PV123.Field.V", "123.12");

ctTagWrite (hCTAPI,"PV123.ControlMode", "1");

ctTagWrite (hCTAPI,"PV123.Status", "0");

In This Topic
TitleResults for “How to create a CRG?”Also Available in