C Control The I Unit-M Advanced 5 Vdc Inputs / outputs 16 x digital I/Os / 8 x analogue or digital I/Os Program memory 2 198805 Datenbogen
Produktcode
198805
EXTENDED PORTS
Extended Ports are handled in the same manner as the standard digital ports, except the fact that PULSE
and TOG are not applicable. See chapter DECLARATION and DEFINITIONS for information on external port
assignment
and TOG are not applicable. See chapter DECLARATION and DEFINITIONS for information on external port
assignment
AD PORTS
Prior to any operation of ports, a port has to be defined (see Chapter DECLARATIONS and DEFINITIONS)
Each of the eight analog ports (A/D-converter) can be alternatively used as a standart digital I/O port if this
function is enabled in the configuration register (see Chapter CONFIG REGISTER) Each of this ports can
then be considered as standard bitport (P17 to 24) but has no switchable pull up resistor. If the AD Ports are
used in digital mode they are handled in the same manner as the standard digital ports, except the fact that
PULSE and TOG are not applicable.
Reading the AD Ports in analog mode (default) will return a Byte value representing the applied voltage to
the AD input.
Each of the eight analog ports (A/D-converter) can be alternatively used as a standart digital I/O port if this
function is enabled in the configuration register (see Chapter CONFIG REGISTER) Each of this ports can
then be considered as standard bitport (P17 to 24) but has no switchable pull up resistor. If the AD Ports are
used in digital mode they are handled in the same manner as the standard digital ports, except the fact that
PULSE and TOG are not applicable.
Reading the AD Ports in analog mode (default) will return a Byte value representing the applied voltage to
the AD input.
IF MyAnalogIn = 100 THEN GOTO X
MyByte=MyAnalogIn / 10
Example for read an AD Port
DA PORTS
Prior to any operation of ports, a port has to be defined (see Chapter DECLARATIONS and DEFINITIONS)
The D/A-ports can be programmed for an alternate servo drive function. See chapter CONFIG REGISTER
for informations on use in Servo Mode Writing to the the DA Ports in analog mode (default) will require a
Byte value representing the average output voltage to the DA port.
The D/A-ports can be programmed for an alternate servo drive function. See chapter CONFIG REGISTER
for informations on use in Servo Mode Writing to the the DA Ports in analog mode (default) will require a
Byte value representing the average output voltage to the DA port.
MyAnalogOut =10
Example for set a DA Port
MATH FUNCTIONS
For Floatingpoint Math Functions (Unit ADVANCED only) see chapter FOATING POINT MODULE
MAX
The MAX function returns the larger one of two byte or word size values.
MAX
The MAX function returns the larger one of two byte or word size values.
MyWord=MAX(MyByte1,MyByte2)
Syntax: Variable = Max(value1, value2)
Variable: Variable of Byte oder Word type
value1 Variable, value oder constant of Byte oder Word type
value2 Variable, value oder constant of Byte oder Word type
MIN
The MIN function returns the smaller one of two byte or word size values.
Variable: Variable of Byte oder Word type
value1 Variable, value oder constant of Byte oder Word type
value2 Variable, value oder constant of Byte oder Word type
MIN
The MIN function returns the smaller one of two byte or word size values.
MyWord=MIN(MyByte1,MyByte2)
Syntax: Variable = MIN(value1, value2)
Variable: Variable of Byte oder Word type
value1: Variable, value oder constant of Byte oder Word type
value2: Variable, value oder constant of Byte oder Word type
Variable: Variable of Byte oder Word type
value1: Variable, value oder constant of Byte oder Word type
value2: Variable, value oder constant of Byte oder Word type
16