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.
10-12-2007 06:31 AM
10-15-2007 05:09 AM
10-15-2007 05:46 AM
Jon,
Thanks for the clarification. I 'kind of thought' this was the way it worked, with the calls managing asynchronous transfers of data to my application from some other buffer being continuously filled by the DAQ. It just wasn't stated explicitly in the documentation, at least any that I had read!
Thanks and regards,
Malcolm Sharp
10-16-2007 01:58 PM
10-17-2007 04:14 AM
Jonathan,
In answer to your questions.
1) I guess I've 30+ years experience in data acquisition using computing systems controlling ADC equipment of all types. I'm a user of National Instruments boards and LabVIEW for a couple of years but in trivial applications. I've 5+ years programming in .NET and C# for industrial/scientific applications but a completely new user to programming applications using DAQmx in a .NET environment.
2) I read both the relevent sections of both the NI-DAQmx Help, the NI-DAQmx .NET Framework 2.0 Help and tried out a couple of the NI supplied code examples.
3) I particularly concentrated on the section Asynchronously Reading and Writing with the NI-DAQmx .NET Class Library and that confirmed my understanding of the use of callbacks (why don't Microsoft call them 'completion routines' like everyone else?) and thread safety. I actually had the code written and running correctly before I asked the original question. The question was more to gain a comfort level that the Begin/EndReadMultiSample and async callback mechanism was dealing with requesting async reads from an continuously filled internal circular buffer managed by DAQmx itself. The presence of this internal buffer is implied in the descriptions of the methods to change the default buffer sizes and the handling of data overwrites but I needed that extra confirmation that this was indeed the case.
Maybe a block diagram showing the levels of abstraction in the data flow from the actual hardware through internal buffering to the .NET interface itself might have made it all gel a bit quicker for me. Another block diagram showing the functional areas of the various classes involved with getting at MAX global channel properties, setting up the DAQ and reading the data might be a bit clearer as I had a bit of a learning curve to climb here too. The information is all in the various namespaces and .NET help; it's just that for me personally a diagrammatic 'roadmap' allows me to visualize things quicker!
Despite the above comments I have to say that the DAQmx interface, the supporting documentation and forums etc. is by far the best I have ever used for application development in the real-time data acqusiition area. NI's long-term support of a solid and well documented common DAQmx .NET interface to all its hardware products was more of a deciding factor in our company's decision to buy NI hardware than the actual capbilities and range of the hardware itself. There's no getting around the fact that for a first-time user of managed code, threads and callback in .NET and DAQmx the learning curve is going to be steep. The NI documentation does contain all the information on the DAQmx functionality, nicely integrated into the development environment. Maybe all that's need for users like me is a couple more 'integrating overviews' of the operation and structure.
Thanks and regards,
Malcolm