User guide

Wint
0
rive
Digital&mt
Digital-Input
Ill
El
D&l
out
Se1
.$$
zl
y$g
Description
It reads a bit of digital input (DgtZn) specified by input selector
(Sel)
when different from zero, otherwise
output
(Out)
is equal to the input
(In)
A standard method to handle and read digital inputs is provided with this compound block.
Control developed by the user may have a lots of functions. Each function can be enabled or disabled depend-
ing on its associated variable
Fnct.
This variable can be manually set by the user or read from a digital input
selected by another variable
FnctSel.
If this variable is zero
Fnct
variable is not read from digital input
(digital inputs from 1 to 8 are available) and can be manually modified, otherwise
FnctSel-th
digital input is
read and assign to
Fnct.
The following drawing shows a possible usage of this compound block:
Digital-Input
Ida
block reads all digital inputs using for example Bitword PadA par.N. 519,
DigitalJqut
compound block
reads desired digital input from 1 to 8 according to
FnctSel
variable and the result is assigned to
Fnct vari-
able. Instead,
if FnctSel
is zero
Fnct
variable is left unchanged.
Iass
block is used to store
Fnct
variable and
send read input at the same time.
So two variables
(Fnct
and
FnctSel)
are need for each function user wants to enable or disable using a
selected digital input.
C-style description
if
(Se1
!= 0)
/* reads (Sel-l)-th bit of DgtIn input. Note bits of integer number is numbered from 0 to 7 */
Out=rbit@gtIn, Sel-1);
else
out=In;
171