Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

event based sampling and output

Solved!
Go to solution

Hi,

 

I'm having an application where I want to sample the AI input and issue the AO output based on the level of a counter measurement. The counter measures the angle of a circular movement. When the angle passes certain levels, e.g. every 30 degrees, we want to take in the AI measurement and issue the AO output. Could anyone tell me how to realize this application? Thanks!

 

 

0 Kudos
Message 1 of 41
(4,590 Views)

Hello Lucy,

It seems that for this application a simple trigger should do the trick.  How the trigger is set up will depend on the your hardware configuration:

  • Are you using a single card for both the AI and AO? 
  • Can you use analog triggers with this card? 
  • Is the AO firing one time each time the AI passes 30 degrees?  

If you can give more details about what and how you are trying to run this, I think I might be able to provide help that is more useful.

 

Cheers, Matt

Message 2 of 41
(4,584 Views)
I'm using a usb-6211 DAQ board for my application. I need the AI to collect one sample and the AO to fire once every time the counter measurement passes 30 degree. What kind of structure do I need for the triggering? I need to have a separate task for the counter measurement, right? Sorry I'm a newbie.:)
0 Kudos
Message 3 of 41
(4,582 Views)
Lucy, you can check out this post as Erik was trying to do something similar to you.  As Jason points out in this post, you will not be able to achieve update rates faster than 1 ms (and I would venture to say that for most Windows OS's you won't get faster than 2 ms).  Jason's reccommendation for FPGA is a good one, but unfortunately requires a lot more thought, time and money than DAQmx (depending on your experience). 
Message 4 of 41
(4,573 Views)

Hi mtat76,

 

Thanks for your suggestion. However, I think my case is a little different from Eric's case. Probably I didn't make it very clear in the previous post. The time lag between the AI sample and the AO output is not very critical in my application. I understand that there will be some delay between the two due to some calculations carried out by the controller. The most cirtical part of my application is how to generate a trigger when the encoder measurement passes 30 degrees. Since the signal from an encoder is an analog signal with jumps, I don't know if this signal can be used for a timed-loop as the timing source. For example, if the encoder has a resolution of 3600 pulses per revolution, can I have the timed-loop to excute with a period of 300 ticks based on the encoder (counter) measurement? Can this analog signal from the encoder be used for this purpose? Thank you!

0 Kudos
Message 5 of 41
(4,566 Views)

Lucy,

 

Can you not just pipe the encoder signal to one of the counters on the board, then have the counter count down the 300 ticks and generate a pulse on the internal counter that triggers the AO for one shot?  

 

And what is the reason for recording the voltage that the encoder sends out?  Is not the level always the same (saturated) or is there some information that can be captured here?  If necessary, you could send the encoder signal to one counter and one AI.

 

Matt

Message 6 of 41
(4,555 Views)

Hi mtat76,

 

Yes, you are right. I think I can just use the pulses generated by the encoder as the timing source and trigger the AI and AO every 300 ticks. I do not necessarily need the encoder (counter) measurement although it will be better if I can know the specific reading of the angle at the sampling instance. Thanks for the help!

 

-Lucy

0 Kudos
Message 7 of 41
(4,551 Views)

OK, Lucy.  Try this - I haven't done this before, so I don't know how this will work out.  But let me know if this is what you are looking for.  I didn't add an AI, but that is simple enough - it should also be triggered off of the same ctr0/InternalOutput on the 6211. 

 

You might also look at this post - not exactly what you are doing, but they are using a linear encoder to trigger a DAQmx event.

 

Cheers, Matt

Message 8 of 41
(4,526 Views)
Oops - cobbled that up quickly and the UI is hideous; try to ignore that Smiley Wink.
Message 9 of 41
(4,525 Views)

Hi mtat76,

 

It seems that I can not open the file since I only have Labview 8.5 and the file was written in Labview 8.6. 😞 Could you please convert it into 8.5 version? Thank you so much!

 

-Lucy

0 Kudos
Message 10 of 41
(4,519 Views)