Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

optimization

I am kind of new at programming and I was wondering if anyone had ideas on how to optimize my code.
Download All
0 Kudos
Message 1 of 2
(2,197 Views)
Thank you for contacting National Instruments.

Though our tech support department generally doesn�t look over code for the purpose of general commenting or debugging, I surveyed your code and I can suggest a couple of things.

The first is a programming practice that has wide applicability for many DAQ applications. The practice is to create a separate thread for data acquisition. This way, your data acquisition, which really is the time critical piece of the code has precedence over the user interface updates, which are almost always less important from a timing standpoint. Full details on creating new threads in CVI can be found at the following link:

http://zone.ni.com/devzone/conceptd.nsf/webmain/2DF76D8073AA2A8C86256D2C005586D2?opendocument

As an
other general tip, and I don�t think this is necessarily an issue here, make sure that you are updating your front panel values only as frequently as necessary. For instance, if a value isn�t going to change between updates, you may want to skip the call to update the user interface with that value until it actually does change. There is always a little overhead associated with changing the UI display, so it is something to keep in mind.

The first suggestion is the major one, of course. Hope this helps!

Regards,
Mike G.
National Instruments Support
0 Kudos
Message 2 of 2
(2,197 Views)