FPT and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference Manual Home |


INSERT TRANSLATIONS OF FOREIGN OBJECTS

Syntax:

[DO NOT] INSERT TRANSLATION[S] OF FOREIGN OBJECTS

Function:

This command is used to handle numbers in formats which are foreign to the current host, for example, where Gould-SEL real numbers are read from external hardware by a Unix host using IEEE numbers.

Foreign numbers are specified in the code or in template (FTM) files by commands of the form, for example:

C%INSERT REAL*4 FUNCTION S2IEEE TO TRANSLATE READ ACCESS TO VS

If foreign translations are inserted in this case, every read access to VS will be modified to use the function S2IEEE to reformat the number. The commands [DO NOT] INSERT TRANSLATIONS OF FOREIGN OBJECTS control whether or not the translations are inserted.

Default:

Foreign translations are inserted by default. Therefore, to suppress translation, it is necessary to specify DO NOT INSERT TRANSLATIONS OF FOREIGN OBJECTS in the specification file or on the operating system command line.

Where to use this command:


DO

DO NOT

Operating system command line

Yes

Yes

Configuration file, config.fsp

Yes

Yes

Specification (FSP) files, *.fsp

Yes

Yes

Interactively, to FPT> prompt:

No

No

Interactive command files

No

No

Embedded in the Fortran code

Yes

Yes

Example:

The code, or a template (FTM) file contains the declarations:

REAL*4 TV,VS2(128) !% INSERT REAL FUNCTION S2IEEE TO TRANSLATE READ ACCESS TO VS2 !% INSERT REAL FUNCTION IEEE2S TO TRANSLATE WRITE ACCESS TO TV

The read access to the variable VS2:

PHI=VS2(3)

is translated:

!% TRANSLATION FUNCTION INSERTED FOR: VS2 PHI=S2IEEE(VS2(3))

TV occurs in a READ statement, and data is therefore written to it:

READ (4)TV

The statement is modified:

READ (4)TV_TMP !% TRANSLATION FUNCTION INSERTED FOR: TV TV=IEEE2S(TV_TMP)

The new variable TV_TMP is declared automatically wherever it is needed.

Note the commands !% TRANSLATION FUNCTION INSERTED... which FPT has embedded in the code. These prevent FPT from inserting a second translation if it is re-run on the code.

See also:

INSERT FUNCTION TO TRANSLATE READ ACCESS

INSERT FUNCTION TO TRANSLATE WRITE ACCESS


Copyright ©1995 to 2014 Software Validation Ltd. All rights reserved.