Command Structure

A Command always consists of a single word, which can be followed by one or more parameters. Commands always start with an Asterisk ( * ) or a letter from A to Z and may never contain more than 32 characters. Only letters from A to Z and numbers from 0 to 9 are allowed in Command names. Commands are not case-sensitive, which means that you may mix any combination of upper-case and lower-case characters when sending a Command.

New commands should only be given after receiving a Prompt from the Slave, which indicates that the Slave is ready and waiting for new Commands.
Slaves with enough RAM resources may store multiple Commands in a buffer, in which case the Master doesn't necessarily have to wait for a Prompt before sending a new command. But there's always the danger of overflowing the Slave's input buffer, so it is advised not to send Commands before receiving a Prompt from the Slave.

Command Types

Two Command types exist: Query Commands and Non Query Commands.

Query Commands always end with a question mark (for example *ERROR?, or READ?). Query Commands may send zero or more lines of data back to the Master. Each data line is ended by a Carriage Return character. Finally, when no more data lines have to be sent, the Slave will send a => or a !> status Prompt to signal the completion of the Command.
A Query Command may return more than one line of data. Long lists can be aborted by the user by sending an ESC character, in which case the Slave will terminate the long list instantly followed by an !> error prompt.
When the Acknowledge Flow Control mode is selected each line of a multi-line answer must be acknowledged by the Master. You can read more about Acknowledge Flow Control in the chapter covering Flow Control.
Please note that Query commands can not be executed when the Slave is selected by the Broadcast address because Slaves are not allowed to talk then.

Non Query Commands will never send any data back to the Master. Non Query Commands never end with a question mark (for example: *HOLD, or SELECT). The only thing sent to the Master in response to a Non Query Command is either a => or a !> status Prompt indicating the completion of the Command.

A Non Query Command may take some time to execute. It is up to the Slave whether the user is allowed to abort a long running Command by sending an ESC character to the bus or not.
However often there is no use aborting very fast or non-reversible Commands, in which case the Slave may simply ignore the ESC characters it receives during execution.

System Commands

System Commands are very much like normal Commands with only one extra privilege: They are the only Commands that can be executed when the Slave is selected by the Broadcast address.
System Commands can be distinguished from normal Commands because they always start with an Asterisk ( * ), for example: *ID?, *ERROR?, *HOLD.

A fixed set of System Commands is defined for the SB-Bus. Some of them are to be implemented in all Slaves, others are optional. All System Commands are described in the System Commands chapter.

Repeat

The last Command is executed again if you simply send a Carriage Return character to the bus on an empty line. This causes the last Command to be repeated, including all of its parameters.
This feature is particularly useful when controlling the SB-Bus with a terminal emulation program.

In the event that the last Command resulted in a Syntax Error, we may assume that repeating it will trigger the Syntax Error again.
However if the previous Command resulted in an Execution Error, a repeated Command may now complete successfully. For instance we can repeat an aborted Command, without aborting it this time.

When no previous Commands were given, for instance when the Slave just got switched on, an Error will be reported. The *ERROR? System Command will then answer with a NOTHING TO REPEAT ERROR.