| libvkdaq VKINGING DAQ Library API Reference |

Loading...
Searching...
No Matches
Functions
Start task
libvkdaq Function interface » Configuration task

## Functions
int32_t | VkDaqStartTask (const char *task)
| Start task.

## Detailed Description

## Function Documentation

## ◆ VkDaqStartTask()

int32_t VkDaqStartTask | ( | const char * | task | ) |

Start task.

Note
  Support start multiple acquisition cards simultaneously
  Note:
  Simultaneously enabling multiple cards, when creating tasks, it is necessary to create channels for each device one by one
  It is not supported to set AIN channels for multiple devices first, and then set MIN and DIN channels for multiple devices
  For example:
  支持的：
  VkDaqCreateAIVoltageChan(taskHandle, "dev1/AIN1", "", VkDaq_Val_SingleEnded, -10.0, 10.0, VkDaq_Val_Volts, "");
  VkDaqCfgDigEdgeRefTrig(taskHandle, "dev1/DIN1.1", VkDaq_Val_Rising, 0);
  VkDaqCreateAIVoltageChan(taskHandle, "dev2/AIN1", "", VkDaq_Val_SingleEnded, -10.0, 10.0, VkDaq_Val_Volts, "");
  VkDaqCfgDigEdgeRefTrig(taskHandle, "dev2/DIN1.1", VkDaq_Val_Rising, 0);
  Unsupported:
  VkDaqCreateAIVoltageChan(taskHandle, "dev1/AIN1", "", VkDaq_Val_SingleEnded, -10.0, 10.0, VkDaq_Val_Volts, "");
  VkDaqCreateAIVoltageChan(taskHandle, "dev2/AIN1", "", VkDaq_Val_SingleEnded, -10.0, 10.0, VkDaq_Val_Volts, "");
  VkDaqCfgDigEdgeRefTrig(taskHandle, "dev1/DIN1.1", VkDaq_Val_Rising, 0);
  VkDaqCfgDigEdgeRefTrig(taskHandle, "dev2/DIN1.1", VkDaq_Val_Rising, 0);

data type | parameter | describe
--- | --- | ---
`const char*` | `task` | Task name(string type, for example`"Task1"`)

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

C language reference
#include <stdio.h>
#include "libvkdaq.h"
int main(int argc, char* argv[])
{
const char* task = "task1";
int32_t result = VkDaqCreateTask(task);
result = VkDaqCreateAIVoltageChan(task, "dev1/AIN1", "", VkDaq_Val_SingleEnded, -10.0, 10.0, VkDaq_Val_Volts, "");
result = VkDaqCfgSampClkTiming(task, VkDaq_Val_ClkSrc_OnBoardClk, 10000, VkDaq_Val_Rising, VkDaq_Val_FiniteSamps, 1000);
result = VkDaqStartTask(task);
if (result >= 0) {
printf("Successful\n");
}
else {
printf("Failed\n");
}
return 0;
}
VkDaqCreateAIVoltageChan
int32_t VkDaqCreateAIVoltageChan(const char *task, const char *chans, const char *reserved1, int32_t terminalConfig, double minVal, double maxVal, int32_t units, const char *reserved2)
Create AI Voltage Channel.
VkDaqCreateTask
int32_t VkDaqCreateTask(const char *task)
Create task.
VkDaqStartTask
int32_t VkDaqStartTask(const char *task)
Start task.
VkDaqCfgSampClkTiming
int32_t VkDaqCfgSampClkTiming(const char *task, int32_t source, double samplingFrequency, int32_t reserved, int32_t sampleMode, int32_t sampsPerChanToAcquire)
Set the source of the sampling clock, the rate of the sampling clock, and the number of samples to be...