WriteVals

<< Click to Display Table of Contents >>

Manual > Reference > Methods >

WriteVals


 

Writes the values of multiple tags.

 

 


syntax

bResult = AxEng1.WriteVals(

                                 Count,

                                 TagPaths,

                                 Values,

                                 Results

                                 )


Parameters

Count

 

type:

integer

 

The number of tags to write.

TagPaths

 

type:

string()

 

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

Values

 

type:

object

 

The values to be written are specified as a variant (object) array.

Results

 

type:

object

 

Returns the write result for each tag. Only valid when bResult is True.

 

Return Value

bResult

 

type:

bool

 

FALSE - Failure. TRUE - Success.

 


Commentary

If you want to write the values of multiple tags, the WriteVals method writes them all at once, so it is faster than calling the WriteVal method multiple times. Results is only valid when the return value is True. Results tells you whether communication was successful for each tag.

 

 

 

example

Dim TagPaths(2) As String
Dim Values(2) As Object = Noting 
Dim Results As Object = Noting 

TagPaths(0) = "U01.F01.T01"
TagPaths(1) = "U01.F01.T02"
Values(0) = 123
Values(1) = 456
If AxEng1.WriteVals(2, TagPaths, Values, Results) Then
	For i = 0 To 1
		If Results(i) Then
			txtResult(i).Text = "Success!"
		Else
			txtResult(i).Text = "Error!"
		End If
	Next i
Else
		For i = 0 To 1
			txtResult (i).Text = "Error!"
		Next i
End If

 

 

 


reference

 

WriteVal