Sensoray 518 User manual

Artisan Technology Group is your source for quality
new and certied-used/pre-owned equipment
• FAST SHIPPING AND
DELIVERY
• TENS OF THOUSANDS OF
IN-STOCK ITEMS
• EQUIPMENT DEMOS
• HUNDREDS OF
MANUFACTURERS
SUPPORTED
• LEASING/MONTHLY
RENTALS
• ITAR CERTIFIED
SECURE ASSET SOLUTIONS
SERVICE CENTER REPAIRS
Experienced engineers and technicians on staff
at our full-service, in-house repair center
WE BUY USED EQUIPMENT
Sell your excess, underutilized, and idle used equipment
We also offer credit for buy-backs and trade-ins
www.artisantg.com/WeBuyEquipment
REMOTE INSPECTION
Remotely inspect equipment before purchasing with
our interactive website at www.instraview.com
LOOKING FOR MORE INFORMATION?
Visit us on the web at www.artisantg.com for more
information on price quotations, drivers, technical
specications, manuals, and documentation
Contact us: (888) 88-SOURCE | sales@artisantg.com | www.artisantg.com
SM
View
Instra

Sensoray Model 518
PC104 Sensor Coprocessor
Revised June 9, 1997
INSTRUCTION MANUAL
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Chapter Table of Contents
Chapter 1: Basics . . 1
Limited Warranty . . 1
Special Handling Instructions . . 1
Chapter 2: Introduction . . 2
Functional Description . . 2
Specifications . . 3, 4
Chapter 3: Hardware Configuration . . 5
Interrupts . . 5
Port Mapping . . 5, 6
Hardware Filters. . 7
Chapter 4: Programming . . 8
Programming Model . . 8
Status Register . . 8
Control Register . . 9
Sample Low-level Drivers . . 10
Commands . . 12
Declare Channel Sensor . . 13
Set Filter Time Constant . . 14
Read Board Temperature . . 15
Read Channel Data . . 16
Read Data From All Channels . . 17
Set Channel Alarm Limits . . 18
Set Open Sensor Data Values . . 19
Read Alarm Flags . . 20
Set Gage Zero . . 21
Set Gage Span . . 22
Tare Gage . . 23
Read Gage Calibration . . 24
Set Gage Calibration . . 25
High Speed Mode . . 26
Low Power Standby . . 27
Read Firmware Version . . 28
Read Product I.D. . . 29
Set Coefficients . . 30
Calibrate 518 . . 32
Sensor Tables . . 33
Back Compatibility . . 34
Chapter 5: Sensor Connections . . 35
RTDs and Resistors . . 35
Thermocouple and DC Voltage . . 36
Thermistor/Custom Resistive Sensors . . 37
Strain and Pressure Gages . . 38
4 to 20 mA Current Loops . . 38
Chapter 6: Sensor Specifics . . 39
User-defined Resistive Sensors . . 39
Application Example . . 39
Thermocouples . . 40
Verifying Thermocouple Calibration . . 41
Strain and Pressure Gages . . 42
Measurement Resolution . . 42
Calibration . . 43
Chapter 7: Theory of Operation . . 45
Software . . 45
Scanner . . 45
Post-processor . . 45
Command Processor . . 46
Hardware . . 46
Reference Section . . 46
Measurement Section . . 46
Excitation Section . . 47
Timing . . 47
Scan Rate . . 47
Communication Latency . . 48
Processor Speed . . 49
Chapter 8: Command Summary . . 51
Chapter 9: Schematics . . 55
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Chapter
1Basics 1
Limited Warranty
Sensoray Company, Incorporated (Sensoray) warrants the model 518 hardware to be free from defects in
material and workmanship and perform to applicable published Sensoray specifications for two years from
the date of shipment to purchaser. Sensoray will, at its option, repair or replace equipment that proves to be
defective during the warranty period. This warranty includes parts and labor.
The warranty provided herein does not cover equipment subjected to abuse, misuse, accident, alteration,
neglect, or unauthorized repair or installation. Sensoray shall have the right of final determination as to the
existence and cause of defect.
As for items repaired or replaced under warranty, the warranty shall continue in effect for the remainder of
the original warranty period, or for ninety days following date of shipment by Sensoray of the repaired or
replaced part, whichever period is longer.
A Return Material Authorization (RMA) number must be obtained from the factory and clearly marked on
the outside of the package before any equipment will be accepted for warranty work. Sensoray will pay the
shipping costs of returning to the owner parts which are covered by warranty.
Sensoray believes that the information in this manual is accurate. The document has been carefully reviewed
for technical accuracy. In the event that technical or typographical errors exist, Sensoray reserves the right to
make changes to subsequent editions of this document without prior notice to holders of this edition. The
reader should consult Sensoray if errors are suspected. In no event shall Sensoray be liable for any damages
arising out of or related to this document or the information contained in it.
EXCEPT AS SPECIFIED HEREIN, SENSORAY MAKES NO WARRANTIES, EXPRESS OR IMPLIED,
AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR
A PARTICULAR PURPOSE. CUSTOMER’S RIGHT TO RECOVER DAMAGES CAUSED BY FAULT
OR NEGLIGENCE ON THE PART OF SENSORAY SHALL BE LIMITED TO THE AMOUNT
THERETOFORE PAID BY THE CUSTOMER. SENSORAY WILL NOT BE LIABLE FOR DAMAGES
RESULTING FROM LOSS OF DATA, PROFITS, USE OF PRODUCTS, OR INCIDENTAL OR
CONSEQUENTIAL DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
Special Handling Instructions
The Model 518 circuit board contains CMOS circuitry that is sensitive to Electostatic
Discharge (ESD). Special care should be taken in handling, transporting, and installing the
518 to prevent ESD damage to the board. In particular:
1. Do not remove the 518 from its protective antistatic bag until you are ready to con-
figure the board for installation.
2. Handle the 518 only at grounded, ESD protected stations.
3. Remove power from the PC104 bus before installing or removing the 518 circuit
board
All brand, product, and company names are trademarks or registered trademarks of their respective owners.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Chapter
2Introduction 2
Functional Description
The 518 interfaces eight process sensors directly to the PC104 bus. Each of the eight
sensor channels may be independently configured (via software) to accept thermocouples,
RTD’s, strain gages, thermistors, resistors, 4 to 20 milliamp current loops, or DC voltage
inputs. Each sensor channel makes use of differential inputs to allow for wide common
mode variation.
Pulsed sensor excitation is provided for thermistors, resistors, RTD’s, and strain gages.
Pulsed excitation minimizes sensor self-heating effects and helps to reduce board power
consumption. Excitation signals are electrically separated from channel differential inputs
so that three- or four-wire sensor connections may be implemented.
Cold junction compensation is provided for thermocouples, and all inputs are protected
from high differential and common mode voltages.
The 518’s onboard microprocessor continuously scans the eight channels. As each
channel is scanned, the sensor signal is digitized, linearized, and converted to engineering
units appropriate for the sensor type. The most recent sensor data from each channel is
immediately accessible to the host processor.
Alarm limits are individually programmable (via software) for each channel. A status flag
is set when any channel limit violation occurs, eliminating the need for the host processor
to poll sensor data for limit violation detection.
Communication with the host processor takes place over two contiguous I/O ports which
may be mapped anywhere in the system I/O address space. Communication and scanning
tasks execute in an interrupt-driven multitasking local environment to minimize
communication latency while maximizing channel scan throughput.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

3Sensoray Model 518
Chapter 2Introduction
Specifications
Table 1: General Specifications
Parameter Specification
Input power +/-12VDC @35mA, typical
+5VDC @ 150mA, typical
Operating temperature -25C to 85C
CMRR 80dB, minimum @ CMV < 5V
A/D converter 16-bit integrating
Measurement time per channel 16.67 or 8.0 milliseconds
Total time slot per channel 22 or 13 milliseconds
Strain/Pressure gage excitation 10VDC, pulsed
Resistive sensor excitation 1.3mADC, pulsed (0 to 400 ohms)
5VDC in series w/4K (other ranges)
Input protection Up to 70VAC CMV < 2 seconds
Data format 16-bit 2’s complement
PC104 Interface 8-bit module, stackthrough bus
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Instruction Manual 4
Table 2: Sensor Specifications
Sensor Type Range Resolution Accuracy
Thermocouple
B
C
E
J
K
N
T
S
R
0C to 1820C
0C to 1820C
-270C to 990C
-210C to 760C
-270C to 1360C
-270C to 1347C
-270C to 400C
0C to 1760C
0C to 1760C
0.1C 0.2C
Thermistor
Omega 44006
or 44031 -55C to 145C 0.01C 0.05C
RTD
10 ohm copper
100 ohm platinum
385 or392
120 ohm nickel
T/R 2
0C to 119C
-200C to 800C
-200Cto409.5875C
-100F to 482F
0.1C
0.05C
0.0125C
0.1F
0.6C
0.2C
0.2C
0.3F
Strain/Pressure
(4-wire bridge)
120 ohm
-100 to +100 mV
(10V excitation) 5uV 30uV
DC Voltage
Range 1
Range 2
Range 3
-5 to +5V
-500 to +500mV
-100 to +100mV
200uV
20uV
5uV
400uV
30uV
30uV
Current Loop
Range 1 4 to 20mA 0.01% 0.02%
Resistance
Range 1
Range 2
Range 3
0 to 400 ohm
0 to 3 Kohm
0 to 600 Kohm
0.02 ohm
0.125 ohm
31 ohm
0.04 ohm
0.25 ohm
130 ohm
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Chapter
3Hardware Configuration 3
The coprocessor board requires installation of shorting shunts to select hardware options.
Hardware configuration must be completed before the coprocessor can be programmed.:
Interrupts
The 518 may be configured to interrupt the host processor in response to various alarm
and interprocessor communication events. Enabling and disabling of these individual
interrupt sources is accomplished by means of an onboard interrupt control register. All of
these interrupt sources are routed to a single PC104 bus interrupt request line.
An option shunt must be installed to select the appropriate interrupt level if you will be
using interrupts in conjunction with 518 operation. Any interrupt level from IRQ2 to IRQ7
may be selected. Choose an interrupt level that does not conflict with other devices in your
system, then install a shunt at that position on the 518 board.
It is not necessary to install any IRQ shunts if you will not be using interrupts.
Port Mapping
The 518 may be mapped to any four-byte address block within the range 000 to 3FF hex.
Although the board occupies a four-byte block of I/O space, it uses only the first two
address locations in the block.
To avoid addressing conflicts, you must not map the 518 into any address range occupied
by other devices. Similar to many other I/O cards, the 518 does not decode the full PC104
16-bit I/O address -- only the low ten address bits are decoded. As a consequence,
“images” of the 518 will appear throughout the 16-bit address range at intervals of 400H
bytes. You should ensure that these images do not conflict with other devices.
Table 3: default configuration from factory
Option Default
Base address 2B0 hex
PC104 Interrupts Disabled
Channel Filters Disabled
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Instruction Manual 6
Option shunts E1 through E8 are used to select the 518 base address. Shunts are factory set
to locate the board at base address 2B0H. This address should not conflict with any stan-
dard I/O address assignments. If you require a different base address, use the following
table to determine the correct shunt programming for your target base address.
Example: select 390 hex as the 518’s base port address. In this case, the high address byte
is “3”. From the above table it can be seen that shunts E8 and E7 should be removed. The
low address byte, “90”, consists of high nibble “9” and low nibble “0”. From the above
table, the high nibble value “9” requires shunts E5 and E4 to be installed and shunts E6
and E3 to be removed, while low nibble “0” requires shunts E2 and E1 to be installed.
Table 4: I/O address jumpers
Nibble
Value
High Byte Low Address Byte
Low Nibble High Nibble Low Nibble
E8 E7 E6 E5 E4 E3 E2 E1
0Install Install Install Install Install Install Install Install
1Install Remove Install Install Install Remove
2Remove Install Install Install Remove Install
3Remove Remove Install Install Remove Remove
4Install Remove Install Install Install Remove
5Install Remove Install Remove
6Install Remove Remove Install
7Install Remove Remove Remove
8Remove Install Install Install Remove Install
9Remove Install Install Remove
ARemove Install Remove Install
BRemove Install Remove Remove
CRemove Remove Install Install Remove Remove
DRemove Remove Install Remove
ERemove Remove Remove Install
FRemove Remove Remove Remove
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Sensoray Model 518
Chapter 3Hardware Configuration
Hardware Filters
Each channel is provided with a hardware filter which may be used to reduce
thermocouple and aid in detecting open sensor conditions. This feature is in
addition to the software filter algorithm.
Option shunts E9 through E24 are used to enable the hardware filters. A pair of
shunts is assigned to each channel. To enable a channel’s filter, you must install
both shunts. To disable a channel’s filter, you must remove both shunts. You should
enable the filter only for channels that are connected to thermocouples.The
following table shows shunt assignments for all channels:
For example, install shunts E12 and E20 to enable the filter for channel 3.
Table 5:
CH0 CH1 CH2 CH3 CH4 CH5 CH6 CH7
E9 E10 E11 E12 E13 E14 E15 E16
E17 E18 E19 E20 E21 E22 E23 E24
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Chapter
4Programming 4
Programming of the 518 is achieved via a set of built-in commands. Commands are sent
from the PC104 master (aka “host”) to the 518. Some commands cause responses from the
518; these responses are sent from 518 to the host. This chapter explains the mechanism
behind this bidirectional communication and describes the coprocessor command set in
detail.
Programming Model
The coprocessor occupies four consecutive addresses in the host’s I/O space, of which
only the lower two addresses are actually used. Both of these addresses may be written to
and read from, but each address has a distinctly different function for read and write oper-
ations.
The base port (518 board low port address) forms the data path between 518 and host pro-
cessors. Commands are sent to the 518 and command responses are passed back to the
host through this port.
The data port (base address) consists of two hardware registers: command and data. When
the host sends a command to the 518, it is really storing a byte in the command register.
When the host reads a command response from the 518, it is reading a byte from the data
register. Because the command register is write-only and the data register read-only, they
are able to share the same I/O address.
The control port (base address + 1) consists of the read-only status register and write-only
control register. As the name implies, the status register supplies coprocessor status infor-
mation to the host. The control register is used to invoke 518 soft resets and to enable and
disable host interrupts.
Table 5: Programming model
Port Address Read Write
Base + 0: Data Data Register Command Register
Base + 1: Control Status Register Control Register
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Instruction Manual 8
Status Register
The status register provides the host with information used for coprocessor status monitor-
ing and communication handshake control. When the host reads the status register, a byte
of the following form is returned:
Status register bits have the following meanings:
Before writing a byte to the command register the host must test the CRMT bit. When
CRMT contains a logic 1, the command register is ready to accept a new command byte.
The host should write to the command register only when CRMT contains a logic 1.
Similarly, the DAV status bit must be tested before reading a byte from the data register.
When DAV contains a logic 1, a new byte is available in the data register for reading by
the host.
Although these handshake rules are simple, failure to observe them will almost certainly
result in communication errors.
IMPORTANT NOTE: The CRMT, DAV, and ALARM status bits are not valid when the
FAULT bit is active. After resetting the 518 board (by means of either soft or hard reset),
the host processor should not attempt to handshake to or from the 518 until the FAULT bit
changes to the inactive (logic 0) state.
Table 6: Status Register
D7 D6 D5 D4 D3 D2 D1 D0
CRMT DAV ALARM FAULT XXXX
Table 7: Status Register bit functions
Bit Function
CRMT (Command Register eMpTy) indicates the 518 is ready to accept a command
byte into its command register.
DAV (Data AVailable) indicates that the 518 data register contains a data byte
ready for access by the host.
ALARM Indicates one or more programmed channel limits were exceeded.
FAULT Indicates board reset in progress or board fault detected. In normal operation
this bit goes active for approximately one-half second following a board re-
set. The FAULT bit reflects the state of the red LED fault indicator.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

9Sensoray Model 518
Chapter 4Programming
Control Register
The control register provides the means for host management of interrupts and coproces-
sor soft reset.
Control register bits have the following functions:
Table 8: Control Register
D7 D6 D5 D4 D3 D2 D1 D0
SET/CLR 0 0 INT/RST 0ICMD IDAT IALARM
Table 9: Control Register bit functions
Name Function
INT/RST Specifies the control function to be performed. When set to logic zero, the
518 board is reset and all other control register bits are ignored. When set to
logic one, the other control register bits behave as described below.
SET/CLR Specifies whether selected interrupts are to be enabled or disabled. When set
to logic one, all selected interrupts are enabled. When set to logic zero, select-
ed interrupts are disabled.
ICMD Selects CRMT interrupt. When set to logic one, the CRMT interrupt is en-
abled or disabled as determined by the state of the SET/CLR bit. When set to
logic zero, the CRMT interrupt enable is unchanged. While enabled, the host
will be interrupted whenever the status register CRMT bit is asserted.
IDAT Selects DAV interrupt. When set to logic one, the DAV interrupt is enabled
or disabled as determined by the state of the SET/CLR bit. When set to logic
zero, the DAV interrupt enable is unchanged. While enabled, the host will be
interrupted whenever the status register DAV bit is asserted.
IALARM Selects ALARM interrupt. When set to logic one, the ALARM interrupt is
enabled or disabled as determined by the state of the SET/CLR bit. When set
to logic zero, the ALARM interrupt enable is unchanged. While enabled, the
host will be interrupted whenever the status register ALARM bit is asserted.
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Instruction Manual 10
Sample Low-level Drivers
We recommend that you incorporate procedures in your application software that will
conceal the handshake protocol from higher host software levels. This will serve to sim-
plify your programming requirements as well as reduce software maintenance costs.
This section contains sample software drivers that implement the required handshake pro-
tocol. In addition, the QuickBasic routines outlined below are referenced throughout this
chapter in programming examples. Feel free to plagiarize and adapt these routines for your
application.
; *************** 80x86 ASSEMBLY LANGUAGE DRIVERS ******************
; This procedure sends a command byte to the 518.
; Entry: DX points to 518 base port address.
;AL contains command byte to send to 518.
XMIT: PUSH AX ; SAVE COMMAND BYTE TO BE SENT TO 518
INC DX ; POINT DX TO 518 STATUS PORT
XLOOP: IN AL,DX ; READ STATUS PORT
TEST AL,80H ; AND MASK “COMMAND REGISTER EMPTY” BIT
JE XLOOP ; LOOP BACK UNTIL REGISTER IS EMPTY
DEC DX ; POINT DX TO 518 COMMAND/DATA PORT
POP AX ; RESTORE COMMAND BYTE
OUT DX,AL ; AND WRITE IT INTO 518 COMMAND REGISTER
RET ; EXIT COMMAND REGISTER DRIVER ;
; This procedure reads a data byte from the 518.
; Entry: DX points to 518 base port address.
; Exit: AL contains data byte read from 518.
RCV: INC DX ; POINT DX TO 518 STATUS PORT
RLOOP: IN AL,DX ; READ STATUS PORT
TEST AL,40H ; AND MASK “DATA AVAILABLE” BIT
JE RLOOP ; LOOP BACK UNTIL DATA IS AVAILABLE
DEC DX ; POINT DX TO 518 COMMAND/DATA PORT
IN AL,DX ; READ DATA FROM 518 DATA REGISTER
RET ; EXIT DATA REGISTER DRIVER
‘ ******************* QUICKBASIC DRIVERS *********************
‘ This subprogram handshakes a byte to the 518 command register:
SUB Send518Byte (BasePort As Integer, CommandByte As Integer)
DO : LOOP WHILE (INP(BasePort + 1) AND &H80) = 0 ‘wait for CRMT
OUT (BasePort, CommandByte) ‘send the byte
END SUB
‘ This function handshakes a byte from the 518 data register:
FUNCTION Read518Byte% (BasePort As Integer)
DO : LOOP WHILE (INP(BasePort + 1) AND &H40) = 0 ‘wait for DAV
Read518Byte = INP(BasePort) ‘read the byte
END FUNCTION
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

11 Sensoray Model 518
Chapter 4Programming
You may find the following routines useful if you are writing a QuickBasic application.
The first procedure reads a 16-bit value from the coprocessor, adjusting the sign if neces-
sary. The second procedure sends a 16-bit value to the coprocessor. Note that these two
routines make calls to the QuickBasic procedures listed previously.
‘This function reads a 16-bit integer value from the 518.
FUNCTION Read518Word% (BasePort%)
Lval& = Read518Byte%(BasePort%) ‘read high data byte from 518
Lval& = Lval& * 256 + Read518Byte%(BasePort%) ‘read & concatenate low byte
IF Lval& > 32767 THEN Lval& = Lval& - 65536& ‘adjust sign, if necessary
Read518Word% = Lval& ‘exit with value
END FUNCTION
‘This subprogram writes a 16-bit integer value to the 518.
SUB Send518Word (BasePort%, Value%)
CALL Send518Byte (BasePort%, (Value% \ 256) AND &HFF)‘send high byte to 518
CALL Send518Byte (BasePort%, Value% AND &HFF) ‘send low byte to 518
END SUB
/******************************** C DRIVERS ****************************/
/* ADSENDBYTE handshakes a command byte to the 518 command register */
void adSendByte ( short base_port, short cmd_byte )
{while ( ( inp( base_port + 1 ) & 128 ) == 0 ) ; /* wait for CRMT */
outp ( base_port, cmd_byte ) ; /* send the byte */
}
/* ADREADBYTE handshakes a data byte from the 518 data register */
short adReadByte ( short base_port )
{while ( ( inp ( base_port + 1 ) & 64 ) == 0 ) ; /* wait for DAV */
return ( inp ( base_port ) ) ; /* read the byte */
}
/* ADSENDWORD handshakes a 16-bit value to the 518 */
void adSendByte ( short base_port, short cmd_word )
{adSendByte ( base_port, cmd_word >> 8 ) ; /* send high byte */
adSendByte ( base_port, cmd_word ) ; /* send low byte */
}
/* ADREADWORD handshakes a data byte from the 518 */
short adReadWord ( short base_port )
{short hiByte = adReadByte ( base_port ) << 8 ; /* read high byte */
return ( hiByte | adReadByte ( base_port ) ) ; /* read & concatenate low byte */
}
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Instruction Manual 12
Commands
The 518 is accessed through a simple yet powerful built-in command set. Commands vary
in length depending on the size of encapsulated data. In some cases invocation of a com-
mand will cause the coprocessor to return data to the host. In such cases the host must read
the command response before issuing another command.
Each command consists of at least one byte. The first byte of each command typically
adheres to the above format. The opcode -- always present in the first command byte --
specifies the function to be performed. The channel number is required only in commands
that address a particular channel.
These conventions are used in describing commands and responses:
1. The symbolic name CHAN represents a coprocessor channel number. Valid chan-
nel numbers range from 0 through 7, inclusive.
2. A byte is represented as a number or expression contained by parenthesis. For
example, (16 + CHAN) represents a byte having a value equal to 16 plus a channel
number.
3. A byte string is represented as an ordered sequence of bytes separated by commas.
The sequence is defined from left to right. For example, the byte string
(95+CHAN),(5),(0) contains three bytes.
4. A command consists of a byte string which is passed from host to 518 in the proper
sequence.
5. A command response consists of a byte string which is passed from 518 to host in
the proper sequence.
The remainder of this chapter discusses the coprocessor command set. Each command
function is described along with the associated command and response byte strings. Sam-
ple program segments are listed to illustrate command usage. The program segments are
all written in QuickBasic but can be easily converted to the programming language of
your choice.
Table 10: Format of first command byte
D7 D6 D5 D4 D3 D2 D1 D0
OPCODE CHANNEL
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

13 Sensoray Model 518
Chapter 4Programming
Declare Channel Sensor
This command declares the type of sensor connected to a channel. Typically, this com-
mand is executed once for each channel during the coprocessor initialization sequence
(i.e., after a reset). Each execution of this command specifies the sensor type for a single
channel, therefore eight invocations must occur to declare all eight channel sensors.
A two-byte sequence forms the command string. The first command byte contains the
Define Channel Sensor opcode and desired channel number. The second command byte
contains a “sensor definition code”. Each sensor type is assigned a unique 8-bit sensor def-
inition code. Refer to the Sensor Tables section for a complete list of sensor codes.
Undeclared channel sensor types default to the 5 volt input range. Any attempt to declare a
“reserved for future use” sensor type will also result in the default sensor type. Declaring a
sensor type as “Disabled” inhibits scanning of the corresponding channel, resulting in
increased throughput for all remaining active channels.
COMMAND: (16 + CHAN), (SENSOR DEFINITION CODE)
RESPONSE: NONE
EXAMPLE:
‘ Configure channel 2 for interface to type K thermocouple.
Channel% = 2 Opcode% = 16 ‘DEFINE CHANNEL SENSOR command opcode
SensorCode% = 3 ‘K thermocouple sensor definition code (from table)
CALL Send518Byte (BasePort%, Channel% + Opcode%)
CALL Send518Byte (BasePort%, SensorCode%)
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Instruction Manual 14
Set Filter Time Constant
This command establishes a software single-pole low-pass filter for the specified channel.
The second command byte specifies a filter factor Fwhich may have any value from 0 to
255, inclusive. The approximate relationship between F and filter percentage Pis:
All filter constants default to 0 after a reset. This effectively disables the software filters,
thereby maximizing the frequency response of all channels. A non-zero factor In electri-
cally noisy environments may help to reduce measurement noise.
Rather than computing the theoretical value of filter constants, we recommend that you
experiment with different filter constants to find the best response-time/noise-immunity
tradeoff point. Some applications require knowledge of the filter time constant. This func-
tion describes the approximate relationship between time constant and filter factor:
where: t is the time constant in seconds
F is the filter factor in the range 0 to 255
N is the number of active channels.
COMMAND: (96 + CHAN), (FILTER CONSTANT)
RESPONSE: NONE
EXAMPLE:
‘ Set up channel 4 with a 12.5% low-pass filter. |
Channel% = 4
Opcode% = 96 ‘command opcode
FilterPercent% = 12.5 ‘filter percentage
FilterConstant% = FilterPercent% * 2.55 ‘compute filter constant
CALL Send518Byte (BasePort%, Channel% + Opcode%) ‘send channel & opcode to 518
CALL Send518Byte (BasePort%, FilterConstant%) ‘send filter constant to 518
PF
2.55
----------=
tN–
45lnF
256
---------
-------------------------
=
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

15 Sensoray Model 518
Chapter 4Programming
Read Board Temperature
This command returns the temperature at the optional 7409TC termination board. Useful
for monitoring the temperature of thermocouple reference junctions, this function is also a
good debugging aid during 518 installation. The returned temperature value is scaled to
0.10 degrees C/bit.
If no 7409TC is connected to the 518, the Read Board Temperature command will return
a meaningless value.
COMMAND: (64)
RESPONSE: (BOARD TEMP MSB), (BOARD TEMP LSB)
EXAMPLE:
‘ Read and display the 7409TC temperature in degrees F:
CALL Send518Byte (BasePort%, 64) ‘send opcode to 518
Temp! = Read518Word (BasePort%) / 10! ‘read response & convert to degrees C
DegreesF! = 1.8 * Temp! + 32.0 ‘convert to degrees F
PRINT DegreesF! ’display temperature on CRT
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

Instruction Manual 16
Read Channel Data
This command returns the most recently acquired sensor data from a channel. The
returned integer value is scaled as a function of the channel sensor type. Regardless of sen-
sor type, the returned value is always represented in 16-bit two’s complement form. Refer
to the Sensor Tables section for a listing of sensor scaling factors.
COMMAND: (CHAN)
RESPONSE: (HIGH DATA), (LOW DATA)
EXAMPLE
‘ Channel 6 is configured for +/- 5 volt input signal measurement.
‘ Read and display the voltage measured at channel 6.
Channel% = 6
Scalar! = 0.0005 ‘from Sensor Tables, scalar = 500uV
CALL Send518byte (BasePort%, Channel%) ‘send command to 518
ChanData% = Read518word (BasePort%) ‘read scaled data from 518
V! = ChanData% * Scalar! ‘convert scaled data to volts
PRINT “Channel 6 data: “; V!; “Volts” ‘display voltage
EXAMPLE:
‘ Channel 4 is configured for a type K thermocouple.
‘ Read and display the temperature measured at channel 4.
Scalar! = 0.17
CALL Send518byte (BasePort%, 4)
Chan4temp! = Scalar! * Read518word (BasePort%)
PRINT “Channel 4 data: “; Chan4temp!; “degrees Centigrade”
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
Other manuals for 518
1
Table of contents
Other Sensoray Computer Hardware manuals