07-13-2005 04:31 PM
07-14-2005 11:08 AM
Hi Brandon-
One limitiation of NI-DAQmx Base that is not a consideration when programming with NI-DAQmx is the fact that NI-DAQmx Base is not multi-thread safe. This is outlined in the NI-DAQmx Base ReadMe as follows:
NI-DAQmx Base is not multi-thread safe. In LabVIEW, use the error cluster to force execution order. In C, use only one thread to make API calls; especially for task/channel creation and deletion.
You will need to make sure that you do not have parallel branches in code and that the error cluster follows through the entire chain of operation. I have attached a VI that shows how the error cluster can be used to force only a single thread of operation. Please keep in mind that this is an example written for Windows so it might not be functional with your card, but it should give you an idea of how to force execution order on the VIs.
If this ends up not being the problem, please post back here with any more info you think might be useful or a SMALL portion of your code that is acting up to see if we can have any luck reproducing the problem.
Good luck!:manhappy:
10-23-2005 09:12 AM
10-23-2005 03:33 PM
Hi Dr.Berns-
Your example is an NI-DAQmx example and not an NI-DAQmx Base example as discussed in this thread. So, you are not seeing the same problem with your PID example.
The problem you are seeing with NI-DAQmx is likely that you are trying to run the two analog output tasks from that example on a single card. This is not possible and will result in the error you are seeing. From the documentation for that example:
Note: The 2 analog output tasks are on two separate devices.
You can never have two analog input tasks or two analog output tasks on the same card at the same time. Am I correct in assuming that this is the problem? Please post back if not.
Thanks-
10-23-2005 05:53 PM - edited 10-23-2005 05:53 PM
Message Edited by Dr.Berns on 10-23-2005 05:55 PM
10-24-2005 12:26 AM
10-24-2005 02:27 AM
10-24-2005 10:19 AM - edited 10-24-2005 10:19 AM
Hi Berns-
Your new VI looks great! Are you having better results by using that method? I also spent a few minutes updating the PID example to a point that it should work with a single card 2-channel solution. Please take a look and let me know what you think.
Thanks-
Message Edited by Tom W. on 10-24-2005 10:20 AM
10-25-2005 01:08 AM
10-25-2005 03:29 AM