SCPI PSU Usage Notes
SCPI PSU Usage Notes —
Usage information about the block
Model Start Messages
This series of messages are sent during the first model execution steps. As
indicated in the mask, multiple messages can be sent with a delay between them. Each
message must not exceed the transmit FIFO size, in terms of the number of
characters. There are multiple ways to write the message: with strings, char, or
numbers. The strings and char arrays are converted into the numerical ASCII
equivalent; numerical values are sent as is. Note that you must add the termination
characters to the messages yourself (e.g., carriage return, line feed, NULL).
Mask Commands
The Command Table contains the controls needed to
add commands.
When adding a new command line, the command is not configured. When Save Command Table is clicked, the block will generate
the ports for correctly configured commands; the ones not configured correctly are
ignored. A warning message is displayed in the MATLAB command window explaining the
problem. Incorrectly configured commands are not removed from the Command Table. The buttons OK or Apply still need to be
clicked to keep the contents of the Command Table.
If a daisy chaining is possible for the selected device, the Device Address column
is enabled and must be specified for each command. If the device has multiple
channels, the Channel column is enabled and it must be specified for each
command.
Either a Set or Request command must be chosen. For each Set command, a Set input port will
appear when Save Command Table is clicked. For each
Request command, Request input and output ports will appear when Save Command Table is clicked. A maximum of 50 commands
are allowed in the Command Table.
Model Stop Message
The Serial Write block has a feature that allows you to send a final message
during ModelStop. For each device, there is a suggested message that can be copied
and pasted to the Serial Write block, often to reset all the devices connected to
the communication port.
Input Command Ports
Commands are sent in the order defined in the Command
Table, from top to bottom, which corresponds to the order of the
command input ports. After all the commands have been sent once, the block sends
only those commands whose input values have changed. If multiple values change at
the same time, the commands are sent in the same top-to-bottom order.
The two types of input command ports behave slightly differently:
Set: When the input value of the port
changes, the command is sent with the input value as the command parameter.
The initial value set for each port is -1.
If during the initial execution a specific command does not need to be sent,
then set the value for the command to -1.
Request: When the input value of the port
changes, the command is sent and, since it is a request, the input value
does not matter. The initial value set for each port is -1. If during the initial execution a specific
command does not need to be sent, then set the value for the command to
-1. After sending the request command,
a response from the device is expected; if the response meets the format
requirements for the specific command, it is displayed on the corresponding
request output port.
Special Ports
Input Ports
Skip Cmd: This port skips the current
command if it is stuck for any reason. To trigger this port, the port must
switch from 0 to 1; to use the skip again, the port must be set to 0 and to
1 again. When the ClearToSend port constantly stays at 0 and the LastCmdIdx
does not increment, then it means that the block is stuck.
The occurrences of the block being stuck on a command are if the block is
waiting for a response from the device, waiting for a timer to finish, or
the received response from the device was unexpected (message not expected,
unexpected format, error message, etc.). The solution of this port is to
skip the command entirely, and try with the next one. In the case of a
daisy-chained device, if the command that got stuck is a connection request
before the actual Set or Request command, then the command altogether is
skipped, connection request and Set/Request command.
Retry Cmd: This port retries to send the
current command if it is stuck for any reason. To trigger this port, the
port must switch from 0 to 1; to use the retry again, the port must be set
to 0 and to 1 again. When the ClearToSend port constantly stays at 0 and the
LastCmdIdx does not increment, then it means that the block is stuck.
The occurrences of the block being stuck on a command are if the block is
waiting for a response from the device, waiting for a timer to finish, or
the received response from the device was unexpected (message not expected,
unexpected format, error message, etc.). The solution of this port is to
retry to send the last command. In the case of a daisy-chained device, if
the command that got stuck is a connection request, that is the message that
is sent again.
Output Ports
Drain:
The block may receive unexpected messages, such as random strings,
responses of an unexpected type, or error messages. These messages are
output on the Drain port. This information is also printed on the status
monitor of the target machine with additional information depending on the
case, like what message was expected to be received.
ClearToSend: Shows the state of the
internal ClearToSend flag (1 when it is ready to send; 0 when it is
waiting/stuck).
LastCmdIdx: Shows the index of the last
command sent. The command index is indicated as the first value in the
command input port, or the first column in the Command
Table.