User guide
75
VTB USER GUIDE
NOTES FOR PROGRAMMING WITH DIGITAL I/O
To obtain an application program more clear and stable we suggest to call the I/O function only from TASK PLC. Therefore,
in this task, read the inputs writing them in a GLOBAL variable (ex. Input) and write the outputs reading them from
another GLOBAL variable (ex. Output). On these variables can be defined the single bits associated to the digital channels
and then using them at occurrence.
Example
Used variables:
Input1 UINT
Input2 UINT
Output1 UINT
Output2 UINT
StartButton BIT Input1.3
StopButton BIT Input1.6
WaterPump BIT Output2.12
In TASK PLC:
Input1=Ng_Di(0)
Input2=Ng_Di(1)
Ng_Do(0,Out1)
Ng_Do(1,Out2)
EVERYWHERE:
if StartButton
WaterPump=1
endif
if StopButton
WaterPump=0
endif
NG_ADC – ANALOG INPUTS
The NG35 is equipped with 8 analog input channels at 10 Bit, these can be read by the function ng_adc.
Syntax
Uint NG_ADC(Char Chan)
Parameters
Chan Number of the channel (from 0 to 7)
Return value:
Returns the analog value (from 0 to 1023).










