Telemetry Module MT-021 User Manual
Telemetry Module MT-021 User Manual
Telemetry Module MT-021 User Manual
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
causes module to write value 1234 to holding register 10 and send back SMS with text:<br />
>1234<br />
Both read and write commands can be expanded by adding a prefix, which defines data<br />
format (notation). Prefix should be placed between '#' mark (command start) and<br />
register symbol, and should contain one (or more) characters ended with a dot. For<br />
example, to read an input register 4 in hexadecimal format, one should use a command:<br />
#H.IR4<br />
and module's answer will be:<br />
>1FC8<br />
Prefixes can also be used with write commands.<br />
Command can operate on more than one register. Register count can be included in<br />
prefix, after character denoting data format (which is then mandatory). For example,<br />
command:<br />
#D2.HR2=123456<br />
causes write 123456 to two registers, HR2 and HR3 (32-bit variable).<br />
Full list of available prefixes is enclosed below.<br />
<strong>User</strong> can define in <strong>MT</strong>Manager own symbolic names in module's config and assign them<br />
to registers. Then, such names can be used instead of register symbols. It allows user to<br />
define "friendly" names for registers and to erase access to bit values. For example, if<br />
user has defined symbolic name "output" and assigned it to bit 321 of internal registers<br />
space (which is equal to bit of HR20 register), then sending a command:<br />
#output=1<br />
causes module to write 1 to bit 1 of HR20 register. There are several predefined<br />
(internal) symbolic names.<br />
Apart from symbolic names, user can define macros. A macro is defined as a name and<br />
a text assigned to this name. Parsing of received message begins with macro expansion.<br />
Parser looks for words beginning with '*' sign and replaces such names with assigned<br />
strings. Once macro expansions ends, new message text is being interpreted and<br />
commands executed. It allows user to place both commands and symbolic names in<br />
macro text. Furthermore, macros can contain another macro names ("nested" macros),<br />
but only those defined higher in macro list. For example, if configuration contains<br />
following macros (in order shown):<br />
No. Macro name Macro text<br />
1 counter *mtime: input 0 counter: #D2.HR0<br />
2 mtime #date #time<br />
3 state *mtime: inputs - #B8.IB64, #IR19 SMS sent<br />
then macro *mtime used in macro number 3 (*state) will be correctly expanded and<br />
SMS text:<br />
*state<br />
after macro expansion (before executing commands) will be changed to:<br />
81