From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-15-2022 02:40 PM
Dear All,
we have a PCIE-6323 card and we want to make externaly trigered analog scan measurement on sixteen channels.
But we need to measure three samples on each AI before we switch to next analog input.
we use NiDAQmx functions
DAQmxCreateTask('',addr(AISCAN_TH));
DAQmxCreateAIVoltageChan( AISCAN_TH,'Dev1/ai0:15'','',DAQmx_Val_InputTermCfg_NRSE,-range,range,DAQmx_Val_VoltageUnits1_Volts ,nil );
DAQmxCfgSampClkTiming( AISCAN_TH,'Dev1/PFI0',200,DAQmx_Val_Rising,DAQmx_Val_AcquisitionType_ContSamps,5);
with this we will get on every rising edge on input PFI0 sixteens analog values from AI0-AI15. But I do not know how to setup this in case when we want to measure three samples from each input before switching to next input?
Any idea?
Thank You
02-15-2022 04:37 PM - edited 02-15-2022 04:43 PM
Yes you can, but the channel list string will look pretty tedious.
Generally, one *can* list the same channel more than once in a task's channel list and then the A/D conversions happen in the same order as defined in the channel list. In your case, you'd need your channel list to go like:
"Dev1/ai0,Dev1/ai0,Dev1/ai0,Dev1/ai1,Dev1/ai1,Dev1/ai1,...".
LabVIEW has some handy utility functions I'd use to make this easier, but you won't have them natively available in a text language. In your position, I'd probably use a doubly-nested loop to form the string, pseudo-code something like (and forgive me b/c I've barely coded text in 25 years)
chan_str = ""
for i=0 to 15
for j=1 to 3
if (chan_str != "")
chan_str = chan_str + ","
endif
chan_str = chan_str + "Dev1/ai" + num2str(i)
end
end
Offhand, I don't what limitations there may be (if any) to the length of this channel list, either in terms of the string itself or in terms of the total channels. There will for sure be some max sample rate constraints caused by extra long channel lists -- you'll need to multiplex among all the channels within one sample period and devices have max limit on the multiplexing rate (a.k.a. the convert clock).
-Kevin P
02-16-2022 01:59 AM
Hello,
I tried it but I have received error.
Error -200489: Specified channel cannot be added to the task, because a channel with the same name is already in the task.
Some other idea?
Thank You in advance
Vladimir
02-16-2022 11:09 AM
Sorry, that little trick used to work as far back as I can remember, but I guess it's also been a lot of years since the last time I needed to do it. I'm curious when that stopped being supported, but unfortunately I don't have any other good ideas for you.
-Kevin P
02-16-2022 11:56 AM
Could you please explain why you need to measure each channel thrice before going to the next channel? perhaps re-evaluate the requirements?
02-16-2022 12:07 PM
Hello,
I want to have average value calculated from three samples on each AI.
Idealy measured in one row before switching to next input. To eliminate settling time a crosstalk. Coversion of all samples (16x3 or at least 3x16) must be started by one rising edge on PFI0 (limited by external hardware).
Vladimir
02-16-2022 12:18 PM
If ghosting or crosstalk is your only problem, perhaps increasing delay between channels might help
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019NFQSA2&OpenDocument=&OpenDocument=&l...
Some more techniques - https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YHy6CAG&l=en-US
Do you have a way to reduce the source impedance of the signal by using an external buffer?
02-16-2022 01:53 PM
It is exactly what I want to do as described in your link. Because I am not able to change hardware to low input impedance and I am not able change also trigering signal .
I suppose to add one dummy reading before two more readings on the same analog input. First sample I will throw away and from the last two readings I will make average value.
Idea is OK but I do know how to do it with DAQmx functions. If I will add two identical channels into channel list then I will receive error.
02-16-2022 02:09 PM
The Dummy channel technique is supported only on X or M series DAQ cards
I am not sure what series your DAQ falls under, since you got an error I would assume it is not supported by our DAQ.
If slowing down sampling rate or increasing inter-channel delay does not help your case, the only other option may be to insert an external buffer in the signal chain.
02-16-2022 02:25 PM
We use Pcie-6323 card. I suppose it is a X serie.