Cicode Programming Reference > Cicode Function Categories > Quality Functions > QualityGetPart

QualityGetPart

Extracts a requested part of the quality value from a variable tag's quality item.

Syntax

QualityGetPart(QUALITY quality, INT part)

quality:

Specifies the quality variable.

part:

The part to extract:

0 – The General Quality value

1 – Quality Substatus value

2 - The Quality Limit value

3 - The Extended Quality Substatus value

4 – The Tag Status Override flag

5 – The Tag Status Control Inhibit flag

6 - The DataSource error code

7 – The OPC Quality (General + Substatus + Limit)

Return Value

The value of the requested Quality part (see tables below), or -1 if error.

 

Part 0 - General Quality Values

Cicode label name

Value

Description

QUAL_BAD

0x00

Value is not useful for reasons indicated by the Substatus Bit Field.

QUAL_UNCR

0x01

The Quality of the value is uncertain for reasons indicated by the Substatus Bit Field.

QUAL_GOOD

0x03

The Quality of the value is Good.

 

Part 1 - Quality Substatus Values

This part returns a value from one of the following susbstatus groups:

To determine which substatus group the return value is from, you need to initially call the General Quality Value (part = 0).

 

Part 2 - Quality Limit Values

Cicode label name

Value

Description

QUAL_LIMITED_NOT_LIMITED

0x0

The value is free to move up and down.

QUAL_LIMITED_LOW

0x1

The value has ‘pegged’ at some lower limit.

QUAL_LIMITED_HIGH

0x2

The value has ‘pegged’ at some high limit.

QUAL_LIMITED_CONSTANT

0x3

The value is a constant and cannot move.

 

Part 3 - Extended Quality Substatus Values

Cicode label name

Value

Description

QUAL_EXT_NON_SPECIFIC

0x00

There is no specific extended substatus value.

QUAL_EXT_SCHEDULED_OFFLINE

0x01

The device is a scheduled device that is offline and no cache value is available.

QUAL_EXT_INVALID_TAG

0x02

The tag configuration is invalid.

QUAL_EXT_INVALID_DATA

0x03

The value of the tag is invalid.

QUAL_EXT_SOFTWARE_ERROR

0x04

An internal software error occurred in the device driver.

QUAL_EXT_TOO_MANY_DEVICES

0x05

Too many devices are attached.

QUAL_EXT_COMM_NO_INIT

0x06

Communication is not initialised.

QUAL_EXT_COMM_BAD

0x07

Bad communication.

QUAL_EXT_TAG_OUT_OF_RANGE

0x08

Tag address is out of range.

QUAL_EXT_WRITE_ONLY

0x09

Tag is not readable.

QUAL_EXT_WRITE_PROTECTED

0x0A

Write operation is not authorised.

QUAL_EXT_NO_CLUSTER_SPECIFIED

0x0B

No cluster is specified within a system or for a given tag.

QUAL_EXT_CLUSTER_NOT_FOUND

0x0C

The requested cluster is not known or no clusters are available.

QUAL_EXT_CLUSTER_DISABLED

0x0D

The requested cluster is disabled.

QUAL_EXT_SESSION_NOT_CONNECTED

0x0E

Cannot connect to the requested session.

QUAL_EXT_TAG_RESOLVE_TIMEOUT

0x0F

Tag could not be resolved.

QUAL_EXT_VALUE_NOT_REPLICATED

0x10

Tag element value not replicated to every redundant DataSource.

QUAL_EXT_STALE

0x11

Tag element value is "stale.

QUAL_EXT_WAITING_FOR_INI_DATA

0x12

Waiting for initial tag value from the DataSource.

QUAL_EXT_INVALID_ARGUMENT

0x13

Invalid element used for referencing to a tag.

 

Part 4 - Tag Status Values - Override Flag

Cicode label name

Value

Description

QTS_OVERRIDE

0x01

The tag is in Override mode.

 

Part 5 - Tag Status Values - Control Inhibit Flag

Cicode label name

Value

Description

QTS_CONTROL_INHIBIT

0x02

The tag is in Control Inhibit Mode.

Related Functions

QualityIsBad, QualityIsContolInhibit, QualityIsGood, QualityIsOverride, QualityIsUncertain, QualitySetPart, QualityToStr, QualityCreate

Example

INT qualityGeneral;
qualityGeneral = QualityGetPart(Tag1.Field.Q, 0);

See Also

Quality Functions

 

Published June 2018