Herunterladen Inhalt Inhalt Diese Seite drucken

Programmierbeispiele - Scanlab RTC 5 Installation Und Inbetriebnahme

Inhaltsverzeichnis

Werbung

Programmierbeispiele

Die folgenden Programmierbeispiele sind in PASCAL geschrieben.
(1) Bestätige ein 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) Wenn die vier niederwertigen Bits des Digital-Eingangs den Wert (0110) haben, dann setze Bit #1 des
16-Bit-Digital-Ausgangs, sonst setze Bit #1 zurück:
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) Wähle unter 15 kleinen Unterprogrammen an definierten Speicheradressen aus:
...
for i := 1 to 15 do
list_call_cond(i, 15-i, i*100);
...
(4) Wähle unter 15 indizierten Unterprogrammen aus:
...
for i := 1 to 15 do
sub_call_cond(i, 15-i, i);
...
®
®
RTC
5 PCI-Karte, RTC
5 PCI-Express-Karte, RTC
Rev. 1.10 d
9 Programmierung von Peripherie-Schnittstellen
®
5 command uses relative addresses and is relocatable
®
5 command uses relative addresses and is relocatable
®
5 PC/104-Plus-Karte, RTC
// 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
®
5 PCIe/104-Karte
237

Werbung

Inhaltsverzeichnis
loading

Inhaltsverzeichnis