User guide
78
VTB USER GUIDE
NG_T0 – ZERO INDEX OF ENCODER
This function allows to read the state of the zero index input of each encoder channel equipped in the expansion card
NG-IO. The channel selection is made as for the reading of encoders.
Syntax
NG_T0(Char Chan) as char
Parameters
Chan Number of channel (from 0 to 15)
Return value:
State of the index input:
0 OFF
1 ON
WARNING: THE INDEX INPUT IS DIFFERENTIAL, THE ON STATE ON OCCURS WHEN ON CH+ THERE IS A VOLTAGE
GREATER THAN THE VOLTAGE ON CH- .
Example
if ng_t0(0)
. . .
endif
NG_RELE RELE' on NGIO
This function allows to update the two RELAIS equipped in each expansion card NG-IO.
Usually these RELAIS are connected to the input ENABLE of the SERVO DRIVER but they can be managed for any
applications. The channel selection is made as for the reading of encoders.
Syntax
NG_RELE(Char Chan, char State)
Parameters
Chan Number of channel (from 0 to 15)
State State of the relay:
0 OFF (contact opened)
1 ON (contact closed)
Example
Used variables:
channel UINT
state UINT
channel = 1
state = 1
ng_rele(channel,state) 'active the relay of the second channel
channel = 2
state = 0
ng_rele(channel,state) ‘disactive the relay of the third channel
ng_rele(0,1) ‘active the relay of the first channel










