| libvkdaq VKINGING DAQ Library API Reference |

Loading...
Searching...
No Matches
Functions
Continuously output any waveform
libvkdaq Function interface » Write functions

## Functions
int32_t | VkDaqSetTaskStreamData (const char *task, const double dat[], int32_t sampsPerChan, int32_t fillmode, int32_t autoStart, int32_t stopAt, double timeout)
| Set task data.

## Detailed Description

## Function Documentation

## ◆ VkDaqSetTaskStreamData()

int32_t VkDaqSetTaskStreamData | ( | const char * | task,
|  | const double | dat[],
|  | int32_t | sampsPerChan,
|  | int32_t | fillmode,
|  | int32_t | autoStart,
|  | int32_t | stopAt,
|  | double | timeout
| ) |  |

Set task data.

data type | parameter | describe
--- | --- | ---
`const char*` | `task` | Task name(string type, for example`"Task1"`)
`const double[]` | `dat[]` | Task data buffer (`double`array pointer).
`int32_t` | `sampsPerChan` | The number of samples to be written to each channel (integer type).
`int32_t` | `fillmode` | Data arrangement: `0`: interleaving (grouped by scan count) `1`: Non interleaved (grouped by channel)
`int32_t` | `autoStart` | Waveform output control: `0`: Do not output waveform `1`: Output waveform
`int32_t` | `stopAt` | Waveform stop control: `0`: When stopped, the output voltage is 0V `1`: When stopped, the output voltage is the current voltage
`double` | `timeout` | Timeout time (unit: seconds,`double`type, supports sub second precision, for example`0.5`represents 500 milliseconds).

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() {
const char* task = "task1";
double dat[1000];
int32_t sampsPerChan = 1000;
int32_t fillmode = 0;
int32_t autoStart = 1;
int32_t stopAt = 0;
double timeout = 1;
double dat[1000];
for (int i = 0; i < 1000; i++) {
dat[i] = 1.0;
}
int32_t result = VkDaqSetTaskStreamData(task, dat, sampsPerChan, fillmode, autoStart, stopAt, timeout);
if (result >= 0) {
printf("Successful\n");
}
else {
printf("Failed\n");
}
return 0;
}
VkDaqSetTaskStreamData
int32_t VkDaqSetTaskStreamData(const char *task, const double dat[], int32_t sampsPerChan, int32_t fillmode, int32_t autoStart, int32_t stopAt, double timeout)
Set task data.