06-28-2010 02:26 AM
Hi,
I have some Motion Control cards and Digital and Analog IO cards, controlling 2 different sets of hardware and I have two different LabVIEW programs (executables) to control them. However, they share some of the cards (even ports). The problem I have is: When I run both programs at the same time, I get NaN when I fetch data from the Analog IO cards and some other conflicts. Apart from combining the two programs (which is hard), is there any workaround for this?
Thanks!
--ray
06-28-2010 04:14 AM
If I'm not mistaken, you usually cannot run more than one task accessing Analog Inputs on the same board.
A way out of your problem could be to use one of your programs to read all the AIs, and then to make them available to the other one (via Datasocket, TCP/IP, shared Variables, etc...).
Marco
06-28-2010 10:18 AM
Marco is correct. You cannot run two analog input tasks at the same time. This is a hardware limitation, not a software one.
Your question is really more of a generic one with two programs trying to access the same hardware resource. Basically you have the following options:
08-18-2010 06:03 PM
Thanks for all your suggestions. I'm now creating a new program for obtaining the data (I call it Data Fetcher) and make the data available to the other two programs (Let's call them Prog A and Prog B for now) through DataSocket.
As a first step, I'm testing it out on Prog A. I noticed that when data fetcher is running but prog A is not running, the data is constantly read out from the hardware, even though prog A is not processing it. In the reverse case: Prog A is running, but data fetcher is not running, Prog A processes the same set of data over and over.
However, what I want to do is that every set of data obtained is processed exactly once by prog A. Since data fetcher and prog A are most likely not running at the same rate, there must be some data lost or some data get processed twice (or more). So, how do I avoid this?
Thanks,
Raymond