RTC6 boards
Doc. Rev. 1.0.21 en-US
9 Programming Peripheral Interfaces
296
Example Code (Pascal)
(1) Confirm a signal:
set_start_list(1);
…
// set Bit #0 of the 16-bit digital output port
set_io_cond_list(0, 0, 1);
// loop until the signal is confirmed (that is, Bit #0 of the digital input turns HIGH)
list_jump_rel_cond(0, 1, 0);
// clear Bit #0 of the 16-bit output
clear_io_cond_list(0, 0, 1);
// loop until the signal is confirmed
list_jump_rel_cond(1, 0, 0);
…
set_end_of_list;
execute_list(1);
(2) If the lower 4 bits of the digital input have the value (
0110
), set Bit #1 of the 16-bit digital output.
Otherwise clear Bit #1:
set_start_list(2);
…
// RTC4 style: list_jump_cond($0006, $0009, get_input_pointer + 3);
// this command uses absolute addresses and is not relocatable
// the following
RTC6
command uses relative addresses and is relocatable:
// skip the next two commands, if the state
// of the 16-bit input port is (xxxx xxxx xxxx 0110)
// list_jump_rel_cond($0006, $0009, 3);
// clear Bit #1 of the 16-bit output port and…
clear_io_cond_list(0, 0, 2);
//RTC4 style: set_list_jump(get_input_pointer + 2);
//this command uses absolute addresses and is not relocatable
//the following
RTC6
command uses relative addresses and is relocatable
//…skip the next command
list_jump_rel(2);
// set Bit #1 of the 16-bit output port
set_io_cond_list(0, 0, 2);
// (continue)
…
set_end_of_list;
execute_list(2);
…
bit1 := (get_io_status AND $0002) // returns the current state of Bit #1