|
DSRemoteConnect C++ Library 1.1.3.24
Remote connection library for Dewesoft measurement applications
|
#include "DSXInstance.h"#include "DSXDCOMInstance.h"#include "DSXNETInstance.h"Go to the source code of this file.
Macros | |
| #define | DSREMOTECONNECT_API __declspec(dllimport) |
Typedefs | |
| typedef DSXInstance * | DSXInstanceHandle |
| Handle to a DSX instance for connection management. | |
| typedef ChannelInstance * | ChannelInstanceHandle |
| Handle to a measurement channel instance. | |
Functions | |
| DSREMOTECONNECT_API int | dsconGetVersion (char *version, size_t len) |
| Get the library version string. | |
| DSREMOTECONNECT_API int | dsconCreateInstance (DSXInstanceHandle *handle, int connectionType) |
| Create a new DSX instance. | |
| DSREMOTECONNECT_API int | dsconConnect (DSXInstanceHandle handle, char *connectionString) |
| Connect to a Dewesoft application. | |
| DSREMOTECONNECT_API int | dsconDestroyInstance (DSXInstanceHandle handle) |
| Destroy a DSX instance. | |
| DSREMOTECONNECT_API int | dsconDisconnect (DSXInstanceHandle handle) |
| Disconnect from Dewesoft application. | |
| DSREMOTECONNECT_API int | dsconLoadSetup (DSXInstanceHandle handle, char *fileName) |
| Load a Dewesoft setup file. | |
| DSREMOTECONNECT_API int | dsconSetAppWindowVisible (DSXInstanceHandle handle, bool visible) |
| Set Dewesoft application window visibility. | |
| DSREMOTECONNECT_API int | dsconSetBufferSize (DSXInstanceHandle handle, int bufferSize) |
| Set buffer size for data acquisition. | |
| DSREMOTECONNECT_API int | dsconGetChannelCount (DSXInstanceHandle handle, size_t *count) |
| Get the total number of available channels. | |
| DSREMOTECONNECT_API int | dsconEnumerateChannels (DSXInstanceHandle handle, ChannelIdList *channelIdList, size_t *count) |
| Enumerate all available channels. | |
| DSREMOTECONNECT_API int | dsconFreeEnumerateChannels (DSXInstanceHandle handle, ChannelIdList *channelIdList) |
| Free memory allocated by channel enumeration. | |
| DSREMOTECONNECT_API int | dsconInitChannelIdEnum (DSXInstanceHandle handle) |
| Initialize channel ID enumeration iterator. | |
| DSREMOTECONNECT_API int | dsconGetNextChannelId (DSXInstanceHandle handle, ChannelID id) |
| Get next channel ID in enumeration. | |
| DSREMOTECONNECT_API int | dsconGetNextChannelIdSize (DSXInstanceHandle handle, int *size) |
| Get size of next channel ID. | |
| DSREMOTECONNECT_API int | dsconCreateChannelInstance (DSXInstanceHandle handle, ChannelID id, ChannelInstanceHandle *chInstance) |
| Create a channel instance by ID. | |
| DSREMOTECONNECT_API int | dsconCreateChannelInstanceByName (DSXInstanceHandle handle, char *chName, ChannelInstanceHandle *chInstance) |
| Create a channel instance by name. | |
| DSREMOTECONNECT_API int | dsconFreeChannelInstance (ChannelInstanceHandle chInstance) |
| Free a channel instance. | |
| DSREMOTECONNECT_API int | dsconChannelGetName (ChannelInstanceHandle channel, char *name, size_t len) |
| Get channel display name. | |
| DSREMOTECONNECT_API int | dsconGetSampleRate (ChannelInstanceHandle handle, double *sampleRate) |
| Get channel sample rate. | |
| DSREMOTECONNECT_API int | dsconGetChannelType (ChannelInstanceHandle handle, int *chType) |
| Get channel type. | |
| DSREMOTECONNECT_API int | dsconIsChannelControl (ChannelInstanceHandle handle, bool *result) |
| Check if channel is a control channel. | |
| DSREMOTECONNECT_API int | dsconGetChUnit (ChannelInstanceHandle handle, char *resultUnit, size_t len) |
| Get channel measurement unit. | |
| DSREMOTECONNECT_API int | dsconChannelSetTransferred (ChannelInstanceHandle handle, bool transferred) |
| Set channel transfer state. | |
| DSREMOTECONNECT_API int | dsconIsInAqusition (DSXInstanceHandle handle, bool *value) |
| Check if measurement is active. | |
| DSREMOTECONNECT_API int | dsconStartMeasurement (DSXInstanceHandle handle) |
| Start measurement. | |
| DSREMOTECONNECT_API int | dsconStopMeasurement (DSXInstanceHandle handle) |
| Stop measurement. | |
| DSREMOTECONNECT_API int | dsconBeginRead (DSXInstanceHandle handle, double *startTime, double *endTime) |
| Begin data reading session. | |
| DSREMOTECONNECT_API int | dsconChannelReadScalarData (ChannelInstanceHandle handle, double **data, double **timestamps, size_t *count) |
| Read scalar data from channel (legacy version) | |
| DSREMOTECONNECT_API int | dsconChannelReadScalarData_2 (ChannelInstanceHandle handle, double *data, double *timestamps, size_t *count) |
| Read scalar data from channel (recommended version) | |
| DSREMOTECONNECT_API int | dsconChannelReadScalarData_2abs (ChannelInstanceHandle handle, double *data, double *timestamps, size_t *count) |
| Read scalar data with absolute timestamps. | |
| DSREMOTECONNECT_API int | dsconControlChannelWriteData (ChannelInstanceHandle handle, double data) |
| Write data to control channel. | |
| DSREMOTECONNECT_API int | dsconEndRead (DSXInstanceHandle handle) |
| End data reading session. | |
Variables | |
| const std::string | VER_DSREMOTE = "1.1.3.24" |
| DSRemoteConnect library version string. | |
| #define DSREMOTECONNECT_API __declspec(dllimport) |
Definition at line 125 of file DSRemoteConnect_Documented.h.
Handle to a measurement channel instance.
This handle represents a specific measurement channel and provides access to channel data, properties, and control capabilities.
Definition at line 159 of file DSRemoteConnect_Documented.h.
Handle to a DSX instance for connection management.
This handle represents a connection to a Dewesoft application instance. It encapsulates either a DCOM or NET connection type.
Definition at line 150 of file DSRemoteConnect_Documented.h.
| DSREMOTECONNECT_API int dsconBeginRead | ( | DSXInstanceHandle | handle, |
| double * | startTime, | ||
| double * | endTime ) |
Begin data reading session.
Prepares the system for data reading and optionally sets time bounds.
| [in] | handle | DSX instance handle |
| [in,out] | startTime | Pointer to start time (can be NULL for current time) |
| [in,out] | endTime | Pointer to end time (can be NULL for current time) |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSREMOTECONNECT_API int dsconChannelGetName | ( | ChannelInstanceHandle | channel, |
| char * | name, | ||
| size_t | len ) |
Get channel display name.
Retrieves the human-readable name of the channel.
| [in] | channel | Channel instance handle |
| [out] | name | Buffer to store channel name |
| [in] | len | Buffer length |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSX_COUNT_OUT_OF_BOUNDS | Buffer too small |
| DSREMOTECONNECT_API int dsconChannelReadScalarData | ( | ChannelInstanceHandle | handle, |
| double ** | data, | ||
| double ** | timestamps, | ||
| size_t * | count ) |
Read scalar data from channel (legacy version)
Reads measurement data and timestamps from a channel. Memory is allocated internally and must be managed carefully.
| [in] | handle | Channel instance handle |
| [out] | data | Pointer to store data array pointer |
| [out] | timestamps | Pointer to store timestamp array pointer |
| [out] | count | Pointer to store number of samples read |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSX_DCOM_NO_DATA | No data available |
| DSX_TOO_MANY_SAMPLES_AVAILABLE | More data available than requested |
| DSREMOTECONNECT_API int dsconChannelReadScalarData_2 | ( | ChannelInstanceHandle | handle, |
| double * | data, | ||
| double * | timestamps, | ||
| size_t * | count ) |
Read scalar data from channel (recommended version)
Reads measurement data and timestamps into user-provided buffers. This is the recommended function for data reading.
| [in] | handle | Channel instance handle |
| [out] | data | Pre-allocated array to store data values |
| [out] | timestamps | Pre-allocated array to store timestamp values |
| [in,out] | count | Input: buffer size, Output: actual samples read |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSX_DCOM_NO_DATA | No data available |
| DSX_TOO_MANY_SAMPLES_AVAILABLE | More data available than buffer size |
| DSREMOTECONNECT_API int dsconChannelReadScalarData_2abs | ( | ChannelInstanceHandle | handle, |
| double * | data, | ||
| double * | timestamps, | ||
| size_t * | count ) |
Read scalar data with absolute timestamps.
Similar to dsconChannelReadScalarData_2() but returns absolute timestamps instead of relative ones.
| [in] | handle | Channel instance handle |
| [out] | data | Pre-allocated array to store data values |
| [out] | timestamps | Pre-allocated array to store absolute timestamp values |
| [in,out] | count | Input: buffer size, Output: actual samples read |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSX_DCOM_NO_DATA | No data available |
| DSREMOTECONNECT_API int dsconChannelSetTransferred | ( | ChannelInstanceHandle | handle, |
| bool | transferred ) |
Set channel transfer state.
Enables or disables data transfer for the channel.
| [in] | handle | Channel instance handle |
| [in] | transferred | true to enable transfer, false to disable |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSREMOTECONNECT_API int dsconConnect | ( | DSXInstanceHandle | handle, |
| char * | connectionString ) |
Connect to a Dewesoft application.
Establishes connection to a Dewesoft application using the specified connection string.
| [in] | handle | DSX instance handle |
| [in] | connectionString | Connection-specific string:
|
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSX_INVALID_CONNECTION_STRING | Invalid connection string format |
| DSX_DCOM_COULD_NOT_CONNECT | Failed to connect via DCOM |
| DSX_NET_UNABLE_TO_CONNECT | Failed to connect via NET |
| DSREMOTECONNECT_API int dsconControlChannelWriteData | ( | ChannelInstanceHandle | handle, |
| double | data ) |
Write data to control channel.
Writes a control value to a control channel. The channel must be configured as a control channel in the Dewesoft setup.
| [in] | handle | Channel instance handle (must be control channel) |
| [in] | data | Value to write to the control channel |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSX_CH_IS_NOT_CONTROL | Channel is not a control channel |
| DSREMOTECONNECT_API int dsconCreateChannelInstance | ( | DSXInstanceHandle | handle, |
| ChannelID | id, | ||
| ChannelInstanceHandle * | chInstance ) |
Create a channel instance by ID.
Creates a channel instance handle for accessing a specific channel. The channel ID should be obtained from enumeration functions.
| [in] | handle | DSX instance handle |
| [in] | id | Channel ID string |
| [out] | chInstance | Pointer to store created channel instance handle |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSX_DCOM_CHANNEL_ID_NOT_FOUND | Channel ID not found |
| DSX_CANNOT_MAKE_CH_INSTANCE | Failed to create channel instance |
| DSREMOTECONNECT_API int dsconCreateChannelInstanceByName | ( | DSXInstanceHandle | handle, |
| char * | chName, | ||
| ChannelInstanceHandle * | chInstance ) |
Create a channel instance by name.
Creates a channel instance handle using the channel's display name.
| [in] | handle | DSX instance handle |
| [in] | chName | Channel display name |
| [out] | chInstance | Pointer to store created channel instance handle |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSX_DCOM_CHANNEL_ID_NOT_FOUND | Channel name not found |
| DSX_CANNOT_MAKE_CH_INSTANCE | Failed to create channel instance |
| DSREMOTECONNECT_API int dsconCreateInstance | ( | DSXInstanceHandle * | handle, |
| int | connectionType ) |
Create a new DSX instance.
Creates a new and bla bla bla instance for connecting to Dewesoft applications. The connection type determines the communication protocol used.
| [out] | handle | Pointer to store the created instance handle |
| [in] | connectionType | Connection type (DSX_CONNECTION_TYPE_DCOM or DSX_CONNECTION_TYPE_NET) |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle pointer |
| DSX_UNKNOWN_ERROR | Failed to create instance |
| DSREMOTECONNECT_API int dsconDestroyInstance | ( | DSXInstanceHandle | handle | ) |
Destroy a DSX instance.
Cleans up and destroys the DSX instance. This should be called for every instance created with dsconCreateInstance().
| [in] | handle | DSX instance handle to destroy |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSREMOTECONNECT_API int dsconDisconnect | ( | DSXInstanceHandle | handle | ) |
Disconnect from Dewesoft application.
Closes the connection to the Dewesoft application while keeping the instance alive.
| [in] | handle | DSX instance handle |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSX_DCOM_NOT_CONNECTED | Not connected via DCOM |
| DSREMOTECONNECT_API int dsconEndRead | ( | DSXInstanceHandle | handle | ) |
End data reading session.
Finalizes the data reading session started with dsconBeginRead().
| [in] | handle | DSX instance handle |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSREMOTECONNECT_API int dsconEnumerateChannels | ( | DSXInstanceHandle | handle, |
| ChannelIdList * | channelIdList, | ||
| size_t * | count ) |
Enumerate all available channels.
Gets a list of all channel IDs in the current setup. The returned list must be freed using dsconFreeEnumerateChannels().
| [in] | handle | DSX instance handle |
| [out] | channelIdList | Pointer to store array of channel ID strings |
| [in,out] | count | Input: expected count, Output: actual count |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSX_DCOM_NOT_CONNECTED | Not connected |
| DSX_DCOM_NO_CHANNELS_TO_ENUMERATE | No channels available |
| DSREMOTECONNECT_API int dsconFreeChannelInstance | ( | ChannelInstanceHandle | chInstance | ) |
Free a channel instance.
Frees the memory and resources associated with a channel instance.
| [in] | chInstance | Channel instance handle to free |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSREMOTECONNECT_API int dsconFreeEnumerateChannels | ( | DSXInstanceHandle | handle, |
| ChannelIdList * | channelIdList ) |
Free memory allocated by channel enumeration.
Frees the memory allocated by dsconEnumerateChannels().
| [in] | handle | DSX instance handle |
| [in] | channelIdList | Channel ID list to free |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSREMOTECONNECT_API int dsconGetChannelCount | ( | DSXInstanceHandle | handle, |
| size_t * | count ) |
Get the total number of available channels.
Returns the number of channels available in the current setup.
| [in] | handle | DSX instance handle |
| [out] | count | Pointer to store channel count |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSX_DCOM_NOT_CONNECTED | Not connected |
| DSREMOTECONNECT_API int dsconGetChannelType | ( | ChannelInstanceHandle | handle, |
| int * | chType ) |
Get channel type.
Returns the channel type (async, sync, or single value).
| [in] | handle | Channel instance handle |
| [out] | chType | Pointer to store channel type (DSX_CH_TYPE) |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSREMOTECONNECT_API int dsconGetChUnit | ( | ChannelInstanceHandle | handle, |
| char * | resultUnit, | ||
| size_t | len ) |
Get channel measurement unit.
Returns the physical unit of measurement for the channel (e.g., "V", "A", "°C").
| [in] | handle | Channel instance handle |
| [out] | resultUnit | Buffer to store unit string |
| [in] | len | Buffer length |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSX_COUNT_OUT_OF_BOUNDS | Buffer too small |
| DSREMOTECONNECT_API int dsconGetNextChannelId | ( | DSXInstanceHandle | handle, |
| ChannelID | id ) |
Get next channel ID in enumeration.
Retrieves the next channel ID in the enumeration sequence.
| [in] | handle | DSX instance handle |
| [out] | id | Buffer to store channel ID (must be pre-allocated) |
| DSX_NO_ERROR | Success - channel ID retrieved |
| DSX_END_OF_ENUM | No more channels |
| DSX_NULL_HANDLER | Invalid handle |
| DSREMOTECONNECT_API int dsconGetNextChannelIdSize | ( | DSXInstanceHandle | handle, |
| int * | size ) |
Get size of next channel ID.
Returns the buffer size needed for the next channel ID in enumeration.
| [in] | handle | DSX instance handle |
| [out] | size | Pointer to store required buffer size |
| DSX_NO_ERROR | Success |
| DSX_END_OF_ENUM | No more channels |
| DSX_NULL_HANDLER | Invalid handle |
| DSREMOTECONNECT_API int dsconGetSampleRate | ( | ChannelInstanceHandle | handle, |
| double * | sampleRate ) |
Get channel sample rate.
Returns the sample rate of the channel in Hz.
| [in] | handle | Channel instance handle |
| [out] | sampleRate | Pointer to store sample rate value |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSREMOTECONNECT_API int dsconGetVersion | ( | char * | version, |
| size_t | len ) |
Get the library version string.
| [out] | version | Buffer to store version string |
| [in] | len | Length of the buffer |
| DSX_NO_ERROR | Success |
| DSX_COUNT_OUT_OF_BOUNDS | Buffer too small |
| DSREMOTECONNECT_API int dsconInitChannelIdEnum | ( | DSXInstanceHandle | handle | ) |
Initialize channel ID enumeration iterator.
Initializes an iterator for sequential channel enumeration. Use with dsconGetNextChannelId() and dsconGetNextChannelIdSize().
| [in] | handle | DSX instance handle |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSREMOTECONNECT_API int dsconIsChannelControl | ( | ChannelInstanceHandle | handle, |
| bool * | result ) |
Check if channel is a control channel.
Determines whether the channel can be used for writing control data.
| [in] | handle | Channel instance handle |
| [out] | result | Pointer to store result (true if control channel) |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSREMOTECONNECT_API int dsconIsInAqusition | ( | DSXInstanceHandle | handle, |
| bool * | value ) |
Check if measurement is active.
Determines whether a measurement is currently running.
| [in] | handle | DSX instance handle |
| [out] | value | Pointer to store result (true if measuring) |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSX_DCOM_NOT_CONNECTED | Not connected |
| DSREMOTECONNECT_API int dsconLoadSetup | ( | DSXInstanceHandle | handle, |
| char * | fileName ) |
Load a Dewesoft setup file.
Loads a .dxs setup file into the connected Dewesoft application. This configures channels, sample rates, and other measurement parameters.
| [in] | handle | DSX instance handle |
| [in] | fileName | Full path to the .dxs setup file |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSX_DCOM_NOT_CONNECTED | Not connected |
| DSX_NET_SETUP_NOT_FOUND | Setup file not found (NET connection) |
| DSREMOTECONNECT_API int dsconSetAppWindowVisible | ( | DSXInstanceHandle | handle, |
| bool | visible ) |
Set Dewesoft application window visibility.
Shows or hides the Dewesoft application window.
| [in] | handle | DSX instance handle |
| [in] | visible | true to show window, false to hide |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSX_DCOM_NOT_CONNECTED | Not connected |
| DSREMOTECONNECT_API int dsconSetBufferSize | ( | DSXInstanceHandle | handle, |
| int | bufferSize ) |
Set buffer size for data acquisition.
Configures the internal buffer size used for data acquisition. Larger buffers can handle higher data rates but use more memory.
| [in] | handle | DSX instance handle |
| [in] | bufferSize | Buffer size in samples |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSREMOTECONNECT_API int dsconStartMeasurement | ( | DSXInstanceHandle | handle | ) |
Start measurement.
Begins data acquisition on all configured channels.
| [in] | handle | DSX instance handle |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSX_DCOM_NOT_CONNECTED | Not connected |
| DSX_NET_STARTACQ_FAILED | Failed to start acquisition (NET) |
| DSREMOTECONNECT_API int dsconStopMeasurement | ( | DSXInstanceHandle | handle | ) |
Stop measurement.
Stops the current measurement session.
| [in] | handle | DSX instance handle |
| DSX_NO_ERROR | Success |
| DSX_NULL_HANDLER | Invalid handle |
| DSX_DCOM_NOT_CONNECTED | Not connected |
| DSX_NET_STOPPING_ACQ_FAILED | Failed to stop acquisition (NET) |
| const std::string VER_DSREMOTE = "1.1.3.24" |
DSRemoteConnect library version string.
Definition at line 141 of file DSRemoteConnect_Documented.h.