39 writevar% function – Rockwell Automation 57C610 Enhanced Basic Language, AutoMax User Manual
Page 106

7Ć18
Values Returned:
ă1
Success
-22 Variable not found
-23 Data type mismatch
For example:
VARIABLE_NAME$ = SET_POINTS(17)"
STATUS% = READVAR%( VARIABLE_NAME$, VALUE )
7.39
WRITEVAR% Function
This function requires the AutoMax operating system with the
Ethernet option.
Format:
WRITEVAR%( vn$, value )
where:
vn$
is a string expression for the name of the variable to
write to. It can be a boolean, integer, double integer,
real, or an array of these types. Only single
dimension arrays are allowed.
value
is the variable that has the value to write.
This function accepts a variable name as a string expression and a
value to write into the variable. The string that defines the variable
name must have a suffix as follows:
@
Booleans
%
Integers
!
Double integers
No suffix
Reals
If specifying an array element, the subscript must be after the data
type character if there is one.
If the data type of the variable, as defined in the string vn$, is
different than that of VALUE, an error is generated. Only common
variables can be accessed.
Values Returned:
ă1 Success
-22 Variable not found
-23 Data type mismatch
-24 Variable forced
For example:
VARIABLE_NAME$ = SET_POINTS(17)"
VALUE = 12.345
STATUS% = WRITEVAR%( VARIABLE_NAME$, VALUE )