HTBasic Help
×
Menu
Index

SEND Statement

 
The SEND statement sends byte level IEEE-488 bus data and commands. Commands are sent with the ATN line asserted; whereas data bytes are sent without the ATN line asserted. You specify an I/O Path or an interface select code and a list of messages. The type of message is specified with the keywords CMD, DATA, TALK, LISTEN, SEC, MTA, MLA, UNT, and UNL. For example:
 
SEND @Gpib; UNL MLA TALK Primary CMD 24+128
 
sends the unlisten command, my listen address, the talk address specified by the value of the variable (Primary), and then the command byte 152.
The CMD message evaluates the following expression values and sends them as command bytes. If the CMD keyword is given with no expressions, it asserts the ATN line. For example:
 
SEND 7; CMD 3*5, P, A$, N
 
The DATA message evaluates the following expression values and sends them as data bytes. If the optional END keyword is added, EOI is set on the last data byte. For example:
 
SEND 7; DATA Value*4, ABS(N), Out$ END
 
The LISTEN message sends the expression values as listen address commands. The TALK message sends the expression value as a talk address command. The SEC message sends the expression values as secondary address commands. The MLA message sends the interface’s listen address command. The MTA message sends the interface’s talk address command. The UNL message sends the unlisten command and the UNT message sends the untalk command.
 
The computer must be the active controller to use the CMD, TALK, UNT, LISTEN, UNL, SEC, MTA, or MLA messages. Any talk addressed device may send DATA.
The following table lists the bus commands that can be sent with the CMD message.
         
Decimal Value
Description
1
GTL - Go to Local
4
SDC - Selected Device Clear
5
PPC - Parallel Poll Configure
8
GET - Group Execute Trigger
9
TCT - Take Control
17
LLO - Local Lockout
20
DCL - Device Clear
21
PPU - Parallel Poll Unconfigure
24
SPE - Serial Poll Enable
25
SPD - Serial Poll Disable
32-62
LAG - Listen Address Group
63
UNL - Unlisten
64-94
TAG - Talk Address Group
95
UNT - Untalk
96-111
PPE - Parallel Poll Enable
112-126
PPD - Parallel Poll Disable
96-126
SCG - Secondary Command Group
 
Note that the listen and talk address groups (LAG and TAG) consist of 31 different addresses. Each listen and talk address can be further broken down into a secondary address group (SCG). To find the appropriate listen, talk, or secondary address to send for a particular device, use the following equations:
 
Listen Address = Primary Address + 32
Talk Address = Primary Address + 64
Secondary Address = Primary Address + 96
 
The examples below show the high level transfer statement OUTPUT followed by four ways to send the exact same information across the IEEE-488 bus with the SEND statement.
 
OUTPUT 705 USING "#,K";"gt;"
 
SEND 7; CMD "?U%" DATA "gt;" END
SEND 7; CMD 32+31, 64+21, 32+5 DATA "gt;" END
SEND 7; UNL MTA LISTEN 5 DATA "gt;" END
SEND 7; UNL TALK 21 LISTEN 5 DATA "gt;" END