A1_User Defined Outputs
A1_User Defined Outputs
A1_User Defined Outputs
Page 2 of 26
A1_User Defined Outputs.pdf
Page 3 of 26
Last update: 18/2/2020
1 Description of user interface
A User defined output is an option to specify up to 15 custom or user defined outputs in
NaviPac. The output can be defined in the NaviPac configuration module NaviPac.exe.
To add a User defined output instrument the operator has numerous options, ie either
• right-click the Vehicle node in the Project Tree and select Add instrument
• right-click the DataOutput node in the Project Tree and select Add instrument
These open the New Instrument dialogue. Then manually locate and select the User
defined output instrument in the DataOutput category.
Notice: for a general run-through of the NaviPac.exe configuration module please turn to the
EIVA NaviPac 4.0 Configuration Essentials eLearning module regarding this topic.
Page 4 of 26
1.1 Edit a User defined output
Select the User defined output instrument, either in the Project Tree or in the Vehicle
section. In the Properties section then enter/specify:
• Name
• I/O Mode: On, Off
• I/O Interfacing details
• Output format
The dialogue contains 2 lists with items that can be output on the selected output port or file.
The left list contains all optional data items whereas the right one contains the active items
selected by the user, thus actually defining the complete user defined output.
Note: There is practically no limit to the number of times an item type can be included for
different objects.
Page 6 of 26
the output item is to be a part of the output. An item can also be drag-and-dropped from the
Available list to the Selected list.
Item separator:
How to separate fields/columns (output items in the selected list): comma, space, colon,
semicolon and Tab. These will apply to all items.
Output type:
Specify how often the output is generated: All updates, Time, Event
Interval:
If Time is selected in Output type then the frequency to output the output string can be
specified.
Example:
OK button:
Accept last changes in the Selected list and save changes.
Cancel button:
Close the dialogue without saving changes.
Save… button:
Save a copy of the current defined output to an external file (.out2). This file can then be
used at a later stage.
Load… button:
Load output definitions from an external file (.out2) – current setup will be erased!
The various properties to edit will depend on the item type selected. Some of these will be
described in the following sections.
Page 8 of 26
1.1.1 Free text item
A dialogue with an ASCII text field is shown. To output binary data, select Binary and enter
the ASCII codes separated by a comma.
Positions can have either a default format, a user defined output format, eg nnnnnnn.nn, or
a fixed format, eg DDD°MMMSS.SSSSS.
If a fixed item type is selected a default format is used. If not, the user is allowed to enter a
format string. The format field for positions (and other data items) follows the ANSI C syntax
– see section 2 Custom output format strings.
• Signed (default):
The output will be prefixed with a minus to indicate west or south.
Sample: -000°01.146058'
Definition: Enter +/- in the format field
• Append indicator:
An E/N/S/W will be appended to the string.
Sample: 000°01.146058'W
Definition: Enter E or N or S or W in the format field
Page 10 of 26
Definition: Enter the separator (NOT E or N or S or W) in the format field – eg ‘,’ in
the above sample
• Special case:
Data without degree signs with 4 decimals.
Sample: Lat <DD MMM.MMMM> N Long <DDD MMM.MMMM> E
Definition: Enter X
NaviPac uses positive upward for heights, which means that the height output of eg a ROV
will become negative. This can be overruled by inserting a ‘d’ character in the format field
indicating that you want to have it output as Depth.
1.1.3 KP item
The unit of KP (kilometre point of a runline) is similar to the unit of the position output. The
format unit is default in kilometre.
Often the format unit is wanted in metres. This can be done by prefixing the format string
with an ‘m’ character (or ‘M’).
The above example will output KP in metre with at least 6 digits including leading zero. The
default KP setting outputs in km with 5 digits including leading zero.
If used in the US it’s often required to get the KP value as Station instead. This can be
achieved by inserting a ‘S’ or ‘s’ character.
The User defined output offers an item called DOL (Distance Off Line) measured in metre
(or current NaviPac distance unit).
It may also output the value called DCC (Distance Cross Course) instead. To do so, insert
the character c (lower case) in front of the data format. The output is default in selected data
unit (eg metric) – but you may select other formats if needed.
The field called DCC (Distance Cross Course) is a special (and more stable) variant of the
above DOL, as the definition depends on KP ascending direction (left-/+right) rather than on
sailing (design) direction (left-/+right).
Page 12 of 26
1.1.6 SMG item
The calculated speed SMG (Speed Made Good) can be output for a selected object.
The output will be knots per default, but you may choose other units by inserting a special
character in front of the format.
• Range to Waypoint
• Bearing to Waypoint (grid)
They are both position-based – meaning that the operator selects a vehicle to control the
output.
An object must be controlling a waypoint in the Vehicle Control View. This is done by
opening a Vehicle Control View in the master Helmsman’s Display, and then selecting a
waypoint in the Navigation Object column.
They are both position-based – meaning that the operator selects an object to control the
output.
The distance is calculated as position of waypoint minus position of object. To calculate the
inverse, that is object position minus waypoint position, enter a minus in the format field.
Which gyro to use and how the gyro values should be formatted can be selected.
Page 14 of 26
1.1.10 DAQ item
Which echo sounder depth or data acquisition channel should be output and in what format
can be selected.
If more than one motion sensor is available, a specific sensor can be selected along with
which items (roll, pitch, heave) should be output by that sensor and how they should be
formatted.
To output the event number enter eg %05d to use 5 digits with leading zeros. It is also
possible to include event text (manual event and user defined events) by entering %05d,%s
where %s represents the string with the event text.
The current bearing of the active line segment (or tangent of curve intersection point) can be
output as either true heading or grid heading (the latter is compensated for meridian
convergence).
How many digits the line direction (heading) must contain can be specified.
To output headings with leading zeros and two digits after the decimal point just set the
format to %06.2lf.
Defines the date and time of the observation. Note: This is not the data timestamp – but
the timestamp of the NaviPac output cycle.
Page 16 of 26
The system can be defined to output local time or UTC.
The date/time format can be defined using ANSI C format as explained in section 2.6. The
timestamp will then be given in resolution of 1 second.
You may also select a timestamp in the fixed format of hh:mm:ss.sss which allows you to
get time at a resolution of 1 ms.
Example:
Specifying: %H:%M:%S %d.%m.%Y
10:06:01 12.01.2020
To output a copy of raw instrument data just select the instrument in action. This will not
work for binary instruments.
• Ellipsoid name
Character string
• Semi major axis
Floating point number
• Inverse flattening
Floating point number
• Projection name
Character string
• Scale at Origin /* Point scale factor at the ellipsoid origin */
Character string
• First parallel /* First parallel in Lambert’s conical - degree */
ddd mm ss.ssss
• Second Parallel /* Second parallel in Lambert’s conical - degree */
ddd mm ss.ssss
• Longitude at Origin /* Origin lambda (lon) on the reference ellipsoid [degree] */
ddd mm ss.ssss
• Latitude at Origin /* Origin phi (lat) on the projection ellipsoid [degree] */
ddd mm ss.ssss
• False Easting /* Origin easting on the projection plane [metre] */
Floating point
• False Northing /* Origin northing on the projection plane [metre] */
Floating point
• UTM zone /* Derived from "Original Longitude" [1..60] */
Integer
If a Doppler log, eg an RDI Doppler log, is attached, then the system can output various
parameters from the PD0 data from the Doppler log.
Page 18 of 26
1.1.18 Combined Data Acquisition item
Via the Combined Data Acquisition item, you may combine two or three DAQ values such
as depth and altitude or depth plus constant for a single output.
Select the instruments (the lists to the left) and channels for each of them. Finally, scale the
inputs if they are in different data units. The special “instrument” called Constant value is
used for entering a fixed number.
+ Plus
- Minus
* Multiply
/ Divide by
NO None – the second source is ignored
The order of calculation will be from left to right (see below), defined as:
The above example gives the average value of DAQ1 plus DAQ20 (DAQ1+ DAQ20) *0.5.
Page 20 of 26
2. Custom output format strings
The format field for positions, depths etc follow the ANSI C syntax:
A format specification, which consists of optional and required fields, has the following form:
Each field of the format specification is a single character or a number signifying a particular
format option. The simplest format specification contains only the percent sign and a type
character (for example, %s). If a percent sign is followed by a character that has no meaning
as a format field, the character is copied to stdout. For example, to print a percent sign
character, use %%.
The optional fields, which appear before the type character, control other aspects of the
formatting, as follows:
Type
Required character that determines whether the associated argument is interpreted as a
character, a string, or a number (see Table R.3 printf type field characters).
Flags
Optional character or characters that control justification of output and printing of signs,
blanks, decimal points, and octal and hexadecimal prefixes (see Table R.4 Flag characters).
More than one flag can appear in a format specification.
Width
Optional number that specifies the minimum number of characters to be output (see printf
width specification).
Precision
Optional number that specifies the maximum number of characters printed for all or part of
the output field, or the minimum number of digits printed for integer values (see Table R.5
Precision values).
h | l | I64 | L
Optional prefixes to type that specify the size of the argument (see Table R.6).
When used with printf functions, specifies a single-byte character; when used
c int or wint_t
with wprintf functions, specifies a wide character.
When used with printf functions, specifies a wide character; when used with
C int or wint_t
wprintf functions, specifies a single-byte character.
Signed value having the form [ – ]d.dddd e [sign]ddd where d is a single decimal
e double digit, dddd is one or more decimal digits, ddd is exactly three decimal digits, and
sign is + or –.
E double Identical to the e format except that E rather than e introduces the exponent.
Signed value having the form [ – ]dddd.dddd, where dddd is one or more decimal
digits. The number of digits before the decimal point depends on the magnitude
f double
of the number, and the number of digits after the decimal point depends on the
requested precision.
Signed value printed in f or e format, whichever is more compact for the given
value and precision. The e format is used only when the exponent of the value is
g double
less than –4 or greater than or equal to the precision argument. Trailing zeros are
truncated, and the decimal point appears only if one or more digits follow it.
Identical to the g format, except that E, rather than e, introduces the exponent
G double
(where appropriate).
Prints the address pointed to by the argument in the form xxxx:yyyy, where xxxx
p Pointer to void is the segment and yyyy is the offset, and the digits x and y are uppercase
hexadecimal digits.
Page 22 of 26
When used with printf functions, specifies a single-byte character string; when
s String used with wprintf functions, specifies a wide character string. Characters are
printed up to the first null character or until the precision value is reached.
When used with printf functions, specifies a wide character string; when used with
S String wprintf functions, specifies a single-byte character string. Characters are printed
up to the first null character or until the precision value is reached.
– Left align the result within the given field width. Right align.
If width is prefixed with 0, zeros are added until the minimum width is reached. If 0
0 and – appear, the 0 is ignored. If 0 is specified with an integer format (i, u, x, X, o, No padding.
d) the 0 is ignored.
Prefix the output value with a blank if the output value is signed and positive; the
blank (' ') No blank appears.
blank is ignored if both the blank and + flags appear.
When used with the o, x, or X format, the # flag prefixes any non-zero output value
No blank appears.
with 0, 0x, or 0X, respectively.
When used with the e, E, or f format, the # flag forces the output value to contain a Decimal point appears only if
# decimal point in all cases. digits follow it.
When used with the g or G format, the # flag forces the output value to contain a Decimal point appears only if
decimal point in all cases and prevents the truncation of trailing zeros. digits follow it. Trailing zeros
Ignored when used with c, d, i, u, or s. are truncated.
If the width specification is an asterisk (*), an int argument from the argument list supplies
the value. The width argument must precede the value being formatted in the argument list.
A nonexistent or small field width does not cause the truncation of a field; if the result of a
conversion is wider than the field width, the field expands to contain the conversion result.
The precision specifies the maximum Six significant digits are printed, with any
g, G
number of significant digits printed. trailing zeros truncated.
Page 24 of 26
If the argument corresponding to a floating-point specifier is infinite, indefinite, or NaN,
printf gives the following output.
Value Output
+ infinity 1.#INFrandom-digits
– infinity –1.#INFrandom-digits
NAN digit.#NANrandom-digits
long int l d, i, o, x, or X
short int h d, i, o, x, or X
int64 I64 d, i, o, u, x, or X
Thus, to print single-byte or wide characters with printf functions and wprintf functions, use
format specifiers as follows:
To Print Character As Use Function Width Format Specifier
%% Percent sign
Page 26 of 26