| libvkdaq VKINGING DAQ Library API Reference |

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

## Functions
int32_t | VkDaqStartOfflineTask (const char *task, uint32_t saveFormat, uint32_t saveTime, uint32_t timeInterval)
| Start offline task.

## Detailed Description

## Function Documentation

## ◆ VkDaqStartOfflineTask()

int32_t VkDaqStartOfflineTask | ( | const char * | task,
|  | uint32_t | saveFormat,
|  | uint32_t | saveTime,
|  | uint32_t | timeInterval
| ) |  |

Start offline task.

Note
  Only supports setting up one acquisition card at the same time

data type | parameter | describe
--- | --- | ---
`const char*` | `task` | Task name(string type, for example`"Task1"`)
`uint32_t` | `saveFormat` | Data storage format Binary format: 0 Text format: 1
`uint32_t` | `saveTime` | The duration of saving a single file Range: 5-3600 seconds Note: Only valid in continuous sampling storage
`uint32_t` | `timeInterval` | Timer time interval Note: Valid only in timed limited N sampling storage

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";
uint32_t saveTime = 60;
uint32_t timeInterval = 0;
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, 1000, VkDaq_Val_Rising, VkDaq_Val_FiniteSamps, 10000);
result = VkDaqCfgDigEdgeRefTrig(task, "dev1/DIN1.1", VkDaq_Val_Rising, 0);
result = VkDaqStartOfflineTask(task, VkDaq_Val_SaveFormat_CSV, saveTime, timeInterval);
if (result >= 0) {
printf("Successful\n");
}
else {
printf("Failed\n");
}
return 0;
}
VkDaqCfgDigEdgeRefTrig
int32_t VkDaqCfgDigEdgeRefTrig(const char *task, const char *triggerSource, int32_t triggerEdge, uint32_t reserved)
Digital input trigger configuration.
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.
VkDaqStartOfflineTask
int32_t VkDaqStartOfflineTask(const char *task, uint32_t saveFormat, uint32_t saveTime, uint32_t timeInterval)
Start offline 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...