NoData

This subroutine is not a part of the VTScada API. You must write it as part of your communications driver.

Description: Used in combination with a VTSRead module to invalidate data due to errors such as a comm failure
Returns: Nothing
Usage: Script Only.
Function Groups:  
Related to: RefreshData
Format: CallBackObj\NoData(Hold, Attribute)
Parameters:  
Hold

This should be set to the driver's Hold parameter.

If FALSE (default), the values of the input tags will be invalidated.

If TRUE, the values of the input tags will be left as is but will be marked with a stale attribute.

Attribute

A value that indicates why the data is being invalidated.

Defaults to the communication failure attribute as SetBit(0, \#DATA_ATTR_COMMFAIL, TRUE).

Comments:

This function should be called whenever there is a reason to invalidate the input values. The most common reason for this is when a communicate failure occurs.

 

{ Bit numbers for logging data attributes }

#NUM_DATA_ATTR_BITS = 12

The number of bits in data attributes

#DATA_ATTR_MANUAL_DATA = 00

The value was from the tag's ManualData parm

#DATA_ATTR_MANUAL_ENTRY = 01

The value was manually entered

#DATA_ATTR_EDITED_DATA = 02

The historical value was manually edited

#DATA_ATTR_QUESTIONABLE = 03

The tag was marked as questionable

#DATA_ATTR_STALE_DATA = 04

The value was reported as stale by VTSDriver

#DATA_ATTR_IMPORTED = 05

The value was imported from a CSV file

#DATA_ATTR_COMMFAIL = 06

The driver experienced a comm failure

#DATA_ATTR_QUALITY = 07

The tag has marked the value as unreliable

#DATA_ATTR_DRIVER_COMMFAIL = 08

The PLC reported a downstream comm failure

#DATA_ATTR_DRIVER_QUALITY = 09

The PLC reported the value may be unreliable

#DATA_ATTR_DRIVER_OVERRIDDEN = 10

The PLC reported the value was overridden

#DATA_ATTR_DRIVER_NODATA = 11

The PLC reported there is no data available

Example:

  If CommFail Next;
  [
   { Clear the data if we experience a communication failure }
    CallbackObj.NoData(Hold, SetBit(0, \#DATA_ATTR_COMMFAIL, TRUE));  
  ]