Writing digital data – Agilent Technologies L4400 User Manual

Page 213

Advertising
background image

L4450A 64-Bit Digital I/O with Memory and Counter

8

L4400 User’s Guide

201

To read digital data with more control over the channel parameters,

use the SCPI

CONFigure

and

SENSe

commands. The

CONFigure

commands

set up the digital I/O channel parameters. For example, sending the
following SCPI command sets 16- bit input channel 103 to use a 2.5 V
input threshold, and normal polarity.

CONF:DIG WORD, 2.5, NORM, (@1103)

Once configured, the data is read using the following command.

SENS:DIG:DATA:WORD? (@1103)

You may also read an individual bit using the

SENSe

commands.

This allows you to check the state of an individual bit in a channel
without having to create an input mask. For example, the following
command returns the state of bit 3 in the channel 101 byte.

SENS:DIG:DATA:BIT? 3, (@1101)

The acceptable range for the bit parameter is based on the channel width
as shown below:

BYTE (8- bit): <bit> can range from ‘0’ to ‘7’

WORD (16- bit): <bit> can range from ‘0’ to ‘15’

LWORd (32- bit): <bit> can range from ‘0’ to ‘31’

The

SENSe

command differs from the

MEASure

command in that it will not

change the direction (input or output) of the channel. If the channel is
configured as an output, the

SENSe

command will return the value being

driven.

Writing Digital Data

To write digital data, set the channel output parameters using the

SOURce

commands. For example, sending the following SCPI commands to a Digital
I/O module in slot 1 sets a 32- bit channel to use normal polarity,

with active drive and a ‘set’ output voltage of 4 volts.

CONF:DIG:WIDT LWOR,(@1201)

CONF:DIG:POL NORM,(@1201)

SOUR:DIG:DRIV ACT,(@1201)

SOUR:DIG:LEV 4,(@1201)

The width and polarity parameters apply to both input and output
operations.

Advertising