Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

digital analogue singnal measurement syncronizing

1.I have one USB6218 card and I used the DAQ assistant to acquire the 12 analogue signals, however, when I tried to measure digital signal frequencies with the same card, I wasn't able to add new channels in the same DAQ assistant as there were no options to add frequency(because it was set up for analogue signals). So I had to create a new DAQ assistant for the measurement of frequencies  using the counter. They worked OK seprately, however, when I put the two DAQ assistant into the same time loop, it was very slow, and there were different error messages poping out. The sampling time for the analogue DAQ assistant was set 7000 and samples to read set 1000, while the samples to read for the frequency measurement( I used one counter) was set 100(i tried 1000 too , but didn't work). Could you tell me what the problem was? How can I syncronizing them into the same loop or program?

 

2. When I used the counter for the measurement of digital signal frequencies, the program would suddenly stopped  and showed an error message when there was no signal fed into the card which I thought  would have showed 0Hz . When there were, it worked properly.

 

Thank you very much!!

0 Kudos
Message 1 of 5
(3,426 Views)

Hi,

1.

The main reason for the issues you are seeing is because the DAQ assistant is only intended for use while making simple measurements.  As you are attempting to do multiple measurement types and synchronize these you need to look at using the lower level DAQmx functionality.

 

I suggest you take a look at this article which is a very good guide to getting started with the lower level functions.  Have a good look at the advanced programming in DAQmx and the synchronizing tasks part in particular.  This should give you a very good idea of how to architecture the same code but using the lower level DAQ functions.

There are also a series of synchronization examples in LabVIEW under > Hardware Input & Output > DAQmx > Synchronization > Multi-Function that should give you a good idea how to do this.

 

2.

My suggestion with this problem is that the timeout is been reached when no signal is fed in and this is causing the error.  Check the timeout is sufficient and try increasing it.

 

Hope this helps.

Best regards,

 

John P

------
John.P | Certified LabVIEW Architect | NI Alliance Member
0 Kudos
Message 2 of 5
(3,413 Views)

Thank you so much for your reply. Now I've done the program using the synchronizing samples. the analogue one is used for the measurement of several analogue inputs and the counter one is used to measure some digital frequency. Do you think it is ok? Now the problem is

 

1.how can I write the data from the two(analogue and counter) simultaneously into one file?

2.If I want to add some boolean controls for some digital signal generation(once it is triggerd by the boolean, it will generate digital signals continuously), I don't need to synchronize them, do i?

 

Thanks

0 Kudos
Message 3 of 5
(3,389 Views)

I am glad to hear you have the synchronization working.

 

In terms of saving the data to file I would suggest you just build both sets of data into an array and save that to a file on each iteration of the loop.

Use the low level VIs to create a new file outside the loop, pass this reference in and use a write to binary / write to spreadsheet file in the loop then close the file reference outside of the loop.  Take a loop at the examples in LabVIEW to help you with this.

 

If the digital tasks are in no way dependent on the analogue tasks you can simple create a second loop that will run in parallel for your digital control tasks.  I would suggest a local variable of your stop button to stop the second loop.

 

Let me know if you run into trouble or need any clarification.

 

Best regards

------
John.P | Certified LabVIEW Architect | NI Alliance Member
0 Kudos
Message 4 of 5
(3,363 Views)

Hi, john,thanks a lot. could you please check another thread of mine, i still haven't figured out this problem:

 

http://forums.ni.com/ni/board/message?board.id=250&thread.id=46739&view=by_date_ascending&page=1

0 Kudos
Message 5 of 5
(3,361 Views)