This keyword provides access to a logical input word (16 bits).
Syntax |
I16 inp_w (I32 n) |
---|---|
n |
Index of the input word (see file RHW.CFG). Minimum representable number: 1 Maximum representable number: Depends on Hardware |
Attributes |
Bit-accessible. Read only |
In the case of remote I/O mapping to fieldbus, indices 257 to 9999 must be used. To be able to do forcing, such as from shell or panel, use the device (directive) command DEF_IO.
NOTE: The returned value of the first 256 words is always returned as U16 so if a sign is needed (e.g., on analog inputs) it must be explicitly casted (I16).
Example
; to variable valueBallerino is assigned the value of iw 131 valueBallerino = inp_w(131) ; to variable statoDIWago is assigned the value of iw 1000 stateDIWago = inp_w(1000) ; to variable enableGun is assigned the value of the eighth bit ; of iw 1200, which is used to enable the minigun enablePistol = inp_w(1200).7 |