04-17-2020 01:43 PM
I want to measure voltage with my cDAQ and C-Series Voltage Input Module. I want to use ai0 and ai1 to get two synchronizing waveform. But I can not even run these two channel in one programm. I can only use each one to create a subVI and use subVI for measurment in the third picture(messen is the subVI). I have also fould examples of synchronizing measurment in this link: http://www.ni.com/tutorial/5376/de/ I can not find the source for Timing and Trigger (cDAQ/ai/startTrigger). I want to know how to write a synchronizing measurement programm in a subVI.
Solved! Go to Solution.
04-17-2020 01:52 PM
Combine BOTH channels into 1 task, do NOT use separate tasks for each channel.
If your device supports simultaneous sampling than they will be synchronized, if the DAQ multiplexed then there will be a small delay between digitization events.
mcduff
04-17-2020 03:21 PM
yeh I know I should put them in one Task. But error occured when I write both of them in one Task. I have made a screenshot of the error. I don't know why.
04-17-2020 03:31 PM
I cannot tell from the screenshot, you need to upload your VI if you require more in depth help.
Your screenshot showed two tasks not one.
mcduff
04-18-2020 03:06 AM
yeh, I know what you mean. I have put them in one Task. You mean in this way these two signals are synchronized with each other? Another Problem is, when I put them in one Task, the highest sample rate is only half as before. Is there any method to make the sample rate stay constant? Because we want to measure high frequency Signals. And a high samplerate is also convenient for filter. Thanks.
04-18-2020 05:10 AM
Hi young,
@Young365 wrote:
Another Problem is, when I put them in one Task, the highest sample rate is only half as before. Is there any method to make the sample rate stay constant? Because we want to measure high frequency Signals.
The sample rate is limited by your daq hardware: with a MUX the max rate goes down with the number of channels you need to read...
04-18-2020 07:32 AM
@mcduff wrote:
I cannot tell from the screenshot, you need to upload your VI if you require more in depth help.
Hello, @Young365. I see you are a "New Member", so may not understand the above request. Screenshots are static pictures of part of your code (imagine I showed you a picture of a few hundred lines of MATLAB code and asked for help …). We can't edit a picture, can't "see what's hidden" in a picture, can't "run" a picture, ...
Here's what you should do to help us to be able to best help you:
Welcome to the LabVIEW Forums.
Bob Schor
04-18-2020 09:14 AM
We use NI 9205 for voltage measurement. And the maximum sample rate is 250kS/s. Earlier I used two subVI to make a two-channel-voltage measurement. So both of the channels have a sample rate of 250kS/s. I know sample rate will be only half of it when I make two channels in one Task. In this tutorial:http://www.ni.com/tutorial/5376/en/ (tutorial for cDAQ)
there are also other Methods to make a synchronized measurement (not in one Task). I have also tried these methodes and error occurs. So I want to know why I should make these in one Task and why other Methods in this Website lead to error.
Best Regards
Young
04-18-2020 12:15 PM - edited 04-18-2020 12:17 PM
@Young365 wrote:
We use NI 9205 for voltage measurement. And the maximum sample rate is 250kS/s. Earlier I used two subVI to make a two-channel-voltage measurement. So both of the channels have a sample rate of 250kS/s. I know sample rate will be only half of it when I make two channels in one Task. In this tutorial:http://www.ni.com/tutorial/5376/en/ (tutorial for cDAQ)
there are also other Methods to make a synchronized measurement (not in one Task). I have also tried these methodes and error occurs. So I want to know why I should make these in one Task and why other Methods in this Website lead to error.
Best Regards
Young
You have ONE Resource, the analog input of of your 9205. Only ONE analog input task can use it at one time. Your analog input is multiplexed, meaning than SAME A/D converter is used for ALL channels. Making two separate tasks doesn't magically give two independent A/D converters.
Your link for synchronization is for SEPARATE modules, not channels in the same module. If your cDAQ module supports simultaneous sampling, then ALL channels are synchronized, if your module is muxed, then there are slight phase delays between channels. (You are stuck with the hardware you have.)
Your program needs some work. I haven't looked at it in detail, but the acquire data VI in the loop is incorrect if you want a continuous data stream, you are stopping and starting the task inside the loop, you need to move the start and stop outside.
Look in the example finder for continuous DAQmx acquisition and study it.
mcduff
04-18-2020 01:50 PM
Hello Mr mcduff,
thank you so much for your teaching:) And about the acquire data VI, I have also considered a lot. I tried to make a corrcect subVI such as the example I attached. I use two Array as Output of the subVI. But it makes no sense because Array can not come through the while loop. That's why I made it all in a while loop. I want to write the Signal Collection in one subVI and that's a start of the whole Programm.