Documentation Home Page RT-LAB Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

GetAcqGroupSyncSignals

Group

Model Interaction, Signal Acquisition

Description

Return the acquisition signals sent to the console subsystem while the model is running. The acquisition signals are the signals sent from the computation nodes to console subsystem in the same order that it was specified at the input of the OpComm block for the specified acquisition group. The outputs contains two arrays: acquisition signals + monitoring signals.

The user can activate the synchronization algorithm to synchronize the acquisition time with the simulation time by inserting data during missed data intervals. The interpolation can be used in this case to get a better result during missed data intervals. Threshold time between acquisition time and simulation time exceeds the threshold, the acquisition (console) will be updated to overtake the difference. The acqtimestep offers the user a way to change his console step size as in Simulink.

For additional information, please see Acquiring and Viewing Data in the RT-LAB User’s Guide.

Monitoring signals tuple contains 4 values:

  1. missed data: number of values between two acquisition frame. If value is 0, there are no missing data between the two frames. Missing data may appears if network communication and display are too slow to refresh value generated by the model.

  2. offset: simulation time when the acquisition started.

  3. target simulation time: simulation time of the model when the acquisition has been done.

  4. Sample/sec: number of sample/sec received from target. Calculation is made for one sample. Ex: If model is running at 0.001s, sample/sec value should not exceed 1000 sample/sec.

Required Control

None

Usage

results = RtlabApi.GetAcqGroupSyncSignals(acquisitionGroup, synchronization, interpolation, threshold, acqTimeStep)

(values, monitoringInfo, simulationTimeStep, endFrame) = results

(value1, value2, value3, ...) = values

(missedData, offset, simulationTime, sampleSec) = monitoringInfo

Input

  • acquisitionGroup: Acquisition group number, starts from 0.

  • synchronization: Synchronization 1/0 = Enable/Disable

  • interpolation: Interpolation 1/0 = Enable/Disable

  • threshold: Threshold difference time between the simulation and the acquisition (console) time in seconds.

  • acqTimeStep: Sample interval: acquisition (console) timestep must be equal or greater than the model time step.

Output

  • values: Acquired signals from acquisition. It contains a tuple of values with one value for each signal in the acquisition group.

  • monitoringInfo: Monitoring information tuple. It contains the following values: Missed data, offset, simulationTime and sampleSec. See below for more details.

  • missedData: Number of values between two acquisition frame. If value is 0, there are no missing data between the two frames. Missing data may appears if network communication and display are too slow to refresh value generated by the model.

  • offset: Simulation time when the acquisition started.

  • simulationTime: Simulation time of the model when the acquisition has been done.

  • sampleSec: Number of sample/sec received from target. Calculation is made for one sample. Ex: If model is running at 0.001s, sample/sec value should not exceed 1000 sample/sec.

  • simTimeStep: Simulation timestep of the acquired data.

  • endFrame: True when signals are the last in the acquisition buffer (next values will be in a next frame).

Exception

  • EOK: Success

  • E2BIG: Number of allocated signals is less than the number of group signals.

  • EAGAIN: No data available and timeout has expired.

  • EINVAL: Specified acquisition group is invalid or not active (does not exist on target).

  • EBADF: Model not specified by previous Connect or OpenProject.

  • EIO: Error sending the request or receiving the reply.

  • EACCES: Not connected to a loaded model.

  • ENOMEM:  Memory allocation error.

  • OP_API_EBAD_SIGNAL: Doing acquisition of one or more dynamic signals that does no longer exist.

  • OP_API_ENO_PRODUCT: No license for RT-LAB.

Examples

See example acquisition1.

Related Items

None

Modules

import RtlabApi



OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323