ReadVals

<< Click to Display Table of Contents >>

Manual > Reference > Methods >

ReadVals


 

Reads the values of multiple tags.

 


syntax

bResult = AxEng1.ReadVals(

                                 Count,

                                 TagPaths,

                                 Values,

                                 Results

                                 )


Parameters

Count

 

type:

integer

 

The number of tags to read.

TagPaths

 

type:

string()

 

Specify the tag path as an array. (Array tags cannot be specified.)

Values

 

type:

object

 

The read values are returned as an array. This is only valid when bResult is True.

Results

 

type:

object

 

Returns the quality of each tag value. Only valid when bResult is True.

 

Return Value

bResult

 

type:

bool

 

FALSE - Failure. TRUE - Success.

 


Commentary

If you want to read the values of multiple tags, ReadVals reads them all at once, so it is faster than calling the ReadVal method multiple times. Values/Results are valid only when the return value is True. Results indicates the quality of the values for each tag (whether communication was successful or not). When Result(x) is True, valid values are stored in Values(x).

 

 

 

example

Dim TagPaths(2) As String
Dim Values As Object = Noting 
Dim Results As Object = Noting 
TagPaths(0) = "U01.F01.T01"
TagPaths(1) = "U01.F01.T02"
If AxEng1.ReadVals(2, TagPaths, Values, Results) Then
	For i = 0 To 1
		If Results(i) Then
			txtValue(i).Text = Values(i)
		Else
			txtValue(i).Text = "Error!"
		End If
	Next i
Else
	For i = 0 To 1
		txtValue(i).Text = "Error!"
	Next i
End If

 

 

 


reference

 

ReadVal