|   |
![]() |
|||||||||||||||||||
Home |
Well, I guess that this is the moment we've all been waiting for.
We're going to see some real command examples here.
In fact the commands discussed here are the so-called System Commands.
System Commands come in both flavours: Query Commands and Non Query Commands. It goes without saying that executing a Query Command while selected through the General Call Address has not much use because a Slave is not allowed to "speak" then. A Slave doesn't necessarily have to know all specified System Commands. But the Commands it does know are to be executed the way I've described here. Remember that the SB-Bus is Case insensitive, which means that you can use both upper or lower case characters in your Commands and Parameters.
Use: *CATALOG?
The selected Slave will answer by sending a list of all of its Commands, usually in alphabetic order.
Each Command is listed on a separate line.
As usual an OK prompt => follows at the end of the list.
Use: *ERROR? The selected Slave will respond to this Command by sending a description of the error status of the previous Command.
It has not much use to request the error cause when the previous Command ended with an OK Prompt => or a Syntax Error Prompt ?>.
I bet you can predict yourself what answer is given by the *ERROR? Command then.
In case you want to know the reason why a particular Command ended with an Execution Error Prompt !> you must give the *ERROR? Command immediately before entering any other Commands.
Otherwise the previous error message gets lost.
The *ERROR? Command has one special property, it can't be placed in *HOLD. Please see the description of the *HOLD Command for further details.
Use: *FAST
This Command is the counter part of the *SLOW Command.
It places the Slave in fast mode, which means that no extra delay is added after the Slave sends each CR character.
This Command has become obsolete because computers are so much faster than when I first defined the SB-Bus protocol. Therefore this Command is now optional.
Use: *FLOW xoff|ack
This Command requires one parameter, which selects between XON/XOFF Flow Control only or a combination of XON/XOF and Acknowledge Flow Control.
The default after a system reset is XON/OFF Flow Control only.
Please read the chapter about Flow Control for a more detailed description of the two available Flow Control modes.
Use: *FLOW? This Query Command will tell you what Flow Control mode is currently active in the selected Slave. One of the these two answers can be given:
XON/XOFFOnly the XON/XOFF Flow Control is active.
Use: HOLD
This Command activates the Hold mode, which means that the next Command will be placed in Hold and will therefore not be executed immediately.
A Command that has been placed in Hold can be started by executing the *TRIG Command.
The real strength of this procedure is when you place commands in Hold on multiple Slaves, and then execute the *TRIG Command while all Slaves are selected through the General Call address.
The *HOLD Command is optional.
A Slave which is not interested in this Command (and therefore is also not interested in the *TRIG Command) should reply with an Execution Error.
The *ERROR? Command will then report the "COMMAND NOT SUPPORTED ERROR".
The Command that directly follows the *HOLD Command will not be executed immediately.
It will be decoded including all of its parameters and then it is placed in Hold.
A Slave will only accept the *TRIG Command when a Command is placed in Hold, which triggers the execution of the Command in Hold.
Any other Command given while a Command is placed in Hold will generate a "HOLD MODE ACTIVE ERROR", which also cancels the Hold mode.
It goes without saying that the *HOLD Command itself can not be placed in Hold.
If you do send the *HOLD Command twice in a row it will deactivate the Hold mode again, generating an Execution Error.
The *ERROR? Command will then generate a "HOLD MODE DEACTIVATED" error.
The Hold mode will be terminated if a new SB-Bus Address is received while no Command has been put in Hold yet. No error will be generated this time because the Slave is no longer selected after receiving a new address.
Use: *ID?
This Command replies with the identity string of the selected Slave.
This is a string which holds the Slave's name and software version number and may be up to 32 characters long.
Use: *LOCS
This Command allows the Slave to be controlled locally, from its front panel.
It is the counter part of the *REMS Command, which places the Slave in remote mode.
The designer of the Slave may decide what local controls (if any) are to be locked when the Slave is in remote mode. This Command may simply do nothing when there are no controls on the Slave that can or may be locked out.
Use: *REMS With this Command you can place the Slave in remote mode. In remote mode some or all local controls of the Slave are locked. It's up to the Slave's design to determine which controls can or may be locked. An emergency button for instance is a good example of a control that shouldn't be locked. Usually an indication on the front panel indicates when the Slave is placed in remote mode. The remote mode is especially suitable for automated measurements when operators are not allowed to change any settings. The opposite Command of *REMS is the *LOCS Command, which returns the Slave to local mode.
Use: *RST
This is a mandatory command and is intended to allow easy resetting of the selected Slave or all Slaves together.
Resetting a Slave has the same effect as removing and restoring power to the Slave.
Although the *RST command is mandatory, it is up to the Slave whether it really resets itself or not.
Some Slaves which perform important functions (e.g. a Power Supply Unit) may choose not to allow a full reset.
Use: *SLAVE address This Command allows you to setup or change the SB-Bus address of a Slave. It goes without saying that this will only work if the Slave has some way of remembering its address in Non Volatile Memory. Slaves with a hard coded or hard wired address will not know this Command, because they have no way of changing and remembering their new address. Actually this Command is intended for brand new Slaves which don't have a legal Address yet, although you may also use it to change the Address later on at any given time. It can also be used if you don't remember or don't know to which Address a specific Slave is responding. In order to change the Address of a Slave you must first select it before you can give it the *SLAVE Command. By definition brand new Slaves have address 254 assigned to them. But what if you don't know the current Address of the Slave? Simple: Connect only that Slave to the bus and select it with the General Call Address, that way you're certain that it will listen. But remember, disconnect all other Slaves from the bus otherwise you may end up with multiple Slaves listening to the same Address.
You may give the Address parameter either in decimal or hexadecimal form.
Hexadecimal values are preceded by a Dollar symbol ($DE).
Feel free to omit the hexadecimal format if you don't like the trouble of coding it.
After all the *SLAVE Command is probably going to be used only once during the Slave's life time.
Use: *SLOW This Command is the counter part of the *FAST Command. It places the Slave in slow mode, which means that it will add an extra delay of 5 ms after each CR character. This Command has become obsolete because computers are so much faster than when I first defined the SB-Bus protocol. Therefore this Command is now optional.
Use: *STANDBY
This Command is optional, and only makes sense if the Slave can actually be placed in standby.
If a Slave can be placed in standby it may decide how deep it is going to sleep.
Some Slaves will only switch of their display and controls, while others may even partially or completely remove power from their circuits.
Use: *TRIG
This Command triggers, or in other words executes the Command that was previously put in Hold.
You can find more details about the Hold mode in description of the *HOLD Command.
As soon as the Command in Hold is executed by the *TRIG Command it will be removed from Hold, which means that you can never repeat the *TRIG Command.
If the Hold mode is not active at the time you give the Slave a *TRIG Command it will respond with an Execution Error.
The *ERROR? Command will then report the "HOLD NOT ACTIVE ERROR".
Please note that the *TRIG Command is the only Command that may reply by sending some data back to the Master. But this only happens if a Query Command was placed in Hold and the Slave was selected by its unique SB-Bus Address.
Use: *TST? The *TST? Command can be used to perform functionality tests of the Slave. It's up to the Slave what circuits or peripherals it is going to test and how it will report the results of the tests to the Master. A Slave may even not test anything at all, in which case it may respond with only the text OK followed by the OK Prompt.
Use: *WAKEUP The *WAKEUP Command is not just an ordinary Command because it can only be given if the Slave is placed in standby mode by the *STANDBY Command. Therefore the *WAKEUP Command is only available on Slaves that support the *STANDBY Command. The *WAKEUP Command usually doesn't appear in a *CATALOG? listing, even if it is supported.
The wakeup procedure involves just a little bit more than just sending the *WAKEUP Command to the selected Slave.
The reason for this is that some Slaves may be in a deep sleep and it may take some time to get their attention.
Remember that a Slave can even turn of its processor entirely in standby mode, leaving no intelligence awake to interpret the *WAKEUP Command.
|