W&T 57630 Manual page 70

Web-io series 12+12 digital
Table of Contents

Advertisement

W&T
Write functions
To allow individual access to the outputs, the applet provides
corresponding functions.
function setOutput( iDevice, iOutput, iValue )
{ iOut = 0;
iOut |= Math.pow( 2, iOutput );
document.applets["dio"+iDevice].outputAccess( iOut, iValue );
}
If you want to access the outputs using JavaScript, the above
function should be inserted in the Web page header. iOutput
indicates which output should be set. iValue is set to 0x0FFF if
the output is supposed to switch to ON. 0x000 corresponds to
OFF.
The JavaScript command
document.applets["dio"+iDevice].outputAccess( iOut, iValue )
is used within the function. If you want to switch more than
one output at a time, you can use this command in separate
functions. The variable iOut is a whole-number 16-bit value. By
using for example mathematical functions or including
constants you can set the bits than need to be changed to 1.
In iValue you specify for the individual bits whether the
corresponding output should be 0 (=OFF) or 1 (=ON).
Example in hex format:
iOut = 0x0013, iValue = 0x0101
In this case, Outputs 0 and 4 are set to ON and Output 1 to 0.
All other outputs remain unchanged.
An additional function is provided for clearing the counters.
function clearCounter( iDevice, iValue )
{ iVal = 0;
iVal |= Math.pow( 2, iValue );
document.applets["dio"+iDevice].counterClear( iVal );
}
70
Java Applets

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

57631

Table of Contents