User manual
ConfigIOchipAsOutput(0);
UpdateIOdataArray(0,204);
// 204 is in binary format 11001100
// this sets channels 3,4,7,8 and clears channels 1,2,5,6
END;
ClearIOchArray IO
Syntax
PROCEDURE ClearIOchArray(Channel_no: Longint);
Parameter
Channel_no: Value between 1 and 64 which corresponds to the Input/Output channel that is to
be cleared.
Result
IOdata: If selected channel is an output then the correct bit in the 'IOdata' variable of the
corresponding chip is set low (0).
Description
The status of the Input/Output ports is held in the 'IO data' variable. Each bit of this variable
corresponds to the status of an IO-channel. If a particular output of the IO-chip is to be cleared
then it is not advisable to immediately set the corresponding bit in the 'IOdata' variable to low. If
the selected channel has been configured as an input then its status would no longer correspond
to the physical status. In order to avoid such conflict this procedure must be used.
Note that the 'IOdata' variable is just a buffer memory. When its value is changed the outputs do
not immediately change status. This only occurs when this value is sent to the IO-chip.
Example
BEGIN
ConfigIOchipAsOutput(0);
ConfigIOchannelAsInput(1); {channel 1 configured as input}
ConfigIOchannelAsInput(2); {channel 2 configured as input}
ConfigIOchannelAsInput(3); {channel 3 configured as input}
ConfigIOchannelAsInput(4); {channel 4 configured as input}
ClearIOchArray(2); // Clear channel 2 from IOdata array
// The status of the inputs stays unchanged
ClearIOchArray(8); // Clear channel 8 from IOdata array
END;
ClearIOdataArray IO
Syntax
PROCEDURE ClearIOdataArray(Chip_no: Longint);
Parameter
Chip_no: Value between 0 and 7 which corresponds to the address setting of the Input/Output
chip in which the outputs are to be cleared.