User guide
90
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
NGM13 NGMEVO – ANALOG INPUTS
The NGM13 is equipped with 8 analog input channels at 12 Bit. These inputs are shared with the digital inputs. The
NGM13-NGMEVO must be hardware and software configured for the enable of the analog input channels, each
activated channel excludes a correspondent digital input.
This is the relationship (first input is the number 1):
Analog input
Digital input
1
9
2
10
3
11
4
12
5
13
6
14
7
15
8
16
Syntax
NG_ADC(Char Ch) as uint
Parameters
Chan Number of the channel (from 0 to 7)
Return value:
Returns the analog value (from 0 to 4095).