jms
-
Posts
3 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Posts posted by jms
-
-
I have a USB-1808x, and would like to set up an analog output scan that contains N*M samples. For each input trigger, output N samples, and after M triggers, restart at the beginning. Is this possible? I have it working fine with M=1, but the BIDACTRIGCOUNT setting does not seem to have any effect when I try to have a single output scan cross multiple triggers. Instead, it simply outputs the entire scan on every trigger.
Here is a simplified version of my code showing what I am trying to do:
long rate = 10000; int numTriggerSamples = 1000; int numTriggers = 5; int numTotalOutputSamples = numTriggerSamples * numTriggers; HGLOBAL winbuf = cbWinBufAlloc(numTotalOutputSamples); unsigned short *dataArray = (unsigned short*)winbuf; for (int i=0; i<numTotalOutputSamples; i++) { cbFromEngUnits(boardNum, BIP10VOLTS, (float)i / numTotalOutputSamples, &dataArray[i]); } ULStat = cbSetTrigger(boardNum, TRIG_POS_EDGE, 0, 0); if (ULStat != NOERRORS) { return; } ULStat = cbSetConfig(BOARDINFO, boardNum, 0, BIDACTRIGCOUNT, numTriggerSamples); if (ULStat != NOERRORS) { return; } int options = BACKGROUND | EXTTRIGGER | CONTINUOUS | RETRIGMODE; ULStat = cbAOutScan(boardNum, 0, 0, numTotalOutputSamples, &rate, BIP10VOLTS, winbuf, options); if (ULStat != NOERRORS) { return; } cbWinBufFree(winbuf);
-
I have a USB-234 that I am trying to use to output a waveform every time an input trigger is received. I am using the C Universal Library. I am able to use cbSetTrigger() and cbAOutScan() to configure the trigger and output the waveform when the trigger is received using options=BACKGROUND | EXTTRIGGER | CONTINUOUS; When doing this, the waveform repeats forever after the first trigger is received. When adding RETRIGMODE to the options, I get error 52 "Invalid option specified for this function". I don't understand what I am doing wrong, since the documentation for cbAOutScan() seems pretty clear about how to use this option. Using cbSetConfig() to set BIDACTRIGCOUNT does not have any affect on the error that I am getting. Does this board simply not support this option?
Thanks,
John
USB-1808x, analog output retriggering and BIDACTRIGCOUNT
in Measurement Computing (MCC)
Posted
Hi JRys, thanks for looking into this. I understand that BIDACTRIGCOUNT is the number of samples - in my example numTriggerSamples is the number of samples that I want to output with each trigger.
I don't understand what you're seeing that is indicating that BIDACTRIGCOUNT is not supported by the USB-1808. I am looking at the universal library help, and it specifically says that this is supported: