Up | IMCmd | RS232Cmd | ResponseCmd | TdvCmd format

 

  

 
TdvCmd format

In TdvCmdProtocol commands, it is possible to substitute text with parameter values by specifying a formatting sequence, '%[len]type', before the parameter name. 

Each formatting sequence may contain a length specification. If length specification is given, the result is left padded with space - or zero if the replaced parameter value contains less characters than the given length.

Multiple parameters MUST be separated by ';' or ','.

Format Padding Description
%[n]d
%[n]D
'0' Integer number format. If the paramter value is not an integer value the resulting string is the truncated integer value, there is no rounding of the value.
%[n]b
%[n]B
'0' Binary number format. The resulting string is the binart representation of the parameter value, a sequence of '0' or '1'.
%[n]h
%[n]H
'0' Hexadecimal number format. The resulting string is the hexadecimal representation of the parameter value, a sequence of '0'..'9', 'A'..'F'.
%[n.n]f
%[n.n]F
SPACE Floating point format. The resulting string is the floating point representation of the parameter value. If no length specifier is given the resulting string holds up till 
%[n]s
%[n]S
SPACE Text format. This is used for text parameters.
% SPACE Any number format, the resulting string depends of the numeric inpuit value (floating point or integer)
Fomat Examples:

A.Value = 12.134
B.Value = 11.77
C.Value = 1.0
T.Text   =  'OK'

Format string Resulting string
I=%dA.Value I=12
B=%8bA.Value B=00001100
H=%hA.Value H=C
F=%fA.Value F=12.134
F=%.2fA.Value F=12.13
F=%8.1fA.Value F=    12.1
T=%sResult.Text T=OK
A=%dA.Value;B=%.1fB.Value A=12;B=11.8
X=%.3fB.Value;OK=%dC.Value X=11.770;OK=1
%.3fB.Value,%dC.Value 11.770,1
 

Scorpion Vision Version XII : Build 646 - Date: 20170225
Scorpion Vision Software® is a registered trademark of Tordivel AS.
Copyright © 2000 - 2017 Tordivel AS.