| libvkdaq VKINGING DAQ Library API Reference |

Loading...
Searching...
No Matches
Functions
Timing configuration
libvkdaq Function interface

## Functions
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 collected or generated.

## Detailed Description

## Function Documentation

## ◆ 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 collected or generated.

data type | parameter | describe
--- | --- | ---
`const char*` | `task` | Task name.
`int32_t` | `source` | Clock source. 0: Internal clock. 1: External sync pulse. 2: master/slave.
`double` | `samplingFrequency` | Sampling Frequency. When using an external sync pulse, the sampling frequency must be consistent with the external sync pulse frequency.
`int32_t` | `reserved` | reserved.
`int32_t` | `sampleMode` | Sampling mode. In ADC mode 0：continuous sampling. 1：limited N-sampling. In DAC mode 0：Repeatedly outputting fixed waveforms. 1：Single output fixed waveform. 2：Continuously output any waveform.
`int32_t` | `sampsPerChanToAcquire` | In ADC mode: Valid for finite N sampling, used to specify the number of sampling points for finite N sampling. In ADC mode: Fixed number of waveform points

Note
  Note:
  In master-slave mode, the first acquisition card set during task creation is the primary card. reference： VkDaqStartTask

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);
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.
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...