| libvkdaq VKINGING DAQ Library API Reference |

Loading...
Searching...
No Matches
Functions
Create acceleration measurement channel
libvkdaq Function interface » Channel configuration

## Functions
int32_t | VkDaqCreateAIAccelChan (const char *task, const char *chans, const char *reserved1, int32_t terminalConfig, double minVal, double maxVal, int32_t units, double sensitivity, int32_t signalType, const char *reserved2)
| Create acceleration measurement channel.

## Detailed Description

## Function Documentation

## ◆ VkDaqCreateAIAccelChan()

int32_t VkDaqCreateAIAccelChan | ( | const char * | task,
|  | const char * | chans,
|  | const char * | reserved1,
|  | int32_t | terminalConfig,
|  | double | minVal,
|  | double | maxVal,
|  | int32_t | units,
|  | double | sensitivity,
|  | int32_t | signalType,
|  | const char * | reserved2
| ) |  |

Create acceleration measurement channel.

data type | parameter | describe
--- | --- | ---
`const char*` | `task` | Task name.
`const char*` | `chans` | Channel list, Use commas to separate multiple channels or use colons to specify multiple channels in a row., such as "dev1/AIN1,dev1/AIN2,dev1/AIN3,dev1/AIN4", "dev1/AIN1:4", etc. Obtain Raw value: prefix RAW before AIN channel, for example: AIN1 returns Raw value "dev1/RAWAIN1"
`const char*` | `reserved1` | Reserved.
`int32_t` | `terminalConfig` | The input terminal configuration for the channel. 0: SingleEnded.
`double` | `minVal` | The minimum value, in units, that you expect to measure.
`double` | `maxVal` | The maximum value, in units, that you expect to measure.
`int32_t` | `units` | Output unit. 0: mV/g、mV/N. 1: m/s^2. 2: in/s^2. 4: V.
`double` | `sensitivity` | The sensitivity of the sensor Range： 0.000~10000.000mV/g、0.000~10000.000mV/N、 0.000~10000.000m/s^2、 0.000~10000.000in/s^2
`int32_t` | `signalType` | Sensor signal type. 0: IEPE.
`const char*` | `reserved2` | Reserved.

Note
  Note that in IEPE mode, the explanation for the range setting is:
  1. According to the set "maxVal" and "sensitivity", the internal will automatically set to the most suitable voltage range
  2. Suggest setting 'minVal' as the minimum value of the sensor measurement range and 'maxVal' as the maximum value of the sensor measurement range
  3. By setting the minimum and maximum expected measurements, the clipping effect can be achieved
  4. According to the set "units", the collected data is the value of the corresponding unit
  Note that when setting "units" to "V"：
  1. The parameter 'sensitivity' is invalid, and the channel data returns the actual collected voltage value
  2. Voltage range: ± 10V

Returns
  On success, return value >= 0.
  On failure, returns a negative error number.For detail, please Call VkDaqGetLastErrorInfo

C language reference Collecting acceleration sensors（VK1005LC）,Acceleration range：±100g.Sensitivity：50.32mV/g
#include <stdio.h>
#include "libvkdaq.h"
int main(int argc, char* argv[])
{
const char* task = "task1";
char value[4096] = { 0 };
int32_t size = sizeof(value);
int32_t terminalConfig = 0;
double minVal = -100;
double maxVal = 100;
int32_t units = 0;
double sensitivity = 50.32;
int signalType = 0;
int32_t result = VkDaqCreateTask(task);
result = VkDaqCreateAIAccelChan(task, "dev1/AIN1", "", terminalConfig, minVal, maxVal, units, sensitivity, signalType, "");
if (result >= 0) {
printf("Successful\n");
}
else {
printf("Failed\n");
}
return 0;
}
VkDaqCreateAIAccelChan
int32_t VkDaqCreateAIAccelChan(const char *task, const char *chans, const char *reserved1, int32_t terminalConfig, double minVal, double maxVal, int32_t units, double sensitivity, int32_t signalType, const char *reserved2)
Create acceleration measurement channel.
VkDaqCreateTask
int32_t VkDaqCreateTask(const char *task)
Create task.