Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

imaq daq execution problem

Hello all,

I am using an IMAQ 1409 with an DAQ 6601 card, I have two diferents vis, one for the imaq (with sony xc-hr50 in asynchronous reset mode), an the other vi is for read some signal in the daq card, with this signals I form a matrix variable (data) that must be pass to the imaq vi.  My problem is when I run both vis one of they dont work in the same way when I just execute only one.  Some times the images in the imaq vi don´t refresh and other times the daq dont read the signals normally.  I am using counters of the daq card for generate the signal that the same card read (frequency is 15 Hz - four signals).
I made an executable for the vi that work with de imaq card and the problem dissapear but the signal that read in the daq card (I pass to the other vi with a global variable) do not refresh never in this vi, I look this variable and change wiht the hole system is runing.

Thanks for your help

0 Kudos
Message 1 of 2
(2,996 Views)
Hi Alvar,
 
When two VIs are running simultaneously, unless there is handshaking between the two, the execution order can vary.  If global variables are used, this becomes increasingly problematic.  The values used by each program varys depending on when the data is being read, which can vary from time to time.  It is possible to read old data twice, miss values, and many other things.  This is commonly refered to as a "race condition."  It sounds like you program is doing this, which is causing the problems you described.  I recommend combining the two programs into one larger program so it is easier to spot and fix race conditions or add handshaking between the two programs.  I personally recommend the first option because it is much easier, but both would work.
 
Regards,
 
Ryan M.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,981 Views)