HIMax System 5 Programming
HI 801 001 E Rev. 4.01 Page 61 of 122
5.2.4 Assignment to I/O Channels
In the Hardware Editor of SILworX, an I/O channel can be assigned a global variable. In the
detail view of an I/O module, drag a global variable from the Object Panel to the channel list
of the I/O module.
In doing so, the channel's value and status information are available in the user program.
Use of Digital Input
Perform the following steps to use the value of a digital input in the user program
1. Define a global variable of type BOOL.
2. When defining the global variable, enter the initial value as safe value.
3. Assign the global variable to the channel value of the input.
The global variable provides the safe value to the user program.
For digital proximity switch input modules internally operating in analog mode, the raw
value can also be used and the safe value can be calculated in the user program. For more
information, see below.
To get additional options for diagnosing the external wiring and programming fault reactions
in the user program, assign global variable to Channel OK and to further diagnostic
statuses. For more information on the individual diagnostic statuses such as short-circuits
and open-circuits, refer to the module-specific manual.
Use of Analog Inputs
Analog input channels convert the measured input currents into a value of type DINT
(double integer). This value is made available to the user program as a raw value. Here, 1
mA corresponds to a value of 10 000 and the range of values is 0...240 000.
As an easier alternative, the process value of the REAL data type can be often used
instead of the "raw value". HIMax calculated the process value based on the raw value and
the scale value on the parameters 4 and 20 mA. Refer to the module manual for more
details.
The safety-related precision is the guaranteed accuracy of the analog input without module
fault reaction. This value must be taken into account when configuring the safety functions.
There are two possibilities to use the values of analog inputs in the user program.
Use of the process value
If an analog input is configured correctly, its process value provides the value including
the safe fault reaction.
Using the raw value
the raw value is the measuring value without the safe fault reaction. The safe fault
reaction must be programmed as appropriate for the project.
Perform the following steps to use the process value
1. Define a global variable of type REAL.
2. When defining the global variable, enter the initial value as safe value.
3. Assign the global variable to the process value of the input.
4. Specify the measuring range of the channel by giving a REAL value for 4 mA and for
20 mA.
The global variable provides the safe value to the user program.
Perform the following steps to use the raw value:
1. Define a global variable of type DINT.
2. In the user program, define a global variable of the type needed.
3. In the user program, program a suitable conversion function to convert the raw value
into a used type and consider the measurement range.