mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
uldaq: add missing function from example/utility.h
This commit is contained in:
parent
69099a2436
commit
e466606fe0
1 changed files with 37 additions and 1 deletions
|
@ -76,7 +76,43 @@ static const struct {
|
|||
{ "unipolar-0.005", UNIPT005VOLTS } // 0.0 to +.005 Volts
|
||||
};
|
||||
|
||||
static Range uldaq_parse_range(const char *str)
|
||||
static UlError uldag_range_info(DaqDeviceHandle daqDeviceHandle, AiInputMode inputMode, int *numberOfRanges, Range* ranges)
|
||||
{
|
||||
UlError err = ERR_NO_ERROR;
|
||||
int i = 0;
|
||||
long long numRanges = 0;
|
||||
long long rng;
|
||||
|
||||
if (inputMode == AI_SINGLE_ENDED)
|
||||
{
|
||||
err = ulAIGetInfo(daqDeviceHandle, AI_INFO_NUM_SE_RANGES, 0, &numRanges);
|
||||
}
|
||||
else
|
||||
{
|
||||
err = ulAIGetInfo(daqDeviceHandle, AI_INFO_NUM_DIFF_RANGES, 0, &numRanges);
|
||||
}
|
||||
|
||||
for (i=0; i<numRanges; i++)
|
||||
{
|
||||
if (inputMode == AI_SINGLE_ENDED)
|
||||
{
|
||||
err = ulAIGetInfo(daqDeviceHandle, AI_INFO_SE_RANGE, i, &rng);
|
||||
}
|
||||
else
|
||||
{
|
||||
err = ulAIGetInfo(daqDeviceHandle, AI_INFO_DIFF_RANGE, i, &rng);
|
||||
}
|
||||
|
||||
ranges[i] = (Range)rng;
|
||||
}
|
||||
|
||||
*numberOfRanges = (int)numRanges;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
__attribute__((unused))
|
||||
static Range uldaq_range_parse(const char *str)
|
||||
{
|
||||
for (int i = 0; i < ARRAY_LEN(ranges); i++) {
|
||||
if (!strcmp(ranges[i].name, str))
|
||||
|
|
Loading…
Add table
Reference in a new issue