70
W&T
Java Applets
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 );
}
Содержание 57630
Страница 8: ...8 W T Content...
Страница 22: ...22 W T Assigning the IP address...
Страница 44: ...44 W T configuring the network parameters...
Страница 194: ...194 W T Diacnostics and testing...
Страница 211: ...211 W T Decalration of conformity Subject to errors and modifications 7 9 Declaration of Conformity...