Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/06/2014 in all areas

  1. Welcome to the forums. And congratulations on using a myDAQ with the DAQmx API instead of DAQ Assistant, or some other myDAQ express VI. What you need to do is as you suggested, create a common clock that is shared between both tasks. So you would make an analog task, and for the timing source provide an internal clock channel. Depending on your hardware there are several and some are more flexible then others. You then make a digital reading task that uses the same clock source, then you start your analog and digital task. Neither one will take samples until the clock source you created has started, but when it does it will take samples from both, at the same time. So the third task you need to start, is the one associated with the common clock source. Another method that I just found by searching I've never tried but looks like it creates the analog task, then uses that clock from that task to read from the digital task. It can be found here. https://decibel.ni.com/content/docs/DOC-12185 Also notice in that example how they only create the tasks once, and close once. This is a better way of programming because there is overhead from opening and closing the task over and over. Also you are doing finite reads so your data won't be continuous, it will have breaks between loop iterations and data will be lost where the example I linked to will continue reading where the last read left off. EDIT: For any of this to work your hardware needs to support providing the internal clock to both tasks. I think myDAQ should be able to do this but I have never done this with that hardware.
    1 point
  2. Refnums are not pointers. The size of their values (four bytes) doesn't depend on architecture. Either way I'm surprised you were even able to declare the original recursive type definition. I'm aware an empty array is not actually recursive, but usually LabVIEW errs on the side of caution and strictly prohibits anything of the sort. I'm inclined to think your ability to declare the type at all may be a bug.
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.