04-05-2007 08:49 PM
04-06-2007
04:41 PM
- last edited on
10-30-2025
06:20 PM
by
Content Cleaner
Hello wired,
This sounds like an interesting application that you are building. In regard to your post, you were asking about suggestions for the design model. I think you are on the right track with the producer / consumer architecture. You may chose among several different ways for the presentation of your data, but the TDMS file format is the one which I would suggest for high-speed streaming to disk. This format logs data at high speeds along with meta data that you can write for each channel.
You are currently struggling with the way to run an undetermined number of tasks in parallel. What I might suggest would be to use a reentrant sub VI for these tasks. The idea behind a reentrant VI is that it will create a new copy in memory for each time it is called. You might use this VI in a for loop and pass different parameters to this VI such that it will be configured differently for each of the tasks. In this scenario, the different runs of the for loop effectively kick off the different tasks each configured with different parameters. I hope this information is useful for you. Please post back and let us know how your development is coming. Thanks,
Mike D.
National Instruments
Applications Engineer
04-06-2007 05:25 PM
04-07-2007 12:54 AM
Thanks for the input. With regards to the file format, the decision has been made by my superiors not to use TDMS - unfortunate, but NI hasn't provided the information to write a MatLab file reader, which is a requirement. So, I've created a custom file format tailored to the needs of my application, but generic enough to be used for other apps. With it, I've been able to stream 8 channels at 800KHz (4 channels each from 2 PXI-6120s) without breaking a sweat. However, the performance varies greatly depending on which slots the cards are in (but that's a whole different discussion - see the PXI forum for that one). Once NI solves that one, I'll feel a lot more comfortable.
I have already made reentrant subVIs that can perform a specific DAQ task. The problem with a for loop is that the VI sits and wait for a start trigger, then acquires the streaming data. I can't start the next VI because I'm in the first one. I thought about creating a data collection VI, and this VI would start up to 6 other VIs in parallel, based on how many and which cards were present. It's a bit messy, because each slot can contain one of two devices, so I'd need to check which type it was before calling it. I'm thinking I'll have to create the task list and the references to the data in the main GUI loop, and then pass this using a notifier or queue to the data collection loop.
04-07-2007
12:40 PM
- last edited on
10-30-2025
06:20 PM
by
Content Cleaner
Did you try the DLL we provide for TDMS in MatLab?
You can also choose to support TDMS based on its binary layout, but using the DLL will save you a lot of work.
Herbert
04-09-2007 02:43 PM