This guide is a library of all the available functions and operations that can be created as an arithmetic channel under the virtual variables section of a Q.station.
Full function library info can also be accessed by running GI.bench, right-clicking the GI icon in the system tray, and selecting help. Navigate to System Configuration > Variable > Functions and Formulas > Functions.
There are slight naming differences in the functions between GI.bench and test.commander but similar functionality. Not all functions in GI.bench are available in test.commander.
ABS(value)
Instead of a value, a variable within the same system can be selected.
Example: ABS(-243) = 243
ArcCos(value)
Instead of a value, a variable within the same system can be selected.
ArcSIN(value)
Instead of a value, a variable within the same system can be selected.
ArcTan(value)
Instead of a value, a variable within the same system can be selected.
Averaging(Variable;TypeSelector;AdditionalParameter)
Variable: Reference variable
Type;AdditionalParameter: Type and correspondent additional parameter
Parameter | Description |
0 | Lowpass filter. AdditionalParameter defines -3dB filter frequency in [Hz]. |
1 | Sliding average. AdditionalParameter defines the number of values. |
2 | Event-driven reset. No AdditionalParameter. Need to be defined at event (reset) section => recently stored value is as long deleted, as long the condition is pending (=> during value is pure, not averaged) |
3 | North step with event-driven reset (eliminate “North step problem = averaging of values in the range of 0 and 360°”). Need to be defined at event (reset) section => recently stored value is as long deleted, as long the condition is pending (=> during value is pure, not averaged) |
4 | Arithmetic average. AdditionalParameter defines the number of values. |
Classification of value
ClassifyValue(TypeSelector;Value)
Code | Meaning | Description |
---|---|---|
Valid | NOT(Infinite) AND NOT(NotANumber) | |
1 | Invalid | Infinite OR NotANumber |
2 | Normal | NOT(Infinite) AND NOT(NotANumber) AND NOT(Value 0) |
3 | NotANumber | |
4 | Infinite |
This function is used to control the internal FFT Processors (enable/disable) - condition is used from event mechanism of the variable - each FFT Processor is enabled if configured and not controlled with such a function
ControlFFTProcessor(ProcessorIndex)
ErrorActive = StateField < 0
FunctionDisabled = Abs(StateField) >= 1000
State = Abs(StateField) % 1000
Value | Description |
---|---|
Init | |
1 | CheckAndReConfigure |
2 | WaitForData |
3 | ProcessData |
4 | EvaluateData |
5 | EndCycle |
Counts each loop and runs from 0 … 99999 with wrapping
This function is used to control the internal FFT Processor Evaluator (enable/disable) - condition is used from event mechanism of the variable - each FFT Processor Evaluator is enabled if configured and not controlled with such a function
ControlFFTProcessorEvaluator(ProcessorIndex;EvaluatorIndex)
ErrorActive = StateField < 0
FunctionDisabled = Abs(StateField) >= 1000
State = Abs(StateField) % 1000
Value | Description |
---|---|
Done | |
1 | Busy |
Counts each loop and runs from 0 … 99999 with wrapping
Control internal logger - function is used to control the behavior of the internal DataLogger (event-driven function)
ControlInternalLogger(CommandSelector;LoggerIndex0[;LoggerIndex 1 ... LoggerIndex n-1])
Command selector variants
Code | Meaning | Description |
---|---|---|
Enable/Disable | If the event condition is true, logging is enabled; otherwise disabled. If the function is not used, the logger is activated or deactivated as configured | |
1 | Clear errors | If the event condition is true, all stored error messages of this logger(s) are cleared |
4 | Eject drive | Will eject the current data drive of this logger (drive can be removed when RUN/LOG LED stops flashing fast) |
Logger index/indices to be used (-1 will select all loggers)
COS(value)
Instead of a value, a variable within the same system can be selected.
Convert date/time to OLE2 time format
ConvertDateTimeToTimeOLE2(Years;Months;Days;Hours;Minutes;Seconds;Milliseconds[;Microseconds])
Example: DateTime2OLE(2006;09;01;16;30;25;10)
Convert date/time to DC time format
ConvertDateTimeToTimeDC(Years;Months;Days;Hours;Minutes;Seconds;Milliseconds[;Microseconds])
Example: ConvertDateTimeToTimeDC(2006;09;01;16;30;25;10)
Convert DC time format to Date/Time part.
ConvertTimeDCToDateTime(TimeDC;PartSelector)
Code | Meaning | Description |
---|---|---|
Year | ||
1 | Month | |
2 | Day | |
3 | Hour | |
4 | Minute | |
5 | Second | |
6 | MilliSecond | |
7 | MicroSecond |
Convert OLE2 time format to Date/Time part.
ConvertTimeOLE2ToDateTime(TimeOLE2;PartSelector)
Code | Meaning | Description |
---|---|---|
Year | ||
1 | Month | |
2 | Day | |
3 | Hour | |
4 | Minute | |
5 | Second | |
6 | MilliSecond | |
7 | MicroSecond |
State of data logger - function can be used to get an actual state of a specific data logger to provide a state machine, e.g., if an e-mail should be sent in case of an error
DataLoggerState(LoggerIndex;InfoSelector)
Code | Meaning | Description |
---|---|---|
Error State | Bit0 = Configuration error | |
Bit1 = Buffer overrun | ||
Bit2 = Data limit reached | ||
Bit3 = Renaming file failed | ||
Bit4 = Creating file failed | ||
Bit5 = No storage destination available | ||
Bit6 = Sending mail failed | ||
Bit7 = Sending a file via FTP failed | ||
1 | IsEnabled | Logger is enabled |
2 | IsLogging | The logger is writing to a file |
3 | IsStartTriggerActive | The start trigger is in progress |
4 | IsStopTriggerActive | Stop trigger is in process |
5 | FilesStored | Number of logged files since the start [times] |
6 | FileProgress | Progress of the actual file [%] |
7 | TriggerProgress | Progress of the actual trigger [%] |
8 | MailsSent | Number of Emails sent since the start [times] |
9 | FTPSent | Number of files sent via FTP |
10 | DestinationIndex | Index of the actual data storage |
11 | DestinationSize | Size of the actual data storage [bytes] |
12 | DestinationRemaining | Available size on the actual data storage [bytes] |
13 | DestinationLoad | Load of the actual data storage [%] |
14 | DataSrcOverrunCount | Number of data source overruns [times] |
15 | DataSrcActSize | Actual size of source data buffer [bytes] |
16 | DataSrcCapacity | The capacity of source data buffer [bytes] |
17 | DataSrcMaxSize | Maximum Size of source data buffer since the start [bytes] |
18 | PostProcessBufferSrcOverrunCount | Number of PostProcessor source overruns [times] |
19 | PostProcessBufferSrcActSize | The actual size of the PostProcessor source data buffer [bytes] |
20 | PostProcessBufferSrcCapacity | The capacity of PostProcessor source data buffer [bytes] |
21 | PostProcessBufferSrcMaxSize | Max. size of PostProcessor source data buffer since the start [bytes] |
Suppress a defined range of a variables measurement range
DeadBand(Value;RangeMinimum;RangeMaximum;TypeSelector;AddParam1;AddParam2)
Type selector with corresponding additional parameters: behavior if (Value >= RangeMinimum) AND (Value < RangeMaximum)
Code | Meaning | Description |
---|---|---|
Valid then actual value | Stay at last valid value for duration time, then actual value | |
1 | Valid then default value | Stay at last valid value for duration time, then default value |
2 | Default then actual value | Default value for duration time, then actual value |
Add param 1 variant
TypeSelector | Meaning |
---|---|
Valid then actual value | Duration time [s] |
Valid then default value | Duration time [s] |
Default then actual value | Duration time [s] |
Add param 2 variants
TypeSelector | Meaning |
---|---|
Valid then default value | Default value |
Default then actual value | Default value |
Deadband(Var(“xyz”);361;999999;0;1)
The result remains at last valid value for 1s, not until Var(“xyz”) is >360 for MORE than 1s, then again the actual value of Variable will be taken.
Derivative of value - function does derivative, using the time base (with granularity of the processing time of the arithmetic stack)
Derivative(Value;Timebase)
Time [s]
Envelope negative of the value
EnvelopeNegative(Value;Slew-Timebase)
Slew-Timebase
Slew time [s]
Envelope positive of value
EnvelopePositive(Value;Slew-Timebase)
Slew time [s]
Compares 2 values; if Value1 = Value2, then the result is 1, otherwise it is 0
Equal(Value1;Value2)
The value can be a variable in the system or a static value.
Exponential value: Result = e^Value
Exp(Value)
External slave UART diagnostic value - returning code indicating the faulty slave and can be used, e.g., to send an e-mail if there is an error in the system
ExtUartDiag(StartIndex;Count)
Each slave in the system will get a certain bit – it will be sorted according to the UART and the address - StartIndex is the number of the bit where the diagnostic should start
CountDefines how many slaves have to be analyzed - maximum value depends on the data format of the function (8, 16, 32, or 64-bit). For easier interpretation of the return values in big systems, create more functions that only observe a small number of slaves with one and handle the others by increasing the StartIndex. E.g. for 16 slaves: ExtUartDiag(0;8) and ExtUartDiag(8;8).
For E.g. hardware setup is 3 UARTs used with:UART0 contains 3 slaves with addresses 1, 2 and 3
UART1 contains 2 slaves with addresses 1 and 2
UART2 contains 1 slave with address 1
Example 1:
UART0
Address 1
Bit 0
Address 2
Bit 1
Address 3
Bit 2
UART1
Address 1
Bit 3
Address 2
Bit 4
UART2
Address 1
Bit 5
ExtUartDiag(2;3)
Following slaves will be observed (StartIndex = 2, Count = 3) and corresponding bits are set:
Return Code | |||
---|---|---|---|
UART0 | Address 3 | Bit 2 | 1 |
UART1 | Address 1 | Bit 3 | 2 |
Address 2 | Bit 4 | 4 |
ExtUartDiag(3;1)
Following slaves will be observed (StartIndex = 3, Count = 1) and corresponding bits are set:
Return Code | |||
---|---|---|---|
UART1 | Address 1 | Bit 3 | 1 |
Calculates an FFT of an input variable
FFTProcessor(VariableIndex;Size;WindowType;WindowSubType;WindowParameter;EnableGeneratingFiles[;Mode;TimeDomainBufferOverlappingPercentage])
This is the index of the input variable placed in at least one DataBuffer. Timestamp variable can NOT be used. Range: 0 … variables count – 1
SizeThe number of points to be calculated. It must be a power of 2. Pay attention that each point requires 52 bytes of internal memory for calculation !!! Range: 4 … 1048576
WindowTypeWindow type variants
Code | Meaning | Description |
---|---|---|
Blackman | ||
1 | BlackmanNuttal | |
2 | BlackmanHarris | |
3 | BartlettHanning | |
4 | Exponential or Poisson | |
5 | FlatTop | |
6 | Gaussian | |
7 | Hamming | |
8 | Hanning | |
9 | Kaiser | |
10 | Lanczos | |
11 | Nuttal | |
12 | PowerOfCosine | |
13 | Rectangular or None | |
14 | Triangular or Bartlett | |
15 | Welch |
Window sub-type (window parameter type) variants
Code | Meaning | Description |
---|---|---|
Variant 0 | ||
1 | Variant 1 |
Window parameter variants
WindowType | WindowSubType | Meaning |
---|---|---|
Exponential or Poisson | Variant 0 | Tau [s] |
Variant 1 | Decay [dB] | |
Gaussian | Variant 0 | Sigma |
Kaiser | Variant 0 | Alpha |
Variant 1 | Beta | |
PowerOfCosine | Variant 0 | Power |
Controls generation of the following files inside the controller - they are readable via FTP measurement mode access (root path: tmp/fft)
SubPath/File | Description |
---|---|
FFTProcessor_Index[i]/ | each processor has a sub-directory marked with its index [i] |
sig_reim.dat | real/imaginary part of the used input signal |
win_reim.dat | real/imaginary part of the used window |
out_maph.dat | magnitude/phase of calculated spectra |
[FFTPrEv]analyzed.dat | the magnitude of analyzed parts split into different variables: Original, ZeroOneBin, Zero, Signal, Noise, Distortion, HighestSidePeakInclDistortion, HighestSidePeakExclDistortion ([FFTPrEv] in case of more than 1 evaluator viewing the same FFTProcessor, the file name is prefixed with “FFTProcessorEvaluator_Index[i]_”, to make identification possible) |
Variants
Code | Meaning | Description |
---|---|---|
Off | recommended usage due to performance reasons !!! | |
1 | On |
Mode variants
Code | Meaning | Description |
---|---|---|
Off | SignalPeak calculation enabled (default) | |
1 | On | SignalPeakPeak calculation enabled |
Percentage of “old” values kept in time domain buffer. If, e.g., 75 is defined, 75% of the defined point count remains in the buffer, and 25% of the oldest points are removed. Defining 100 makes no sense because NO new points would then be filled anymore; therefore limit is a maximum of 99. The system tries to take all values with no loss. If not possible, it switches to mode “take last defined point count values,” which needs less performance but with the possibility of losing values. Recent behavior is nearly the same as defining 0 (default) here, meaning 100% oldest points are removed.
ResultValue contains information built from ErrorActive, FunctionDisabled, State, and ExecutionCounterStateField = ResultValue % 10000ErrorActive = StateField < 0
FunctionDisabled = Abs(StateField) >= 1000
State = Abs(StateField) % 1000
Value | Description |
---|---|
Init | |
1 | CheckAndReConfigure |
2 | WaitForData |
3 | ProcessData |
4 | EvaluateData |
5 | EndCycle |
Counts each loop and runs from 0 … 99999 with wrapping
Counts each loop and runs from 0 … 99999 with wrappingFFTProcessorEvaluator
Calculates values based on the result of a previously defined FFTProcessor
FFTProcessorFFTProcessorEvaluator(FFTProcessor;Function;StartFrequency;StopFrequency;Result1VariableIndex;Result2VariableIndex)
This is the variable of the FFTProcessor to be used. Range: V1 … Vn
FunctionFunction variants
StartFrequencyCode
Meaning
Description
FFTErrorStates
1
Minimum
2
Maximum
3
Integral
4
RMS - (R)oot(M)ean(S)quare
5
SINAD - (S)ignal-to-(I)nterference ratio including (N)oise (A)nd (D)istortion
Best with Hanning-Window
Take care that single-sine-tone signal source has better quality than you expect as a result
Signal level should be in full range of used input6
ENOB - (E)ffective(N)umber(O)f(B)its
Best with Hanning-Window
Take care that single-sine-tone signal source has better quality than you expect as a result
Signal level should be in full range of used input7
SNR - (S)ignal-to-(N)oise (R)atio
Best with Hanning-Window
Take care that single-sine-tone signal source has better quality than you expect as a result
Signal level should be in full range of used input8
THD - (T)otal(H)armonic(D)istortion
Best with Hanning-Window
Take care that single-sine-tone signal source has better quality than you expect as a result
Signal level should be in full range of used input9
SFDR - (S)purious(F)ree(D)ynamic(R)ange
Best with Hanning-Window
Take care that single-sine-tone signal source has better quality than you expect as a result
Signal level should be in full range of used input10
EVV - (E)ffective(V)ibration(V)elocity
11
EVD - (E)ffective(V)ibration(D)isplacement
12
Difference
1000
TimeDomainBufferLosslessAndOverlappingHealth
StopFrequencyFunction
Meaning
FFTErrorStates
TimeDomainBufferLosslessAndOverlappingHealth
Others
Frequency to start the evaluation
Range: 0.0 … NyquistFrequency-BinFrequency and < StopFrequency;Result1VariableIndexFunction
Meaning
FFTErrorStates
TimeDomainBufferLosslessAndOverlappingHealth
Others
Frequency to stop evaluation
Range: 0.0 … NyquistFrequency-BinFrequency and > StartFrequency;This is the index of the output variable where 1st result has to be written to the Variable that needs to have write access
Range: 0 … variables count - 1Result2VariableIndexFunction
Meaning
Description
FFTErrorStates
Bit0 = Runtime_ProcessorInputVaribaleIndexError
Bit1 = Runtime_ProcessorSizeError
Bit2 = Runtime_ProcessorWindowTypeError
Bit3 = Runtime_ProcessorWindowSubTypeError
Bit4 = Runtime_ProcessorWindowParameterError
Bit5 = Runtime_ProcessorEnableGeneratingFilesError
Bit6 = Runtime_ProcessorBufferSizeError
Bit7 = Runtime_ModeError
Bit8 = Runtime_TimeDomainBufferOverlappingPercentageError
Bit9 = Runtime_PerformanceSavingTakeLastValuesModeActivatedError
Bit10-19 = not used
Bit20 = Runtime_ProcessorEvaluatorFunctionError
Bit21 = Runtime_ProcessorEvaluatorStartFrequencyError
Bit22 = Runtime_ProcessorEvaluatorStopFrequencyError
Bit23 = Runtime_ProcessorEvaluatorResult1VariableIndexError
Bit24 = Runtime_ProcessorEvaluatorResult2VariableIndexError
Bit25-62 = not used
Bit63 = Runtime_NotSpecified
Minimum
Value amplitude [unit of source variable]
In case of:
- start/stop frequency error, value is: -1e10Maximum
Value amplitude [unit of source variable]
In case of:
- start/stop frequency error, value is: -1e10Difference
Value magnitude/amplitude [unit of source variable]
In case of:
- start/stop frequency is different, value is magnitude (value @stop - value @start)
- start/stop frequency is same, value is amplitude
- start/stop frequency error, value is: -1e10Integral
Value [unit of source variable]
In case of:
- start/stop frequency error, value is: -1e10RMS
Value [unit of source variable]
In case of:
- start/stop frequency error, value is: -1e10SINAD
Value [dB]
In case of:
- start/stop frequency error, value is: -1e10
- not finding zero peak slope end error, value is: -2.2e10
- start/stop frequency error, value is: -1e10
- not finding zero peak slope end error, value is: -2.2e10
- zero peak is more than 5 % of full bandwidth wide error, value is: -2.3e10
- signal peak not found error, value is: -3e10
- not finding signal peak slope start error, value is: -3.1e10
- not finding signal peak slope end error, value is: -3.2e10
- signal peak is more than 10 % of full bandwidth wide error, value is: -3.3e10
- power of Noise+Distortion = 0.0 error, value is: -10e10
- ratio of power of Signal+Noise+Distortion and power of Noise+Distortion < 0.0 error, value is: -10.1e10ENOB
Value [bits]
In case of:
- start/stop frequency error, value is: -1e10
- not finding zero peak slope end error, value is: -2.2e10
- zero peak is more than 5% of full bandwidth wide error, value is: -2.3e10
- signal peak not found error, value is: -3e10
- not finding signal peak slope start error, value is: -3.1e10
- not finding signal peak slope end error, value is: -3.2e10
- signal peak is more than 10% of full bandwidth wide error, value is: -3.3e10
- power of Noise+Distortion = 0.0 error, value is: -10e10
- ratio of power of Signal+Noise+Distortion and power of Noise+Distortion < 0.0 error, value is: -10.1e10SNR
Value [dB]
In case of:
- start/stop frequency error, value is: -1e10
- not finding zero peak slope end error, value is: -2.2e10
- zero peak is more than 5 % of full bandwidth wide error, value is: -2.3e10
- signal peak not found error, value is: -3e10
- not finding signal peak slope start error, value is: -3.1e10
- not finding signal peak slope end error, value is: -3.2e10
- signal peak is more than 10 % of full bandwidth wide error, value is: -3.3e10
- power of Noise = 0.0 error, value is: -10e10THD
Value [dB]
In case of:
- start/stop frequency error, value is: -1e10
- not finding zero peak slope end error, value is: -2.2e10
- zero peak is more than 5 % of full bandwidth wide error, value is: -2.3e10
- signal peak not found error, value is: -3e10
- not finding signal peak slope start error, value is: -3.1e10
- not finding signal peak slope end error, value is: -3.2e10
- signal peak is more than 10 % of full bandwidth wide error, value is: -3.3e10
- power of Signal = 0.0 error, value is: -10e10SFDR
Value including harmonic distortions of the signal [dB]
In case of:
- start/stop frequency error, value is: -1e10
- not finding zero peak slope end error, value is: -2.2e10
- zero peak is more than 5 % of full bandwidth wide error, value is: -2.3e10
- signal peak not found error, value is: -3e10
- not finding signal peak slope start error, value is: -3.1e10
- not finding signal peak slope end error, value is: -3.2e10
- signal peak is more than 10 % of full bandwidth wide error, value is: -3.3e10
- power of Signal-Side-Peak = 0.0 error, value is: -10e10EVV
Value [m/s] (for that, source has to be VibrationAcceleration [m/s2])
In case of:
- start/stop frequency error, value is: -1e10EVD
Value [m] (for that, source has to be VibrationAcceleration [m/s2])
In case of:
- start/stop frequency error, value is: -1e10Others
Value
-100e10
This is the index of the output variable where 2nd result has to be written to Variable need to have write access
Range: 0 … variables count - 1ResultValue contains information built from ErrorActive, FunctionDisabled, State, and ExecutionCounterStateField = ResultValue % 10000Function
Meaning
Description
Minimum
Value frequency [Hz]
In case of:
- start/stop frequency error, value is: -1e10Maximum
Value frequency [Hz]
In case of:
- start/stop frequency error, value is: -1e10Difference
Value phase [°]
In case of:
- start/stop frequency is different, value is delta phase (value @stop - value @start)
- start/stop frequency is same, value is phase
- start/stop frequency error, value is: -1e10SFDR
Value excluding harmonic distortions of the signal [dB]
In case of:
- start/stop frequency error, value is: -1e10
- not finding zero peak slope end error, value is: -2.2e10
- zero peak is more than 5 % of full bandwidth wide error, value is: -2.3e10
- signal peak not found error, value is: -3e10
- not finding signal peak slope start error, value is: -3.1e10
- not finding signal peak slope end error, value is: -3.2e10
- signal peak is more than 10 % of full bandwidth wide error, value is: -3.3e10
- power of Signal-Side-Peak = 0.0 error, value is: -10e10Others
Value
-100e10
ErrorActive = StateField < 0
FunctionDisabled = Abs(StateField) >= 1000
State = Abs(StateField) % 1000
ExecutionCounter = Trunc(Abs(ResultValue / 10000))Value
Description
Done
1
Busy
This function gets the buffer size [%]
GetBufferSizePercent(BufferIndex)
This index defines which buffer has to be monitored.
This function returns state of digital input
GetDIn(Number)
This function returns state of digital output
GetDOut(Number)
This functionality provides free space of the data drive [%]
GetRemainSizePercentOfDataDrive(DataDriveIndex)
DataDriveIndex:
Drive Type
Connector
Directory Name
Data Drive Index
Internal HDD
onboard
hd0
Additional HDD (e.g. SATA)
Extension Q.station X SSD
hd1
1
SD Card
SD Card slot
hd1
2
USB Data Drives
USB0 … USB99 + Hub Port0 … Port98
usb0 … usb99_98
100 … 9999
Network drives
index from configuration
Gets values from NMEA-interfaced devices
GetPositioningData(Selector;InfoSelector)
Defines the port where the device is connected to (e.g., GPS-Module connected via USB->RS232 converter and protocol NMEA-0183)
Code | Port | Description |
---|---|---|
100 | USB0 | right port |
101 | USB0 Hub-Port0 | right port |
102 | USB0 Hub-Port1 | right port |
103 | USB0 Hub-Port2 | right port |
104 | USB0 Hub-Port3 | right port |
200 | USB1 | left port |
201 | USB1 Hub-Port0 | left port |
202 | USB1 Hub-Port1 | left port |
203 | USB1 Hub-Port2 | left port |
204 | USB1 Hub-Port3 | left port |
Info selector variants
Code | Meaning | Description | Device / Command |
---|---|---|---|
Time | as TimeOLE2 (days since 01.01.1900) | GarminGPS / GGL, GGA, RMC | |
1 | Latitude | as degrees and minutes | GarminGPS / GGL, GGA, RMC |
2 | Longitude | as degrees and minutes | GarminGPS / GGL, GGA, RMC |
3 | Speed | [m/s] | GarminGPS / RMC |
4 | Heading | [°] | GarminGPS / RMC |
5 | Number of satellites | seen satellites | GarminGPS / GSV, GGA |
6 | Altitude above NN | [m] | GarminGPS / GGA |
7 | Quality | state | GGA |
8 | Horizontal dilution of precision | GGA | |
9 | Rate and direction of turn | ROT | |
10 | Longitudinal water speed | VBW | |
11 | Transverse water speed | VBW | |
12 | Longitudinal ground speed | VBW | |
13 | Transverse ground speed | VBW | |
14 | Track degrees: true | VTG | |
15 | Track degrees: magnetic | VTG | |
16 | Depth below transducer | [feet] | DBT |
17 | Depth below transducer | [m] | DBT |
18 | Depth below transducer | [fathoms] | DBT |
19 | Water: depth | [m] | DPT |
20 | Water: offset from transducer | DPT | |
21 | Wind: angle | [°] | MWV |
22 | Wind: speed | MWV | |
23 | Water: temperature | [°C] | MTW |
24 | Own ship data: heading | [°] | OSD |
25 | Own ship data: vessel course | [°] | OSD |
26 | Own ship data: vessel speed | OSD | |
27 | Own ship data: vessel set | [°] | OSD |
28 | Own ship data: vessel drift | OSD | |
29 | RADAR system data: cursor range | RSD | |
30 | RADAR system data: cursor bearing | [°] | RSD |
31 | RADAR system data: range scale | RSD | |
32 | Heading degrees: true | [°] | HDT |
33 | Speed | [knots] | VTG |
34 | Speed | [km/h] | VTG |
35 | Latitude (Decimal) | in decimal [°] | GGL, GGA |
36 | Longitude (Decimal) | in decimal [°] | GGL, GGA |
100 | Error states | state |
XXYY.ZZZZ ⇒ XX° + (YY.ZZZZ / 60)° or XXYY.ZZZZ ⇒ XX° YY’ (0.ZZZZ * 60)’’
Returns system health value
GetSystemHealth(Selector)
Selector variants
Code | Meaning | Description |
---|---|---|
Actual System health | [%] | |
1 | Actual Real-time health | [%] |
2 | Average System health | [%] |
3 | Average Real-time health | [%] |
Returns compare the result of Arg1 > Arg2
Higher(Arg1;Arg2)
Higher(35;42) -> result: 0
Higher(35;23) -> result: 1
Returns compare the result of Arg1 >= Arg2
HigherEqual(Arg1;Arg2)
HigherEqual(35;35) -> result: 1
HigherEqual(17;35) -> result: 0
Returns the highest one of several arguments
Highest(Arg1;Arg2[;Arg3;Arg4])
Highest(17;12;43;8) -> result: 43
Returns last stored value while EnableUpdate was set
Hold(Value;EnableUpdate)
Update condition
Returns integrated value
Integrator(Value)
The value is evaluated and integrated with the processing time of the arithmetic stack
*Create an enhanced stream under the Q.station and select the variable to be analyzed. Create an arithmetic virtual variable under the enhanced stream and add the Integrator function.
Returns natural (base e) logarithm of value
Ln(Value)
Returns base 10 logarithm of value
Log(Value)
Returns the lowest one of several arguments
Lowest(Arg1;Arg2[;Arg3;Arg4])
Returns compare result of Arg1 < Arg2
Lower(Arg1;Arg2)
Lower(12;17) -> result: 1
Lower(23;17) -> result: 0
Returns compare result of Arg1 <= Arg2
LowerEqual(Arg1;Arg2)
LowerEqual(17;17) -> result: 1
LowerEqual(17;12) -> result: 0
The maximum value will be “stored” and has to be reset if required.
Max(Value)
To reset this result, the settings have to be defined in the “Reset” tab.
These are the following possibilities to reset the value (depending on the location of the arithmetic variable):
on host
on variable > 0.5
on the handling interval
on a digital input
The minimum value will be “stored” and has to be reseted if required.
Min(Value)
Value
To reset this result, the settings have to be defined in the “Reset” tab.
These are the following possibilities to reset the value (depending on the location of the arithmetic variable):
on host
on variable > 0.5
on the handling interval
on a digital input
Returns bitwise inverted value
Not(Value)
Implements a PID controller functionality
PIDController(ReferenceValue;ActualValue;ProportionalPart;IntegralTime;DerivativeTime;Mode;TimeBase;OutputVariable[;Type])
No events supported! Turning control on/off is only possible with the “mode” parameter. If event “Host” is activated, the output value can be set in “Control loop open” mode.
ReferenceValueReference value, also called Setpoint value or W
ActualValueActual value, also called Process value or X
ProportionalPartProportional part, also called P-contribution
IntegralTimeIntegral time, also called I-contribution [s] (with type ISM112 [min])
DerivativeTimeDerivative time, also called D-contribution [s] (with type ISM112 [min])
ModeMode variants
Bit | Meaning | Description |
---|---|---|
Bit0 | ControlLoopClosed | enables configuration of control loop (default 1) |
Bit1 | OutputLimitationDisabled | enables configuration of output limitation (default 1) to a value of +/-1.0 (with type ISM112 +/-100.0) |
Time base [s] (Min = 1.0/sample frequency, select according required control loop speed and keep in mind that slower control speed saves CPU power)
OutputVariableOutput variable which is the result (Y) of PID controller
[Type]Optional parameter to define type of controller
Code | Meaning | Description |
---|---|---|
e_q_gate_pac | D-Part based on derivative of error value (W - X) | |
1 | q_station | D-Part based on derivative of process value (X) |
2 | ISM112 | Like Type-q_station, but I- and D-Times are [min] and the controller has an internal gain of 100 |
If this parameter is not set, with e./q.bloxx/pac-controllers Type-e_q_gate_pac and with q.station-controllers Type-q_station is used.
Remark: If same behavior as with ISM112 is needed, also Mode-Bit1 = 0 (=Output limitation on) need to be set.
Implements a PID controller functionality index based (refer to function PIDController - only output variable is accessed with OutputVariableWriteAccessIndex)
PIDControllerIndexBased(ReferenceValue;ActualValue;ProportionalPart;IntegralTime;DerivativeTime;Mode;TimeBase;OutputVariableWriteAccessIndex + 1[;Type])
OutputVariableWriteAccessIndex + 1
Access index of output variable, where value has to be written to (only variables with output-part as data direction (OUTPUT or INPUT/OUTPUT) are possible)
Returns powered value: Result = Base^Exponent
Power(Base;Exponent)
Power(2;3) -> result: 8
Returns random value as integer number
Random(LimitValue)
LimitValue must be a value > 1, result is then a value in range of 1 … LimitValue
This function will be used to round a value to a certain RoundToValue
RoundToValue(Value;RoundToValue)
RoundToValue(5,0537;1) -> result: 5
RoundToValue(5,0537;10) -> result: 10
RoundToValue(5,0537;0,001) -> result: 5,054
Returns value calculated with linear equation: Result = Value*Factor + Offset
Scaling(Value;Factor;Offset)
Returns value depending on value of SelectorValue
Select(SelectorValue;ValueForSelectorValueEquals0[;ValueForSelectorValueEquals1;...;ValueForSelectorValueEquals7])
Selector value, casted to an integer is taken as index for the following value list (last value in list is taken, if index is not present)
ValueForSelectorValueEquals0…7Value, which is taken if integer casted SelectorValue has the index
Example:Select(1;1;2;3) -> result: 2
Select(7;1;2;3) -> result: 3
Select(-1;1;2;3) -> result: 3
Returns selected system value
SelectSystem(SystemValueSelector;AddParam)
SystemValueSelector
System value selector variants
Code | Meaning | Description | AddParam | Limitations |
---|---|---|---|---|
EtherCAT cycle counter | uint64_t | not used (0) | Only available on Q.pac EC | |
1 | EtherCAT async buffer content counter | uint64_t | Value identifier | Only available on Q.pac EC |
2 | System-Temperature | Value [°C] | Temperature sensor index | |
3 | Supply-Voltage | Value [V] | Voltage sensor index | |
4 | Calculation rate | Frequency [Hz] | not used (0) | |
5 | System health | 0-100% | not used (0) | |
6 | Mem Free | Free memory [%] | not used (0) | |
1XX | OnlineDataPort | Only available with project objects | ||
100 | OnlineDataPort_SumActivityBitset | Bitset for all online data port activity | not used (0) | Only available with project objects |
101 | OnlineDataPort_ActiveCount | Number of active ports | not used (0) | Only available with project objects |
102 | OnlineDataPort_InactiveCount | Number of inactive ports | not used (0) | Only available with project objects |
103 | OnlineDataPort_EventBitset | Bitset for all events of specified port | Port Index | Only available with project objects |
104 | OnlineDataPort_MsSinceLastTransfer | Value for specified port | Port Index | Only available with project objects |
2XX | DataStream | Only available with project objects | ||
200 | DataStream_SumActivityBitset | Bitset for all stream activity | not used (0) | Only available with project objects |
201 | DataStream_ActiveCount | Number of active streams | not used (0) | Only available with project objects |
202 | DataStream_InactiveCount | Number of inactive streams | not used (0) | Only available with project objects |
203 | DataStream_EventBitset | Bitset for all events of specified stream | Port Index | Only available with project objects |
204 | DataStream_MsSinceLastTransfer | Milli seconds since last transfer for specified stream | Port Index | Only available with project objects |
205 | DataStream_ActBandwidthMBSec | Actual bandwidth [MB/s] | Port Index | Only available with project objects |
206 | DataStream_HandledDataMB | Amount of handled data [MB] since start | Port Index | Only available with project objects |
207 | DataStream_LastTransferSize | Number of bytes received at last transfer | Port Index | Only available with project objects |
208 | DataStream_BufferedSizeMB | Available size [MB] | Port Index | Only available with project objects |
209 | DataStream_Load | Used capacity [%] (up to 100%) | Port Index | Only available with project objects |
210 | DataStream_AvailableTimeRange | Not working yet | Port Index | Only available with project objects |
211 | DataStream_LastTransferEpochSec | Absolute time of last transfer [s] since epoch | Port Index | Only available with project objects |
6XX | Misc | Only available with project objects | ||
600 | GIcom_ThreadPoolStatus | ThreadPool status of GI.com | 0 = allocated, 1 = available, 2 = used | Only available with project objects |
Allows sending an E-mail
SendMailToMailServer(AddressIndex;SubjectIndex;BodyIndex;WithDataFile;BufferIndex;DataDriveIndex;FileIdent;FileRepeatIndex;DeleteAfterSend;IsBlocking)
Up to 10 E-mail addresses can be defined in the controller via “Host Settings, E-Mail”.
The destination address index is 0 … 9 according to “Email address #1” … “Email address #10”, in case -1 is defined, the message will be sent to all E-mail addresses being defined.
Up to 10 subjects can be defined via “Host Settings, E-Mail”.
The index is 0 … 9 according to “Email subject #1” … “Email subject #10”.
This is the text being defined via “Host Settings, E-Mail”.
The index is 0 … 9 according to “Email body text #1” … “Email body text #10”.
With data file variants
Code | Meaning | Description |
---|---|---|
no | ||
1 | yes | Not valid for Q.station/Q.monixx! -> also leave all depending parameters set to 0 |
This index defines which data drive is accessed.
Code | Meaning | Description |
---|---|---|
internal | data only being stored in Flash | |
1 | USB-stick |
These are characters which can be used to define different files. 0 = a, 1 = b … e.g. 10 = k
FileRepeatIndexEach file gets its own index.
0000 … 9999 are valid repeat indices.
This is being used in case very special files have to be sent.
Using -1 means the oldest data file will be sent; using -2 the latest file will be sent.
Delete after send variants
Code | Meaning | Description |
---|---|---|
no | The source file will not be deleted. | |
1 | yes | The source file will be deleted. |
Is blocking variants
Code | Meaning | Description |
---|---|---|
no | The main program loop will not wait for the finishing function; finalization must be detected with the resulting state (recommended!). | |
1 | yes | The main program loop will wait for the finishing function. |
Result value variants
Value | Description |
---|---|
Ready, OK | |
1 | DestinationAddressIndexError |
2 | SubjectIndexError |
3 | BodyIndexError |
4 | CreateError |
5 | SetDomainError |
6 | AuthenticateSendServerError |
7 | AuthenticatReceiveServerError |
8 | PrepareNewMediaError |
9 | SetDestinationAddressError |
10 | SetAttachmentError |
11 | SetSignatureError |
12 | SrcFileNotFoundError |
13 | ScrFileDeleteError |
200…250 | Internal Error |
500 | Busy |
501 | SendMailInitInProgress |
502 | SendMailInProgress |
503 | ReceiveMailInitInProgress |
504 | ReceiveMailInProgress |
1001 | NotRunning |
This function is event-driven, which means it is triggered as long as the event condition is active.
Take care that the event is only active for one cycle, so only one E-mail per event is sent.
Appending a data file with this function is not implemented on Q.station/Q.monixx (only with “old” controllers like Q.pac/gate).
Use logger functionality to send data files via email there.
Sine of value
Sin(Value)
Value in radian
Example:Sin(0.5) -> result: 0,479
Sin(0.5∗π)-> result: 1
Sin(90°∗π/180) -> result: 1
Sqrt(value)
The argument can be a variable or a certain value.
Example: Sqrt(25) = 5
Square(value)
The argument can be a variable or a certain value.
e.g. Square(4) = 16
Returns standard deviation of value (event-driven function)
StdDeviation(Value)
Attention
The final value of ‘n’ (total number of samples to sum up) is not known during the execution of the formula. ‘n’ results as the number of samples between 2 event conditions.
The summation values in the formula are held as 64-bit values double. Depending on
n
x (size of measurement value)
an overflow of this value may occur!
This function will be used to get the actual state of the whole system.
State(Selector)
Selector variants
Code | Meaning | Description |
---|---|---|
GeneralStates | ||
1 | RunStates | |
2 | ErrorStates |
Result value variants
Selector | Bit | Meaning | Description |
---|---|---|---|
GeneralStates | Bit0 | InitActive | |
Bit1 | MeasRunInActive | ||
Bit2 | ConfigModeActive | ||
Bit3 | ConfigStable | ||
Bit4 | ForceNoHealthCheckActive | ||
RunStates | Bit0 | HostConfigBusRS485Active | |
Bit1 | HostConfigBusRS232Active | ||
Bit2 | HostFTPServerActive | ||
Bit3 | Internal use | ||
Bit4 | HostFieldbusActive | ||
Bit5 | HostDataPortActive | ||
Bit6 | HostDistributorPortActive | ||
Bit7 | HostHighspeedPortTCPIPActive | ||
Bit8 | HostHighspeedPortUDPActive | ||
Bit9 | HostPacKernelPortActive | ||
Bit10 | HostTransparentPortActive | ||
Bit11 | HostFTPClientActive | ||
Bit12 | HostMailClientActive | ||
Bit13 | HostWebServerActive | ||
Bit14 | MassStorageActionActive | ||
Bit15 | DataLoggerActive | ||
Bit16 | RTTestConActive | ||
Bit17 | USTestConActive | ||
Bit18 | RTPluginActive | ||
Bit19 | USPluginActive | ||
Bit20 | SyncSignalActive | ||
Bit21 | GPSClientActive | ||
Bit22 | CANInterfaceActive | ||
Bit23 | MODBUSMasterActive | ||
Bit24 | FFTProcessorActive | ||
Bit25 | MODBUSSlaveActive | ||
Bit26 | WebSocket Connection Active | ||
ErrorStates | Bit0 | ConfigFileError | |
Bit1 | VariableError | ||
Bit2 | VariableAccessInstableError | ||
Bit3 | RealtimeTaskOverloadError | ||
Bit4 | PacKernelOperationDeniedError | ||
Bit5 | FieldbusConfigurationError | ||
Bit6 | DistributorPortCombined | ||
Bit7 | SocketOverloadedError | ||
Bit8 | ExtensionBoardError | ||
Bit9 | ClientConnectionError | ||
Bit10 | ExtWorkerNotSynched | ||
Bit11 | FileSystem | ||
Bit12 | DataLoggerCombined | ||
Bit13 | FtpClientUnitCombinedError | ||
Bit14 | MailClientUnitCombinedError | ||
Bit15 | MailServerUnitCombinedError | ||
Bit16 | USBHostUnitCombinedError | ||
Bit17 | ExternalClockSignalMissingError | ||
Bit18 | RealtimeTaskSequenceLost | ||
Bit19 | AutoConfigureUnitCombinedError | ||
Bit20 | InterfaceCombined | ||
Bit21 | BoardInit | ||
Bit22 | PCIEInterfaceData | ||
Bit23 | DataBufferOverrun | ||
Bit24 | FieldbusInterfaceAccess | ||
Bit25 | WrongSubSystemVersion | ||
Bit26 | PluginCombined | ||
Bit27 | CANInterfaceCombined | ||
Bit28 | ModbusMasterCombined | ||
Bit29 | ModbusSlaveCombined | ||
Bit30 | FFTProcessorCombined |
Allows to handle some system actions (event-driven function)
SystemControl(CommandSelector)
Command selector variants
Code | Meaning | Description |
---|---|---|
Delete static errors | Error messages in Q.station, obtained as user information, can be deleted with this function | |
1 | Restart device | (dangerous) |
2 | EjectDataStorage | not implemented yet |
3 | Set display backlight | use event condition to enable/disable, if param is set, param value is 0-100% |
Attention
At “Restart device”: if the event is already true (1) when booting the system, the controller will restart in a loop. Please check the event condition carefully during the configuration of the function!
Tangent of value
Tan(Value)
Value in radian
Calculates temperature with thermocouple algorithm
Thermocouple(Mode;Type;ThermocoupleVoltageValue;ReferenceTemperatureValue)
Mode contains information build from ModeNumber and ModeBitset Mode = ModeBitset*100 + ModeNumber
ModeNumber
Code | Meaning | Description |
---|---|---|
Full calculated thermocouple value | [°C] | |
1 | Intermediate ReferenceTemperatureValue as voltage value | [V] |
2 | Intermediate ThermocoupleVoltageValue added with ReferenceTemperatureValue as voltage value | [V] |
ModeBitset
Bit | Meaning | Description |
---|---|---|
Bit0 | DoIncludeErrorValues | an error offset is added to ResultValue in case of error: |
Bit1 | AllowExtrapolation | out of range values are extrapolated |
ASTM E 230
BS 4937
ANSI MC96.1
NF C 42-324
Code | Meaning | Description |
---|---|---|
B | ATTENTION: Reference temperatures lower than 0°C may result in deviations from given accuracies !!! | |
10 | C | ATTENTION: Reference temperatures lower than 0°C may result in deviations from given accuracies !!! |
1 | E | Material: Nickel-Chromium / Copper-Nickel (NiCr-CuNi) |
2 | J | Material: Iron / Copper-Nickel (Fe-CuNi) |
3 | K | Material: Nickel-Chrom / Nickel-Aluminium (NiCr-NiAl) |
4 | L | Material: Iron / Copper-Nickel (Fe-CuNi) |
5 | N | Material: Nickel-Chrom / Nickel-Silicium (NiCr-NiSi) |
6 | R | Material: Platinum-13% Rhodium / Platinum (Pt13Rh-Pt) |
7 | S | Material: Platinum-10% Rhodium / Platinum (Pt10Rh-Pt) |
8 | T | Material: Copper / Copper-Nickel (Cu-CuNi) |
9 | U | Material: Copper / Copper-Nickel (Cu-CuNi) |
Thermocouple voltage value [V]
Reference temperature value [°C]
Returns true RMS calculation of value
TrueRMS(Value;Type;AddParam)
Type with a corresponding additional parameter
Code | Meaning | Description |
---|---|---|
Lowpass filter fade out | ||
1 | Sliding fade out | |
2 | Arithmetic mean fade out |
Add parameter variants
TypeSelector | Meaning |
---|---|
Lowpass filter fade out | Time constant Tau [s] |
Sliding fade out | Buffer depth |
Arithmetic mean fade out | Weighting number |
Remark: If only 2 parameters are set, type Lowpass filter is activated and 2nd parameter is taken as time constant Tau.
Returns truncated integer representation of value
Trunc(Value)
Trunc(17.689) -> result: 17
Returns condition, whether values has changed by certain conditions since last cycle
ValueChanged(Value[;Type];AddParam)
Type with corresponding additional parameter
Code | Meaning | Description |
---|---|---|
0 or Type not set | Round to value before | |
1 | Step is greater than CompareValue | |
2 | Step is lower or equal than CompareValue | |
3 | Round to value before, event driven reset of result | Result is set to 0 with event mechanism only |
4 | Step is greater than CompareValue, event driven reset of result | Result is set to 0 with event mechanism only |
5 | Step is lower or equal than CompareValue, event driven reset of result | Result is set to 0 with event mechanism only |
Add parameter variants
Type | Meaning |
---|---|
Round to value before (event driven reset of result) | RoundToValue |
Step is greater than CompareValue (event driven reset of result) | CompareValue |
Step is lower or equal than CompareValue (event driven reset of result) | CompareValue |
ValueChanged(V3;0,02) -> result: 1 for one cycle, if value of V3 rounded to 0,02 is different to last cycle
ValueChanged(V3;1;0,5) -> result: Rising edge detection. 1 for one cycle, if value change since last cycle is >0.5
ValueChanged(V3;1;-0,5) -> result: Falling edge detection. 1 for one cycle, if value change since last cycle is <=0.5
ON or OFF with delay time, if a value exceeds a threshold or gets in a defined range (see parameter “Type”). Also hysteresis definitions are possible with this function.
ValueEvaluation(Value;Type;Time;Value1;Value2)
Type with corresponding additional parameter
Type 0: High logic (ON delayed)
Type 1: Low logic (ON delayed)
Type 2: Range detect high (ON delayed)
Type 3: Range detect low (ON delayed)
Type 4: High hysteresis (ON delayed)
Type 5: Low hysteresis (ON delayed)
Type 10: High logic (OFF delayed)
Type 11: Low logic (OFF delayed)
Type 12: Range detect high (OFF delayed)
Type 13: Range detect low (OFF delayed)
Type 14: High hysteresis (OFF delayed)
Type 15: Low hysteresis (OFF delayed)
Variable write index based
VariableWriteIndexBased(DestinationVariableWriteAccessIndex + 1;SourceValue)
Access index of the output variable, where a source value has to be written to (only variables with output-part as data direction (OUTPUT or INPUT/OUTPUT) are possible)
SourceValue:
defines the source value (for example: V3). This source value can be a constant, a setpoint or another variable.
Example:
The channel setup looks like:
Channel | DataDirection | OutputVarIndex |
V1 – Timestamp | INPUT | - |
V2 – Setpoint 1 | INPUT | - |
V3 – Setpoint 2 | INPUT/OUTPUT | 1 |
V4 – Setpoint 3 | INPUT | - |
V5 – Setpoint 4 | OUTPUT | 2 |
V6 – WriteOutputVar | INPUT | - |
V7 – SourceValue | INPUT/OUTPUT | 3 |
VariableWriteIndexBased(1;Var(“V7 - SourceValue”))
Value of “V7 - SourceValue” is written to “V3 - Setpoint2” (pay attention that index + 1 must be set!)
Example 2:VariableWriteIndexBased(2;Var(“V7 - SourceValue”))
Value of “V7 - SourceValue” is written to “V5 - Setpoint4” (pay attention that index + 1 must be set!)