Upload
others
View
5
Download
0
Embed Size (px)
Citation preview
ACROSSER TECHNOLOGY 1
TABLE OF CONTENTS
GeneralFeatures ........................................................... 5AR-B6016 Block Diagram ................................ 6Introduction........................................................ 7Board Layout .................................................... 8I/O Port Configuration & Model No. .................... 9Input/Output L.E.D. Indicators ............................ 9Pinout of SPDT Relay Output Connector ........... 11Pinout of OPTO Input Connector ........................ 12Configuration of OPTO Input Channel ................ 13JP4 Jumper (Voltage Selection) ........................ 13Application Block Diagrams .............................. 14
Dip Switch SettingsSW1 Setting the I/O Base Port .......................... 18Definition of Port Addresses ............................. 19SW2 Setting the IRQ ......................................... 20
Controlling the I/O ChannelsR/W I/O Port Directly ......................................... 21R/W I/O Port using Software Commands ........... 22
Software Commands
A. System Commands1. No Operation (00h) ........................................ 232. Get BIOS Version (01h) ................................. 24
2 ACROSSER TECHNOLOGY
3. Get Card Model Number (02h) ...................... 254. Get I/O Direction Byte (03h) ........................... 265. Set I/O Direction Byte (04h) ........................... 276. Reset (0Ch)................................................... 287. Set I/P Debounce Time (10h) ........................ 298. Set Watchdog Delay (11h) ............................ 309. Disabling Watchdog Delay (12h) ................... 31
B. D/I & D/O Commands1. Reset Bit (20h) .............................................. 322. Set Bit (21h) .................................................. 333. Not Bit (22h) .................................................. 344. Read Bit (23h) ............................................... 355. Write Port Data (24h) .................................... 366. Read Port Data (25h) .................................... 377. Active Port Data (26h) ................................... 388. Deactivate Port Data (27h) ............................ 39
C. Advanced D/I & D/O Commands1. Set Input Trigger (30h) ................................... 402. Set Bit Output Delay ON/OFF (31h) ............... 433. Set and Enable Square Wave Output (32h) ... 444. Disable Square Wave Output (33h) ............... 46
Error/Echo Status CodesEcho Status Code ............................................. 47Error Codes ...................................................... 48
ACROSSER TECHNOLOGY 3
Copyrighted 1992 by Acrosser Technology. All rightsreserved. No part of this publication may be repro-duced, transmitted, transcribed, stored on a retrievalsystem or translated into any language or computerlanguage, in any form or by any means, electronic,mechanical, magnetic, optical, chemical, manual orotherwise without the prior written permission ofAcrosser Technology.
ACROSSER, IBM, IBM PC/AT & MS-DOSARE REGISTERED TRADEMARKS.
Printing VersionEdition 1.2 Sep 8, 1992
ACROSSER Technology reserves the right to revisethis publication and to make changes from time to timein the contents hereof without obligation of ACROSSERTechnology to notify any person of such revision orchanges.
COPYRIGHT NOTICE
DISCLAIMER
4 ACROSSER TECHNOLOGY
TECHNICAL SUPPORT ANDUSER COMMENTS
User comments are always welcome as they assist usin improving the usefulness of our products and theunderstanding of our publications. They form a veryimportant part of the input used for product enhance-ments and revision.
We may use and distribute any of the information yousupply in any way we believe appropriate withoutincurring any obligations.
Please send your comments to:
Acrosser TechnologyAttn: Customer Support Manager10 FL, No. 63, Ho-Ping E. Rd., Sec. 3,Taipei, Taiwan R.O.C.
Tel: (886-2) 735-9041Fax: (886-2) 735-0431
ACROSSER TECHNOLOGY 5
n 16 Photo coupled isolated input channels.
n 4 SPDT RELAY output channels.
n 5VDC to 24VDC input range.
n Mutliple various input interface selections.
n 2.5A & 125V AC/DC maximum for each relaycontact and 30W DC or 60 VA AC maximum.
n Varister installed for each output to prevent it fromover voltage.
n On-board single chip processor with watchdogtimer.
n Built-in intelligent BIOS with 8K bytes of SRAMdata space.
n I/O handshake method used between host com-puter and the AR-B6016.
n Wait and interrupt circuit for real time I/O process.
n Rechargeable battery for SRAM data retention.
FEATURES
6 ACROSSER TECHNOLOGY
nEasy for software development.
n Supports many language libraries and exampleprograms.
n On-board BIOS provides multi-I/O functions suchas RESET, SET BIT, RESET BIT, NOT BIT,READ BIT, READ PORT, WRITE PORT, ACTIVEPORT, DEACTIVE PORT, TIME DELAY ON/OFF,WATCHDOG DELAY, INPUT DEBOUNCE, IN-PUT TRIGGER, INPUT QUEUE AND SQUAREWAVE OUTPUT.
n Provides download related I/O process commandinto 8K bytes SRAM for real time operation di-rectly. (Available on version 2.0)
ACROSSER TECHNOLOGY 7
INTRODUCTION
The AR-B6016 is an intelligent TTL I/O card. It is onecard in the AR-B6000 series of single on-board pro-cessor I/O cards developed by Acrosser Technology.All of the cards in this series operate in combinationwith easy to use, high performance, industrial I/Osoftware.
The AR-B6016 card provides many I/O functions toreduce the host computer's workload. It has beendesigned to allow the host computer to read inputs orwrite outputs directly. Another important feature of theAR-B6016 card is that it has been specifically de-signed for easy software development. You may wishto write software commands to instruct the on-boardprocessor of how to handle special I/O operations.
For input signal control, the AR-B6016 card can be setto quickly poll all input signals and, if necessary,debouce the signal with a software command. TheAR-B6016 can generate an interrupt request signal tothe host computer to indicate an input signal wasactivated, thus instructing the host computer that itdoes not need to wait or poll for a signal.
8 ACROSSER TECHNOLOGY
For output signal control, the AR-B6016 card supportssafety output functions. (If you have pre-programmedany into your I/O control software. This is an importantfeature because it gives you the ability to control theoutput signals even if the host computer hangs-up, thusavoiding possible dangereous output situations.
In real time response operation, the AR-B6016 cansupport relative I/O operation commands which havebeen previously downloaded onto the on-board SRAM(battery backed-up) from the host computer. If thisfunction is used, most I/O operations will directly sharethe on-board processor without the host computer'sjudgement.(Available on version 2.0)
AR-B6016 BOARD DIAGRAM
ACROSSER TECHNOLOGY 9
I/O PORT CONFIGURATION & MODEL NUMBER
port 1 : Photo coupled input port (channel 1 to 8)port 2 : Photo coupled input port (channel 9 to 16)port 3 : Photo coupled input port (channel 17 to 20)
(Note: Channels 17 to 24 are not used.)port 4: Not used
Model Number = 02h (The AR-B6016 card)
INPUT/OUTPUT L.E.D. INDICATORS
Photo coupled input indicatorsLI1 LED : channel 1 indicator ON for activeLI2 LED : channel 2 indicator ON for activeLI3 LED : channel 3 indicator ON for activeLI4 LED : channel 4 indicator ON for activeLI5 LED : channel 5 indicator ON for activeLI6 LED : channel 6 indicator ON for activeLI7 LED : channel 7 indicator ON for activeLI8 LED : channel 8 indicator ON for activeLI9 LED : channel 9 indicator ON for activeLI10 LED : channel 10 indicator ON for activeLI11 LED : channel 11 indicator ON for activeLI12 LED : channel 12 indicator ON for activeLI13 LED : channel 13 indicator ON for activeLI14 LED : channel 14 indicator ON for activeLI15 LED : channel 15 indicator ON for activeLI16 LED : channel 16 indicator ON for active
10 ACROSSER TECHNOLOGY
SPDT Relay output indicators
RL1 LED : SPDT relay 1 (channel 17) ON for activeRL2 LED : SPDT relay 2 (channel 18) ON for activeRL3 LED : SPDT relay 3 (channel 19) ON for activeRL4 LED : SPDT relay 4 (channel 20) ON for active
LED 1 : ON when host computer reads or writes to theAR-B6016 card.
Configuration of SPDT relay output channel
ACROSSER TECHNOLOGY 11
PINOUT OF SPDT RELAY OUTPUTCONNECTOR (DB1, D-TYPE 37 PIN)
01 \20 Normal close of relay 1
02 /21 \
03 Normal open of relay 122 /
04 \23 Common of relay 1
05 /24 \
06 Normal close of relay 225 /
07 \26 Normal open of relay 2
08 /27 \
09 Common of relay 228 /
10 \29 Normal close of relay 3
11 /30 \
12 Normal open of relay 331 /
13 \32 Common of relay 3
14 /33 \
15 Normal close of relay 434 /
16 \35 Normal open of relay 4
17 /36 \
18 Common of relay 437 /
19 No connect
DB1
12 ACROSSER TECHNOLOGY
PINOUT OF OPTO INPUT CONNECTOR(CN-1, DIN-40-PIN)
1 ��> IP1+ 2 ��> IP1- 3 ��> IP2+ 4 ��> IP2- 5 ��> IP3+ 6 ��> IP3- 7 ��> IP4+ 8 ��> IP4- 9 ��> IP5+10 ��> IP5-11 ��> IP6+12 ��> IP6-13 ��> IP7+14 ��> IP7-15 ��> IP8+16 ��> IP8-17 ��> IP9+18 ��> IP9-19 ��> IP10+20 ��> IP10-21 ��> IP11+22 ��> IP11-23 ��> IP12+24 ��> IP12-25 ��> IP13+26 ��> IP13-27 ��> IP14+28 ��> IP14-29 ��> IP15+30 ��> IP15-31 ��> IP16+32 ��> P16-
33 - 33 ��> External V-
37 - 40 ��> External V+
CN-1
ACROSSER TECHNOLOGY 13
Configuration of OPTO Input Channel
Jumper Selection of OPTO Input ChannelM1 : OPTO input channel 1M2 : OPTO input channel 2M3 : OPTO input channel 3M4 : OPTO input channel 4M5 : OPTO input channel 5M6 : OPTO input channel 6M7 : OPTO input channel 7M8 : OPTO input channel 8M9 : OPTO input channel 9M10 : OPTO input channel 10M11 : OPTO input channel 11M12 : OPTO input channel 12M13 : OPTO input channel 13M14 : OPTO input channel 14M15 : OPTO input channel 15M16 : OPTO input channel 16
8 7 6 5
1 2 3 4
8 7 6 5
1 2 3 4
All pins open to select external voltage.
Pin 1-8, pin 2-7, pin 3-6 and pin 4-5are all short to select internal +12VDCfor detect power.JP4
JP4
JP4 Internal/External Voltage Selection Jumper
14 ACROSSER TECHNOLOGY
Interface of OPTO Input to Detect Different signal
A. Independent Voltage Input
Applications
ACROSSER TECHNOLOGY 15
B. Common Ground Voltage Input
Application 1:Use external voltage (V+) interface to dry contact
Application 2:Use internal voltage (+12V) interface to dry contact
16 ACROSSER TECHNOLOGY
C. Actuve Low Input
Application 1:Use external voltage (V+) interface to dry contact
Application 2:Use internal voltage (+12V) interface to dry contact
ACROSSER TECHNOLOGY 17
Application 3:Use external voltage (V+) interface to photo sensor
Application 4:Use internal voltage (+12) interface to photo sensor
18 ACROSSER TECHNOLOGY
DIP SWITCH SETTINGS
There are two DIP switches on the AR-B6016 card.
nSW1 configures the I/O base port.nSW2 configures the interrupt.
SETTING THE I/O BASE PORT ADDRESS
SW1 selects the I/O base port from 200h to 3F8h.Each port address occupies 8 addresses and eachincrement is by 8 addresses. The relationship of eachbit on SW1 to each address bit is indicated below:
Address bus A9 : Always equal to 1Address bus A8 : SW1-6 selected (off=1, on=0)Address bus A7 : SW1-5 selected (off=1, on=0)Address bus A6 : SW1-4 selected (off=1, on=0)Address bus A5 : SW1-3 selected (off=1, on=0)Address bus A4 : SW1-2 selected (off=1, on=0)Address bus A3 : SW1-1 selected (off=1, on=0)Address bus A2,A1,A0 (3 bits) are used to select 8 addresses.
Example 1: Base port address equals 200h.
Example 2: Base port address equals 248h.
Example 3: Base port address equals 3E0h.
ACROSSER TECHNOLOGY 19
DEFINITION OF EACH PORT ADDRESS
To read/write data directly to I/O port:
Base_port+0 : Port 1 of I/O channel (read/write)Base_port+1 : Port 2 of I/O channel (read/write)Base_port+2 : Port 3 of I/O channel (read/write)Base_port+3 : Port 4 of I/O channel (read/write)
For software command handshake:
Base_port+4 : Command byte (write)Base_port+5 : Parameter/data 1 (write)Base_port+6 : Parameter/data 2 (write)Base_port+7 : Parameter/data 3 (write)Base_port+4 : Echo status (read)Base_port+5 : Echo data 1 (read)Base_port+6 : Echo data 2 (read)Base_port+7 : Echo data 3 (read)
20 ACROSSER TECHNOLOGY
SETTING THE IRQ SIGNAL
SW2 sets the IRQ signal. The IRQ signal is used byspecial software commands that are active.
If an urgent condition has just taken place, the AR-B6016 will generate 1 interrupt signal to the hostcomputer to instruct it that something needs to beprocessed immediately.
SW2switch1 switch2 switch3 switch4 switch5 switch6 IRQ
OFF OFF OFF OFF OFF OFF NoneON OFF OFF OFF OFF OFF 2OFF ON OFF OFF OFF OFF 3OFF OFF ON OFF OFF OFF 4OFF OFF OFF ON OFF OFF 5OFF OFF OFF OFF ON OFF 6OFF OFF OFF OFF OFF ON 7
If an interrupt subroutine was serviced, the host com-puter must clear the IRQ signal before it exits thesubroutine. This is done by writing data 80h to baseport+7 address. (base_port+7)
For example in Quick BASIC language, the commandline is written as:
OUT base_port%+7,&h80
ACROSSER TECHNOLOGY 21
CONTROLLING THE I/O CHANNEL
There are two ways to read or write to the I/O channels,one is to read/write to the I/O port directly the other isby using I/O software function commands that aresupported by the AR-B6016 card.
READ/WRITE TO THE I/O PORT DIRECTLY
You can directly read data from or write data to the I/Oport at any time. The read/write operation will not affectany commands that you have activated previously.
For example if you write data 55h to port 1 and readdata from port 3, you would write the following pro-gram: (in BASICA)
100 base_port%=&h200 :REM Initial base port address110 ip_value%=0 :REM Initial input value120 op_value%=&h55 :REM Setting output value130 OUT base_port%+0, op_value%
:REM Output data to port 1140 ip_value%=INP(base_port%+2)
:REM Input data from port 3
22 ACROSSER TECHNOLOGY
READ/WRITE TO THE I/O PORT WITH SOFWARECOMMANDS
If you use the software commands, the host computermust write the command byte and parameters in se-quence, and also read echo status and data.
When the AR-B6016 card accepts a command, (writ-ten by the host computer) it will take some time toprocess the command. It must first acknowledge thehost computer with result status and data. Then thehost must check the echo status reported by the AR-B6016. A standard, completed software handshakeprocess is written below:
Step 1: Write parameter byte 1 to base_port+5(if parameter byte 1 is required)
Step 2: Write parameter byte 2 to base_port+6(if parameter byte 2 is required)
Step 3: Write parameter byte 3 to base_port+7(if parameter byte 3 is required)
Step4: Write command byte to base_port+4 to instruct theAR-B6016 to execute this command start.
Step 5: Check if data in base_port+4 (echo status) is equal to0BBh. If yes, delay for about 200ms, then repeat step5 to re-check.
Step 6: Read data byte 1 from base_port+5(if data byte 1 is required)
Step 7: Read data byte 2 from base_port+6(if data byte 2 is required)
Step 8: Read data byte 3 from base_port+7(if dta byte 3 is required)
ACROSSER TECHNOLOGY 23
SOFTWARE COMMANDS
Echo: base+4 base+5 base+6 base+7
AAh -- -- --
A. SYSTEM COMMANDS
1. NO OPERATION (command byte=00h)
This command is used to check if there is a AR-B6016 card in your system. It does not perform anyother function.
Example: (in BASICA)
830 OUT base_port%+4,&h00 840 FOR i=1 to 40 850 echo_status%=INP (base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 910 ..................... :REM Normal process ...1000........................ :REM Error process
Format: base+4 base+5 base+6 base+7
00h -- -- --
24 ACROSSER TECHNOLOGY
2. GET BIOS VERSION (01h)
The function is used to find out the on-board BIOSversion. You can then determine what commands areavailable and how to best program your AR-B6016card.
Format: base+4 base+5 base+6 base+7
01h -- -- --
Example: (in BASICA)
830 OUT base_port%+4, &h01 840 FOR i=1 to 40 850 echo_status%=INP(base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 880 version%=INP(base_port%+5) 910 ................... :REM Normal process ...1000 .................. :REM error process
Echo: base+4 base+5 base+6 base+7
AAh xy -- --
If xy = 20h, the version is 2.0
ACROSSER TECHNOLOGY 25
3. GET CARD MODEL NUMBER (02h)
Use this command to find out which AR-B6000 seriescard is configured at the current I/O port address.
Example: (in BASICA)
830 OUT base_port%+4, &h02 840 FOR i=1 to 40 850 echo_status%=INP (base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 880 model_no%=INP(base_port%+5) 910 ................... :REM Normal process ...1000 .................. :REM error process
Echo: base+4 base+5 base+6 base+7
AAh xy -- --
Format: base+4 base+5 base+6 base+7
02h -- -- --
If xy = 32h, then the card is model no. 02h.(x = doesn't matter)
26 ACROSSER TECHNOLOGY
4. GET I/O DIRECTION BYTE (03h)
This command will help you determine which I/O port isthe input port and which I/O port is the output port.
Echo: base+4 base+5 base+6 base+7
AAh xy -- --
Format: base+4 base+5 base+6 base+7
03h -- -- --
Example: (in BASICA)
830 OUT base_port%+4, &h03 840 FOR i=1 to 40 850 echo_status%=INP (base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 880 direction%=INP(base_port%+5) 910 ................... :REM Normal process ...1000 .................. :REM error process
If xy = 56h, then the direction byte is 6h.(x = doesn't matter)
bit_3 bit_2 bit_1 bit_00 1 1 0
Port 1 is outputport
Port 2 is input portPort 3 is input port
ACROSSER TECHNOLOGY 27
5. SET I/O DIRECTION BYTE (04h)
When power is on, the I/O direction byte is equal to 0ffh.This means that the 4 I/O ports will all be input ports.You can change the I/O direction using thiscommand.
Echo: base+4 base+5 base+6 base+7
AAh -- -- --
If xy = 29h, then the direction byte is 9h.(x = doesn't matter)
Format: base+4 base+5 base+6 base+7
04h xy -- --
bit_3 bit_2 bit_1 bit_01 0 0 1
Port 1 is input portPort 2 is output
portPort 3 is output
portPort 4 is input portExample: (in BASICA)
800 OUT base_port%+5,direction% 830 OUT base_port%+4, &h04 840 FOR i=1 to 40 850 echo_status%=INP (base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 910 ................... :REM Normal process ...1000 .................. :REM error process
28 ACROSSER TECHNOLOGY
6. RESET (0Ch)
The reset command is used to reintialize the AR-B6016 card. After reset, the card will return to thesame status as the initial power on. It will:
n Set all I/O direction to input.n Set all output channels to 0.
(output is TTL level low)n Deactivate all software commands that were
previously activated.n Clear all data in the data buffer or queue.
Example: (in BASICA)
830 OUT base_port%+4, &h0C 840 FOR i=1 to 40 850 echo_status%=INP (base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 910 ................... :REM Normal process ...1000 .................. :REM error process
Echo: base+4 base+5 base+6 base+7
AAh -- -- --
Format: base+4 base+5 base+6 base+7
0Ch -- -- --
ACROSSER TECHNOLOGY 29
7. SET I/P DEBOUNCE TIME (10h)
This command is used to clear the bounce of the inputsignals.
Example: (in BASICA)
800 OUT base_port%+5, debounce_time% 830 OUT base_port%+4, &h10 840 FOR i=1 to 40 850 echo_status%=INP (base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 910 ................... :REM Normal process ...1000 .................. :REM error process
Echo: base+4 base+5 base+6 base+7
AAh -- -- --
Format: base+4 base+5 base+6 base+7
10h tt -- --
The time resolution is 10 ms. If tt = 0Ah, thedebounce time will be 10 ms x 10 = 100 ms.If the value of tt = 00h, it will disable the I/Pdebounce function.
30 ACROSSER TECHNOLOGY
8. SET WATCHDOG DELAY (11h)
In some control systems it is very dangerous if there isa problem with the host computer, such as a systemhang-up, when the outputs signals are active and cannot be controlled.To avoid this condition, you can instruct the on-boardprocessor to watch for output signals and start thetimer. If the timer is not continuously re-triggered at aspecified rate of time it will signal a timeout and theoutputs will revert to a pre-specified state that the hostcomputer expects.
tt = timeout during (00h-ffh)cc = channel number (01h-20h)The time resolution is 1 second. If tt = 0Ah andcc = 01h, the timer will be set to 1 second x 10 =10 seconds.When 10 seconds is the timeout, channel 1 (port1, bit 0) will be ON (active), the others will be OFF(deactive).If the value of tt = 00h, it is a 256 seconds timeout.(maximum)
Echo: base+4 base+5 base+6 base+7
AAh -- -- --
Format: base+4 base+5 base+6 base+7
11h tt cc --
ACROSSER TECHNOLOGY 31
Example: (in BASICA) 800 OUT base_port%+5, timeout% 810 OUT base_port%+6,on_channel% 830 OUT base_port%+4, &h11 840 FOR i=1 to 40 850 echo_status%=INP (base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 910 ................... :REM Normal process ...1000 .................. :REM error process
Example: (in BASICA)
830 OUT base_port%+4, &h12 840 FOR i=1 to 40 850 echo_status%=INP (base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 910 ................... :REM Normal process ...1000 .................. :REM error process
Echo: base+4 base+5 base+6 base+7
AAh -- -- --
Format: base+4 base+5 base+6 base+7
12h -- -- --
9. DISABLING WATCHDOG DELAY
32 ACROSSER TECHNOLOGY
B. D/I, D/O COMMAND (20h-2fh)
1. RESET BIT (20h)
The function of this command is used to clear the status(deactivate, TTL low) of any output channel.
Echo: base+4 base+5 base+6 base+7
AAh -- -- --
Format: base+4 base+5 base+6 base+7
20h cc -- --
Example: (in BASICA)
800 OUT base_port%+5,channel_no% 830 OUT base_port%+4, &h20 840 FOR i=1 to 40 850 echo_status%=INP (base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 910 ................... :REM Normal process ...1000 .................. :REM error process
cc = channel no. (01h thru 20h, 32 channels max)If the value cc = 00h, then all output channels areOFF.
ACROSSER TECHNOLOGY 33
Example: (in BASICA)
800 OUT base_port%+5,channel_no% 830 OUT base_port%+4, &h21 840 FOR i=1 to 40 850 echo_status%=INP (base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 910 ................... :REM Normal process ...1000 .................. :REM error process
2. SET BIT (21h)
This command sets the status (active, TTL level high)of any output channel.
Echo: base+4 base+5 base+6 base+7
AAh -- -- --
Format: base+4 base+5 base+6 base+7
21h cc -- --
cc = channel no. (01h thru 20h, 32 channels max)If the value cc = 00h, then all output channels areON.
34 ACROSSER TECHNOLOGY
3. NOT BIT (22h)
This command is used to change the status of anyoutput channel to the inverse state.
Echo: base+4 base+5 base+6 base+7
AAh -- -- --
Format: base+4 base+5 base+6 base+7
22h cc -- --
Example: (in BASICA)
800 OUT base_port%+5,channel_no% 830 OUT base_port%+4, &h22 840 FOR i=1 to 40 850 echo_status%=INP(base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 910 ................... :REM Normal process ...1000 .................. :REM error process
cc = channel no. (01h thru 20h,32 channels max)If the value of cc = 00h, then all output channelswill be changed.
ACROSSER TECHNOLOGY 35
4. READ BIT (23h)
This command is to read back the status of any inputor output channel.
Echo: base+4 base+5 base+6 base+7
AAh xx -- --
Format: base+4 base+5 base+6 base+7
23h cc -- --
Example: (in BASICA)
800 OUT base_port%+5,channel_no% 830 OUT base_port%+4, &h23 840 FOR i=1 to 40 850 echo_status%=INP(base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 880 channel_status%=INP(base_port%+5) 910 ................... :REM Normal process ...1000 .................. :REM error process
cc = channel no. (01h thru 20h, 32 channels max)If the specified bit is ON, then the value of xx=31h.If the specified bit is OFF, then the value xx=30h.
36 ACROSSER TECHNOLOGY
5. WRITE PORT DATA (24h)
This command is used to write data to any output port.New data will cover the old status of this port.
Echo: base+4 base+5 base+6 base+7
AAh -- -- --
Format: base+4 base+5 base+6 base+7
24h pp dd --
pp = port number (01h thru 04h, 4 ports max)dd = 8 bit data write out.If the value of pp=00h, then all ports will be affected.
Example: (in BASICA)
800 OUT base_port%+5,port_no% 810 OUT base_port%+6,port_data% 830 OUT base_port%+4, &h24 840 FOR i=1 to 40 850 echo_status%=INP (base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 910 ................... :REM Normal process ...1000 .................. :REM error process
For example, if dd=40h, then:bit 7 6 5 4 3 2 1 040h 0 1 0 0 0 0 0 00=OFF, 1=ON
ACROSSER TECHNOLOGY 37
6. READ PORT DATA (25h)
This command is used to read back data from anyinput or output port.
Echo: base+4 base+5 base+6 base+7
AAh dd -- --
Format: base+4 base+5 base+6 base+7
25h pp -- --
pp = port number (01h thru 04h, 4 ports max.)dd = 8 bit data read in.For example, if dd=20h, then:bit 7 6 5 4 3 2 1 020h 0 0 1 0 0 0 0 00=OFF, 1=ON
Example: (in BASICA)
800 OUT base_port%+5,port_no% 830 OUT base_port%+4, &h25 840 FOR i=1 to 40 850 echo_status%=INP(base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 880 port_data%=INP(base_port%+5) 910 ................... :REM Normal process ...1000 .................. :REM error process
38 ACROSSER TECHNOLOGY
7. ACTIVE PORT DATA (26h)
This command is used to turn ON output channels ofany output port. Channels specified will be ON, otherchannels will not be affected.
Echo: base+4 base+5 base+6 base+7
AAh -- -- --
Format: base+4 base+5 base+6 base+7
26h pp dd --
pp = port number (01h thru 04h, 4 ports max.)dd = 8 bits data to specify bits to be active.If the value pp = 00h, then all ports will be affected.For example, if dd=56h, then:bit 7 6 5 4 3 2 1 056h 0 1 0 1 0 1 1 0Bit 1,2,4,6 will be set ON, others will not be affected.
Example: (in BASICA)
800 OUT base_port%+5,port_no% 810 OUT base_port%+6,port_data% 830 OUT base_port%+4, &h26 840 FOR i=1 to 40 850 echo_status%=INP (base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 910 ................... :REM Normal process ...1000 .................. :REM error process
ACROSSER TECHNOLOGY 39
Echo: base+4 base+5 base+6 base+7
AAh -- -- --
Format: base+4 base+5 base+6 base+7
27h pp dd --
8. DEACTIVATE PORT DATA (27h)
This command is used to turn OFF output channels ofany output port. Channels specified will be OFF, otherchannels will not be affected.
pp = port number (01h thru 04h, 4 ports max.)dd = 8 bits data to specify bits to be deactivated.If the value pp = 00h, then all ports will be affected.For example, if dd=9Eh, then:bit 7 6 5 4 3 2 1 056h 1 0 0 1 1 1 1 0Bit 1,2,3,4,7 will be set ON, others will not be affected.
Example: (in BASICA)
800 OUT base_port%+5,port_no% 810 OUT base_port%+6,port_data% 830 OUT base_port%+4, &h27 840 FOR i=1 to 40 850 echo_status%=INP (base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 910 ................... :REM Normal process ...1000 .................. :REM error process
40 ACROSSER TECHNOLOGY
C. ADVANCED D/I & D/O COMMANDS (30h-3Fh)
1. SET INPUT TRIGGER (30h)
This command will affect all input channels and autosave the channel's data, if triggered, to the queuebuffer. If set for a positive trigger, when the inputchanges from low to high (0 > 1), the on-boardprocessor will allow the data to be valid and save it.
Echo: base+4 base+5 base+6 base+7
AAh -- -- --
Format: base+4 base+5 base+6 base+7
30h xx -- --
xx = 01h : Enables positive trigger.xx = 10h : Enables negative trigger.xx = 0CCh : Disables and clears all data in
queue buffer.xx = other : Disable function only.
ACROSSER TECHNOLOGY 41
Example: (in BASICA)
800 OUT base_port%+5,trigger_mode% 830 OUT base_port%+4, &h30 840 FOR i=1 to 40 850 echo_status%=INP (base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 910 ................... :REM Normal process ...1000 .................. :REM error process
At any time, you can use the base_port+4 address forreading out valid data that the AR-B6016 card saved.If the byte you retrieved equals zero, then there is nodata. If the retrieved byte equals 0D0h, then the validnegative data is ready in the base_port+5 address. Ifthe retrieved byte equals 0D1h, then the valid positivedata is in the base_port+5 address.
Echo: base+4 base+5 base+6 base+7
D0h cc -- --
D0h : Negative data valid.cc = channel no. (01h thru 20h, 32 channels max)Positive data = Positive triggered data.Negative data = Negative triggered data.
42 ACROSSER TECHNOLOGY
Echo: base+4 base+5 base+6 base+7
D1h cc -- --
Below is a sample program to check and retrievethe input trigger's data: (in BASICA)
850 echo_status&=INP(base_port%+4) 860 IF echo_status%=&hD0 THEN 1100
:REM Negative data valid 870 IF echo_status%=&hD1 THEN 1200
:REM Positive data valid 880 IF echo_status%<>0 THEN 1000 910 ....................... :REM Normal process ...1000 ....................... :REM Error process ...1100 input_data0%=INP(base_port+5)
:REM read out data ...1200 input_data1%=INP(base_port+5)
:REM read out data
D1h : positive data valid.cc = channel no.(01h thru 20h, 32 channels max)
ACROSSER TECHNOLOGY 43
2. SET BIT OUTPUT DELAY ON/OFF (31h)
This command is used to turn ON or OFF the specifiedoutput channel by the host computer. When the timertimes-out, the specific output will be automatically setON or OFF by the on-board processor.
Echo: base+4 base+5 base+6 base+7
AAh -- -- --
Format: base+4 base+5 base+6 base+7
31h cc tt xx
cc = channel no. (01h thru 20h, 32 channels max)If the value of cc = 00h, then all channels areaffected.The time resolution is 100 ms. If tt = 0Ah, thenthe time duration is 100 ms x 10 = 1 second.If the value of tt = 00h, then it is 25.6 seconds(maximum) setting.xx = 01h : Enable & set delay ON when OFF.xx = 10h : Enable & set delay OFF when ON.others : Disables this function.
44 ACROSSER TECHNOLOGY
Example: (in BASICA)
800 OUT base_port%+5,channel_no% 810 OUT base_port%+6,delay_time% 820 OUT base_port%+7,delay_mode% 830 OUT base_port%+4, &h31 840 FOR i=1 to 40 850 echo_status%=INP (base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 910 ................... :REM Normal process ...1000 .................. :REM error process
3. SET & ENABLE CONTINUOUS SQUARE WAVE OUTPUT (32h)
This command is used to generate a continuous squareoutput to a specified channel. The ON & OFF durationtime is software programmable.
Format: base+4 base+5 base+6 base+7
32h cc ss tt
ACROSSER TECHNOLOGY 45
Echo: base+4 base+5 base+6 base+7
AAh -- -- --
Example: (in BASICA)
800 OUT base_port%+5,channel_no% 810 OUT base_port%+6,on_time% 820 OUT base_port%+6,off_time% 830 OUT base_port%+4, &h32 840 FOR i=1 to 40 850 echo_status%=INP (base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 910 ................... :REM Normal process ...1000 .................. :REM error process
cc = channel no. (01h thru 20h, 32 channels max.)If the value of cc = 00h, then all channels will beaffected.ss = ON duration timett = OFF duration timeThe time resolution is 100 ms. If ss = 0Ah,tt = 10h then this channel will be ON 1 second andOFF 1.6 seconds.If the value of ss or tt = 00h, the time duration willbe 25.6 seconds. (maximum)
46 ACROSSER TECHNOLOGY
4. DISABLE SQUARE WAVE OUTPUT (33h)
This command is used to disable the square waveoutput function of a specified channel.
Echo: base+4 base+5 base+6 base+7
AAh -- -- --
Format: base+4 base+5 base+6 base+7
33h cc -- --
Example: (in BASICA)
800 OUT base_port%+5,channel_no% 830 OUT base_port%+4, &h33 840 FOR i=1 to 40 850 echo_status%=INP (base_port%+4) 860 IF echo_status%=&hBB THEN 840 870 IF echo_status%<>&hAA THEN 1000
:REM Checking OK or not? 910 ................... :REM Normal process ...1000 .................. :REM error process
cc = channel no. (01h thru 20h, 32 channels max)If the value cc = 00h, then all channels areaffected.
ACROSSER TECHNOLOGY 47
ECHO STATUS CODE
If, at any time, the host computer reads the I/O addressof base_port+4 (echo status) or if it writes a commandto the AR-B6016, it will get a 1 byte status code. Thisstatus code informs the on-board processor of whataction has occurred.
STATUS CODE LISTINGS
1. 00h : No data2. 0BBh : AR-B6016 is busy processing a
command.3. 0AAh : Data ready and function OK for previous
command.4. 0EEh : An error was detected by the AR-B6016
while processing a command. Base+5 isthe error code.
5. 0D0h : Negative triggered data ready inbase+5, if input's negative triggerfunction is enabled.
6. 0D1h : Positive triggered data ready inbase+5, if input's positive triggerfunction is enabled.
48 ACROSSER TECHNOLOGY
ERROR CODE DEFINITIONS
00hInitial resetAfter intial reset, the first command will be ignored bythe AR-B6016 and will report this error code. It is usedto inform the host computer that the AR-B6016 hasbeen reset. All queue data has been cleared and all I/O functions have been deactivated.
01hCommand errorThis command is not currently available.
02hROM BIOS checksum error. ( maybe modified ordestroyed)
03hParameter byte 1 error (out of range or others).
04hParameter byte 2 error (out of range or others).
05hParameter byte 3 error (out of range or others).
ACROSSER TECHNOLOGY 49
06hTimeout error(If watchdog delay function is enabled)
07hReserved
08hWarning! I/O port does not exist error. Thiscommand will be ignored by the AR-B6016 card.
09hWarning! I/O port not suitable error. This com-mand will be ignored by the AR-B6016 card.
0AhAR-B6016 card may hang up. (If programmers usethe library function call which was provided byAcrosser Technology)
0Bh~FFhReserved
SOFTWARE FUNCTIONSPlease read the file "README.DOC" on the utilitydiskette for details about the latest functions providedwith the AR-B6016 card.
50 ACROSSER TECHNOLOGY