5.5 Report templates

KISSsoft has a template for each calculation module in which the form and content are already assigned. These templates can be changed using any Text Editor or with the KISSsoft Report Viewer. In this way every calculation can be formatted and output customised to a specific user requirements.

5.5.1 Storage und Designations

Every report template is stored in directory <KISSDIR>. User specified designations have the Structure MMMMlsz.rpt that summarise the following dimensions:




MMMMDesignation of modulee.g. M040



l historical allways = l



s Language of report s = d: german, e: english, f : french
i: italian, s:spanish, a: english(imperial)



z historical always = 0



.rpt Designation Reports of calculations
templates of reports end on .rtf.



   

Examples



Bolted joints calculation:
M040LD0.RPT german issue
M040USER.RPT standard issue over interface,
becomes file M040USER.OUT


Spur gear calculation:
Z012LD0.RPT spur gear pair, german issue
Z012USER.RPT standard issue over interface,
becomes file Z010USER.OUT
Z10GEAR1.RPT print out over interface, contains only data
of gear 1, becomes file Z010GEAR1.OUT
Z10GEAR2.RPT issued over interface, contains only data
of gear 2, becomes file Z010GEAR2.OUT
Z011LD0.RPT Single gear, german issue
Z013LD0.RPT Rack, german issue
Z014LD0.RPT Planetary gear, german issue
Z015LD0.RPT 3 gears, german issue
Z016LD0.RPT 4 gears, german issue


English issue:
M040LE0.RPT Thread calculation, English issue


American issue:
M040LA0.RPT Thread calculation, American issue


5.5.2 Scope of Reports

The Scope, e.g. length, of the report can be defined in the Menu Report Settings on a scale from 1 to 9 where 9 represents the complete data set and 1 for a short summary. In the report template there exists a digit at the beginning of each line between 1 and 9. This digit defines (independently of the previously mentioned setting) whether the line should be read or not.

Example: If a report length of length 5 (middle) has been chosen then all lines of the report template with 1, 2, 3, 4 or 5 at the beginning are read. Lines with 6, 7, 8 and 9 are not read.

5.5.3 Formatting

Report templates as well as completed reports are text files containing Microsoft Windows labels. Please process your reports only in Windows programs to avoid complications with symbols.

The following directions and key words are defined in the report format:

5.5.3.1 Text formatting

KISSsoft reports are normally generated in RTF-Format. RTF recognises the following text formats:




Description Start Ende



Under Score <UL> </UL>



Strichen Through<STRIKE> </STRIKE>



Bold <BF> </BF>



Kursive <IT> </IT>



Tiefgestellt <SUB> </SUB>



Font Size <FONTSIZE=xx>



Enlarge Font <INCFONTSIZE> <DECFONTSIZE>



Reduce Font <DECFONTSIZE><INCFONTSIZE>



Page break <NEWPAGE>



Line break <BR>



Text Color red <RED> <BLACK>



Text Color green <GREEN> <BLACK>



Text Color blue <BLUE> <BLACK>



Space <SPACE>



Figure
<IMAGE=name,WIDTH=xx,
einfügen
HEIGHT=yy,PARAM=xyz>



5.5.3.2 Comments

Comment lines begin with //. Comments are ignored when generating a report.

Example

// I have changed the report text here on 13.12.95, hm
Tip diameter mm : %10.2f {sheave[0].da}

In this case, only the second line will be given out.

5.5.3.3 Calculation variables

No variables can be defined by the user (other than those used for FOR-Loop which can be named by the user and whose values can be entered; see Chapter 5.5.3.5).

Replacement character

The file type and format of a variable is given by a Replacement character:

The data types must match the data types used in the program. The value will be given out exactly in the position where the replacement character stands. The Syntax of the formatting corresponds to the C/C++-Standard.

Examples:

Counter-Example:

Variables

The variable which should be actually given must be behind the replacement character in the same line. The variable is marked in curly brackets. If these brackets are removed then the variable name will be given as normal text.

Important: The number of the replacement characters must match the number of bracket pairings {}.

Example:

%f {sheave[0].d} gives a value for the variable sheave[0].d in the position %f as a floating point with 6 decimal places.

Basic Calculations – Output of Altered Variables

In the report, variables can be issued differently. They can be multiplied or divided as well as factors can be added or subtracted. This function is also valid in the arguments of the IF- or FOR-conditions.

Value of the variable multiplied %3.2f {Var*2.0}
Value of the variable divided %3.2f {Var/2.0}
Value of the variable added %3.2f {Var+1.0}
Value of the variable subtracted%3.2f {Var-2}

Similarly, the two functions grad and rad are available for conversion into degree or radiant respectively.

angle %3.2f {grad(angle)}

Variables can be combined with each other, like {sheave[0].d-sheave[1].d}. More than two variables can be used also. Values with signs have to be put in brackets, e.g. {ZR[0].NL*(1e-6)}.

You can use the functions you find in table 5.2.


Function Meaning


sin(angle) Sinus of angle in radians
cos(angle) Cosinus of angle in radians
tan(angle) Tangens of angle in radians
asin(val) Arcussinus of val, returns radians
acos(val) Arcuscosinus of val, returns radians
atan(val) Arcustangens of val, returns radians
abs(val) |val|
exp(val) eval
log(val) returns x in ex = val
log10(val) returns x in 10x = val
sqr(val) val2
sqrt(val) returns √ ----
  val
pow(x;y) returns xy
sgn(val) returns (|    1  if val > 0
{
|(    0  if val = 0
   - 1  if val < 0
sgn2(val) returns {
   1  if val ≥ 0
   0  if val < 0
grad(angle) Conversion from radians to degree
rad(angle) Conversion from degree to radians
mm_in(val) returns val∕25.4
celsius_f(val) returns 9
5val + 32
min(ν1; 5) returns minimum of ν1,5
max(ν1; 5) returns maximum of ν1,5
and(ν1; ν2) binary and function
or(ν1; ν2) binary or function
xor(ν1; ν2) binary exclusive or function
AND(ν1; 5) logical and function
OR(ν1; ; ν5) logical or function
NOT(val) returns {
   0  if val ⁄= 0
   1  if val = 0
LESS(ν1; ν2) returns {  1  if ν <  ν
         1    2
   0  if ν1 ≥ ν2
EQUAL(ν1; ν2) returns {
   1  if ν1 = ν2
   0  if ν1 ⁄= ν2
GREATER(ν1; ν2)returns {  1  if ν >  ν
         1    2
   0  if ν1 ≤ ν2

Table 5.2: Possible functions in for calculations in the report.

5.5.3.4 Interrogation of Condition IF ELSE END

The interrogation of condition enables you to issue certain values or text only if a certain condition is fulfilled. The following conditions are supported:



Combination of CharactersMeaning


== equal
>= larger or equal
<= smaller or equal
! = unequal
< smaller
> larger


This condition has to be written as follows:

IF (Condition) {Var}
Case 1
ELSE
Case 2
END;

Example:

IF (%i==0) {Zst.kXmnFlag}
Addendum modified      no
ELSE
Addendum modified      yes
END;

If variable Zst.kXmnFlag is 0, the first text is issued, if it is not 0, the second. Any amount of lines can stand between IF, ELSE and END. Every branch beginning on IF has to be closed by END; (Please note the semicolon after END!). The key word ELSE is optional, it reverses the condition. Branches can be interlaced up to level 9.

Example of a Simple Branch

IF (%i==1) {ZP[0].Fuss.ZFFmeth}
Calculation of the tooth form factor after method: B
END;

If variable ZP[0].Fuss.ZFFmeth is 1, a text is issued, otherwise not.

Example of Interlacing Branches

IF (%f<=2.7) {z092k.vp}

periodical manual lubrication (Text 1)

ELSE

IF (%f<12) {z092k.vp}

Lubrication with droplets (2 to 6 droplets per minute) (Text 2)

ELSE

IF (%f<34) {z092k.vp}

Lubrication with oil bath lubrication (Text 3)

ELSE

Lubrication with circulation system lubrication (Text 4)

END;

END;

END;

If variable z092k.vp is equal or smaller than 2.7, text 1 is issued. If not, the program checks whether z092k.vp is smaller than 12. If this is true, text 2 is issued. If it is not true, the program checks whether z092k.vp is smaller than 34. If this is true, text 3 is issued, otherwise text 4.

5.5.3.5 Loops FOR

In the KISSsoft report generator, FOR-loops can be entered, too. Within a FOR-loop a counting variable is counted up and down. You can employ up to 10 interlaced constructs.

A loop is constructed as follows:

FOR varname=%i TO %i BY %i DO {Initial value}{Final value} {Step}
// Access to variable with #varname oder $varname
...
END FOR;

Example of a Simple Loop

FOR i=0 TO 10 BY 1 DO
phase number #i $i
END FOR;

This is issued as:

phase number 0 A
phase number 1 B
phase number 2 C
phase number 3 D
phase number 4 E
phase number 5 F
phase number 6 G
phase number 7 H
phase number 8 I
phase number 9 J
phase number 10 K

Within a loop, you can use any counter variables for all functions, arrays included.