Examples, Example 1, Example 2 – National Instruments SCXI-1163 User Manual

Page 58

Advertising
background image

Programming Chapter 5

SCXI-1163 User Manual 5-4 © National Instruments Corporation

Examples

This section describes how to program the SCXI-1163, either alone or in conjunction with other
modules.

The following examples are intended to aid your understanding of module and Slot 0
programming. It will be helpful to refer to the bit descriptions for the

Data Register

,

Status

Register

, and

Address Handler

in Chapter 4,

Register Descriptions

.

Example 1

You want to set all the outputs to their logic high state on an SCXI-1163 in Slot 1 of an
SCXI-1000 chassis. The SCXI-1163 is directly cabled to a data acquisition board and has the
primary mode of operation set to serial.

The programming steps are as follows:

1. Following the procedure given in the

Register Writes

section of this chapter, write

11111111 11111111 11111111 11111111

to the Data Register of the SCXI-1163 in

Slot 1.

Example 2

An SCXI-1000 chassis has four SCXI-1163 modules in Slots 1, 2, 3, and 4. The SCXI-1163 in
Slot 4 is cabled to the data acquisition board and has the primary mode set to serial. The
SCXI-1163 in Slot 3 is not cabled to a data acquisition board and has the primary mode set to
parallel. You want to set the following channels to their logic low states and leave all the other
channels in their logic high states. The channels of interest in each slot are as follows:

Channel 3 on the SCXI-1163 in Slot 1

Channels 0 through 2 on the SCXI-1163 in Slot 4

Channels 10, 7, 5, and 3 on the SCXI-1163 in Slot 3

The programming steps are as follows:

1. Following the procedure given in the

Register Writes

section of this chapter, write

11111111 11111111 11111111 11110111

to the Data Register of the SCXI-1163 in

Slot 1.

2. Following the procedure given in the

Register Writes

section of this chapter, write

11111111 11111111 11111111 11111000

to the Data Register of the SCXI-1163 in

Slot 4.

3. Following the procedure given in the

Register Writes

section of this chapter, write

11111111 11111111 11111011 01010111

to the Data Register of the SCXI-1163 in

Slot 3. Since this module is jumpered for a parallel mode of primary operation, the Data
Register must be written to via address

0001

(hex) to ensure that the output mode is serial

and therefore that the Data Register drives the outputs.

Advertising