| libvkdaq VKINGING DAQ Library API Reference |

Loading...
Searching...
No Matches
Continuous offline storage
Temporary task flow chart

Note
  Steps:
  1.Create task. VkDaqCreateTask
  2.Create analog output channel VkDaqCreateAIAccelChan
  3.Set sampling clock VkDaqCfgSampClkTiming
  4.Start offline task VkDaqStartOfflineTask
  5.Stop task VkDaqStopTask
  6.Clear task VkDaqClearTask

Example of Continuous offline storage Process Diagram

C language reference
#include <stdio.h>
#include "libvkdaq.h"
#define VkDaqErrChk(functionCall) if( VkDaqFailed(error=(functionCall)) ) goto Error; else
int main(void)
{
TaskHandle taskHandle = "VkDaqTaskHandle";
float64 data[1000];
int64 total = 0;
int32 error = 0;
int32 read = 0;
// VkDaq Configure Code
VkDaqErrChk(VkDaqCreateTask(taskHandle));
VkDaqErrChk(VkDaqCreateAIVoltageChan(taskHandle, "dev1/AIN1", "", VkDaq_Val_SingleEnded, -10.0, 10.0, VkDaq_Val_Volts, ""));
VkDaqErrChk(VkDaqCfgSampClkTiming(taskHandle, VkDaq_Val_ClkSrc_OnBoardClk, 10000, VkDaq_Val_Rising, VkDaq_Val_ContSamps, 0));
// VkDaq Start Code
VkDaqErrChk(VkDaqStartOfflineTask(taskHandle, VkDaq_Val_SaveFormat_CSV,20,0));
printf("Start Offline successful...\n");
Error:
if (VkDaqFailed(error))
printf("VkDaq Error: %s\n", VkDaqGetLastErrorInfo());
if (taskHandle != 0) {
// VkDaq Stop Code
VkDaqStopTask(taskHandle);
VkDaqClearTask(taskHandle);
}
printf("End of program, press Enter key to quit\n");
getchar();
return 0;
}
VkDaqClearTask
int32_t VkDaqClearTask(const char *task)
Clear task.
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.
VkDaqStopTask
int32_t VkDaqStopTask(const char *task)
Stop task.
VkDaqGetLastErrorInfo
const char * VkDaqGetLastErrorInfo(void)
Get the error message of the last execution.
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...