MAGNET POWER SUPPLY SYSTEM 9100
38
DANFYSIK A/S - DENMARK.
3.3.4
Programming
The power supply communication protocol is built upon plain ASCII characters where each
command or reply is delimited by a "Carriage Return" <CR> character. However replies have
a “Line Feed” <LF> character added before the <CR> for a friendlier display when using a
terminal. <LF> characters on commands will be ignored.
Hint. Actually the protocol allows full control of the power supply from a "dumb" terminal. In
case of a service- debug- situation a terminal can be used to tap the communication
transfer by a simple parallel connection.
Hint: When debugging, the "ERRT" command enables error messages to be given as a read
able text.
More commands may be transmitted in a chain but each single command must be trailed
individually with the delimiter character <CR>. The power supply is able to execute up to 200
commands a second depending of the complexity of each command.
Ps.
Issuing short commands faster than the time to transmit the answer e.g. “S1" will
overload the internal transmit buffer regardless of the selected baud rate.
All commands can be divided into three sections.
a)
Directive commands. Eg. the "N" command that turns the power supply ON
b)
Status commands. Eg. the "S1" that returns the power supply status
Status commands delivers always a reply whereas directive- and setup- commands only
responds with an error message if the command couldn‟t be understood or if the given
parameters are incorrect. It is possible to set the power supply to always generate an
answer; this feature is very useful when using RS485 protocol.
Hint. When using the "Always Answer" mode a re-transmission of the last given command
can be performed if no answer or an error message is received. The System 9100
respond time is around 5ms after receiving the last bit of the termination character.
Answer scheme if set to “Always Answer” mode.
c)
Directive commands.
Answer:
- No answer
- ERROR message
- OK if set to always answer mode (ab SW ver. SCY
2.xx)
d)
Status commands . Answer:
- Data
- ERROR message
e)
Set up commands. Answer:
- No answer
- ERROR message
- OK if set to always answer mode (ab SW ver. SCY
2.xx)
Below is an example written in BASIC on how to turn ON the power supply and read the status
without and with acceptance answer: