| libvkdaq VKINGING DAQ Library API Reference |

Loading...
Searching...
No Matches
Functions
Digital input trigger configuration
libvkdaq Function interface » Triggering configuration

## Functions
int32_t | VkDaqCfgDigEdgeRefTrig (const char *task, const char *triggerSource, int32_t triggerEdge, uint32_t reserved)
| Digital input trigger configuration.

## Detailed Description

## Function Documentation

## ◆ VkDaqCfgDigEdgeRefTrig()

int32_t VkDaqCfgDigEdgeRefTrig | ( | const char * | task,
|  | const char * | triggerSource,
|  | int32_t | triggerEdge,
|  | uint32_t | reserved
| ) |  |

Digital input trigger configuration.

Note
  You can use the following code to read a list of all trigger sources for a device.

#include <stdio.h>
#include "libvkdaq.h"
int main(int argc, char* argv[])
{
const char* dev = "dev1";
const char* attrName = "TriggerSourceAvailable";
char attrValue[4096] = { 0 };
int32_t size = sizeof(attrValue);
int32_t result = VkDaqGetDeviceAttribute(dev, attrName, attrValue, size);
printf("TriggerSourceAvailable = %s \n", attrValue);
if (result >= 0) {
printf("Successful\n");
}
else {
printf("Failed\n");
}
return 0;
}
VkDaqGetDeviceAttribute
int32_t VkDaqGetDeviceAttribute(const char *dev, const char *attrName, char attrValue[], int32_t size)
Get device attribute value.

data type | parameter | describe
--- | --- | ---
`const char*` | `task` | Task name.
`int32_t` | `triggerSource` | Digital input trigger signal source, such as: "dev1/DIN1.1", "dev1/DIN1.2", "dev1/DIN1.3", "dev1/DIN1.4", etc.
`int32_t` | `triggerEdge` | Trigger edge. 0: Falling edge. 1: Rising edge. 2:Low level. 3:High level.
`uint32_t` | `reserved` | Reserved.

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 = VkDaqCfgDigEdgeRefTrig(task, "dev1/DIN1.1", VkDaq_Val_Rising, 0);
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.
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...