
Control Programming
•
23
3.4 Programming for PET-48DIO
According to the description of above sections, you can understand
how to program the PET-48DIO easily. Partial of Assembly and C
programs will be listed below, and a complete C source program for
timer pacer interrupt of PET-48DIO is included.
If you need more high level Application Programming Interface (API)
library in C Language, you can get it from our software package
ACLS-DLL1. Both Windows DLL driver and DOS software driver of the
PET-48DIO will be included in the ACLS-DLL1. Please contact your
dealer of ADLINK products.
3.4.1
Programming in Assembly Langrage
The following parts are example programs written in assemble for
reference.
To initial I/O ports
MOV
DX , INDEX
; DATA OF INDEX SAME AS I/O
; ADDRESS THAT SET BY SW1
MOV
AL , CTRL0
; CTRL0 = 3H
OUT
DX , AL ; INDEX TO GROUP 0 CONTROL
; WORD
JMP
$+2
; DELAY
INC
DX
; POINT TO DATA READ/WRITE
; ADDRESS
MOV
AL , CW50
; CONTROL WORD REFER TO
; TABLE OF CONTROL WORD
OUT
DX , AL ; PROGRAM GROUP 0 I/O
JMP
$+2
; DELAY
DEC
DX
; POINT TO INDEX ADDRESS
MOV
AL , CTRL1
; CTRL1 = 7H
OUT
DX , AL ; INDEX TO GROUP 1 CONTROL
; WORD
JMP
$+2
; DELAY
INC
DX
; POINT TO DATA READ/WRITE
; ADDRESS
MOV
AL , CW51
; CONTROL WORD REFER TO
;TABLE OF CONTROL WORD
OUT
DX , AL ; PROGRAM GROUP 1 I/O
JMP
$+2
Содержание PET-48DIO
Страница 1: ...NuDAQ PET 48DIO Programmable 48 bit DIO Event and Timer Cards User s Guide...
Страница 2: ......