> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/rt-lab/automation-api-and-scripting/rt-lab-api/c-rt-lab-api-reference/functions-reference/opalgetacqgroupsyncsignals.md).

# OpalGetAcqGroupSyncSignals

<table data-header-hidden><thead><tr><th width="199.77777099609375"></th><th></th></tr></thead><tbody><tr><td><strong>Group</strong></td><td>Model Interaction, Signal Acquisition</td></tr><tr><td><strong>Description</strong></td><td><p>Returns 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 <strong>OpComm</strong> block for the specified acquisition group. The outputs contain two arrays: acquisition signals + monitoring signals.<br>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.</p><p>Threshold time between acquisition time and simulation time exceeds the threshold, the acquisition (console) will be updated to overtake the difference. The <strong>acqtimestep</strong> offers the user a way to change his console step size as in Simulink.<br>Monitoring signals array contains 4 values:</p><ol start="1"><li><strong>missed data</strong>: number of values between two acquisition frame. If the value is 0, there are no missing data between the two frames. Missing data may appear if network communication and display are too slow to refresh the value generated by the model.</li><li><strong>offset</strong>: simulation time when the acquisition started.</li><li><p><strong>target simulation time</strong>: simulation time of the model when the acquisition has been done.</p><ol start="1"><li><strong>Sample/sec</strong>: number of sample/sec received from target. The calculation is made for one sample. Ex: If the model is running at 0.001s, sample/sec value should not exceed 1000 sample/sec.</li></ol></li></ol></td></tr><tr><td><strong>Required Control</strong></td><td>None</td></tr><tr><td><strong>Usage</strong></td><td>int <strong>OpalGetAcqGroupSyncSignals</strong>(unsigned short acqGroup,unsigned short allocatedSignals, unsigned int *numSignals, unsigned short synchronization, unsigned short interpolation, double threshold,double acqTimeStep, double *simSignals, double *monSignals,unsigned short *endFrame, double *simTimeStep);</td></tr><tr><td><strong>Input</strong></td><td><ul><li><strong>acqGroup:</strong> Acquisition group number starts from 0.</li><li><strong>allocatedSignals:</strong> Number of expected signals.</li><li><strong>synchronization:</strong> 1/0 = Enable/DisableEnables the synchronization algorithm for a given acquisition group. This algorithm must be used if synchronization is required between acquisition Console time and simulation time. In case of a synchronization problem, the Console detects missing data from the target node and the algorithm either replaces the lost data with the last signal value received or interpolates the data.</li><li><strong>interpolation:</strong> interpolation 1/0 = Enable/Disable<br>In case of missed data from a computation subsystem, the synchronization algorithm interpolates data during a range of data loss. The following illustrations make this point clear. The display at left indicates no interpolation during data acquisition while the display at right indicates interpolation between two frames during data loss.</li></ul><p><img src="https://96827845-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNRdpSk8kjn20gXAexnt6%2Fuploads%2Fgit-blob-e9eda9f4183b00be3873c5ad2a985836697b4112%2FCapi-opalgetacqgroupsyncsignals.png?alt=media" alt="" data-size="original"></p><ul><li><strong>threshold:</strong> Difference between the simulation Console time and the simulation target time. Whenever this difference is exceeded, the synchronization algorithm stops interpolating and re-synchronizes to the new value.</li><li><strong>acqTimeStep:</strong> Sample interval: acquisition (console) timestep must be equal to or greater than the model time step.</li></ul></td></tr><tr><td><strong>Output</strong></td><td><ul><li><strong>numSignals:</strong> Number of signals in the acquisition group.</li><li><strong>simSignals:</strong> Simulation signals array into which the API will store the acquired signals. May be NULL if allocatedSignals equals 0.</li><li><strong>monSignals:</strong> Monitoring signals array into which the API will store the monitoring signals (Missed data, offset, target simulation time, Samples/sec). May be NULL if allocatedSignals equals 0.</li><li><strong>endFrame:</strong> Pointer to where API stores true when signals are the last in the acquisition buffer (next values will be in a new frame). May be NULL if not of interest.</li><li><strong>simTimeStep:</strong> Simulation timestep of the acquired data. May be NULL if not of interest.</li></ul></td></tr><tr><td><strong>Return value</strong></td><td><ul><li><strong>EOK:</strong> Success.</li><li><strong>E2BIG:</strong> Number of allocated signals is less than the number of group signals.</li><li><strong>EAGAIN:</strong> No data available and the timeout has expired.</li><li><strong>EINVAL:</strong> Specified acquisition group is invalid or not active (does not exist on target).</li><li><strong>EBADF:</strong> Model not specified by previous OpalConnect or OpalSetCurrentModel.</li><li><strong>EIO:</strong> Error sending the request or receiving the reply.</li><li><strong>EACCES:</strong> Not connected a loaded model.</li><li><strong>ENOMEM:</strong> Memory allocation error.</li><li><strong>OP_API_EBAD_SIGNAL:</strong> Doing acquisition of one or more dynamic signals that does no longer exist.</li><li><strong>OP_API_ENO_PRODUCT:</strong> No license for RT-LAB and RT-LABx.</li></ul></td></tr><tr><td><strong>Examples</strong></td><td>See example <strong>acquisition1</strong>.</td></tr><tr><td><strong>Related items</strong></td><td>None</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/rt-lab/automation-api-and-scripting/rt-lab-api/c-rt-lab-api-reference/functions-reference/opalgetacqgroupsyncsignals.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
