GetTagDataType

The GetTagDataType method retrieves the data storage type for the specified tag handle.

LONG GetTagDataType(
  LONG TagHandle // Handle of tag to be queried
)


Parameters:
TagHandle Handle of tag to be queried

Return Values:
Value Meaning
0 Type is unknown
1 String
2 Integer
3 Handle
4 Pointer
5 Schedule Data
6 Tag Id
4096 Function Call
4097 Function Response
32767 Byte Block
-1 Tag handle is invalid

Example:
var Tl, Th, TagInfo;

Tl = CAS.New();
CAS.AddTag(Tl,"SUBJECT","This is a test.");

if ((Th = CAS.GetTagHandle(Tl,"SUBJECT",0)) != null)
  {
  TagInfo  = "Tag ID is " + CAS.GetIdFromHandle(Th) + "\r\n";
  TagInfo += "Tag data is " + CAS.GetTagData(Th) + "\r\n";
  TagInfo += "Tag data length is " + CAS.GetTagDataLength(Th) + "\r\n";
  TagInfo += "Tag data type is " + CAS.GetTagDataType(Th) + "\r\n";

  CAS.RetTagHandle(Th);
  }
else
  {
  TagInfo = "Tag not found";
  }

CAS.Delete(Tl);

The contents of TagInfo will be:

Tag ID is 832
Tag data is This is a test.
Tag data length is 16
Tag data type is 1


See Also:
CAS GetTagHandle, CAS GetTag