Programming Examples
The following programming examples are written in PASCAL.
(1) Confirm a signal:
set_start_list(1);
...
set_io_cond_list(0, 0, 1);
list_jump_rel_cond(0, 1, 0);
clear_io_cond_list(0, 0, 1);
list_jump_rel_cond(1, 0, 0);
...
set_end_of_list;
execute_list(1);
(2) If the lower four bits of the digital input have the value (0110), set bit #1 of the 16-bit digital output,
otherwise clear it:
set_start_list(2);
...
®
//RTC
4 style: list_jump_cond($0006, $0009, get_input_pointer + 3);
//this command uses absolute addresses and is not relocatable
//the following RTC
list_jump_rel_cond($0006, $0009, 3);
clear_io_cond_list(0, 0, 2);
®
//RTC
4 style: set_list_jump(get_input_pointer + 2);
//this command uses absolute addresses and is not relocatable
//the following RTC
list_jump_rel(2);
set_io_cond_list(0, 0, 2);
...
set_end_of_list;
execute_list(2);
...
bit1 := (get_io_status AND $0002)
(3) Choose between 15 small subroutines at defined memory addresses:
...
for i := 1 to 15 do
list_call_cond(i, 15-i, i*100);
...
(4) Choose between 15 indexed subroutines:
...
for i := 1 to 15 do
sub_call_cond(i, 15-i, i);
...
®
RTC
5 PC Interface Board
Rev. 1.9 e
9 Programming Peripheral Interfaces
®
5 command uses relative addresses and is relocatable
®
5 command uses relative addresses and is relocatable
// set bit #0 of the 16-bit digital output port
// loop until the signal is confirmed
// (i.e. bit #0 of the digital input turns HIGH)
// clear bit #0 of the 16-bit output
// loop until the signal is confirmed
// skip the next two commands if the state
// of the 16-bit input is (xxxx xxxx xxxx 0110)
// clear bit #1 of the 16-bit output and ..
// .. skip the next command
// set bit #1 of the 16-bit output
// (continue)
// returns the current state of bit #1
// call subroutine at address i*100
// if [bit #3...bit #0] (binary) = i
// call subroutine with index i
// if [bit #3...bit #0] (binary) = i
214
Need help?
Do you have a question about the RTC 5 PC Interface Board and is the answer not in the manual?