Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

data acquisions in two timed loops sometimes dont reads the input signal

Hello..

  I am using a timed loop inside the master while loop, in which i do data acquisition for 6 sensors. Kindly see the attachment to get a overview. Also i have a infinite while loop (or atleast it should run at 100ms) controlling the pressure in the system. while running NI DAQ reads zero value in an arbitrary iteration (eg shown below) and then starts give the actual value thereafter. This applies to all the 6 sensors, however not all goes to zero at the same time, only one goes. Also i didnt find a periodicity of this zero signal. This does not happen frequently, maybe one or two in 5 minutes..

 

for eg., acquired value from sensor 

2.32

2.33

2.32

2.22

0.00<------

2.22

2.24

2.34 etc..

Thanks Muthu

0 Kudos
Message 1 of 5
(3,637 Views)

would be helpful to see the actual code for data aquisition. could you post a screenshot of the code in your timed loop?

0 Kudos
Message 2 of 5
(3,602 Views)

HI, 

 

 Thanks for your reply. I have attached screen shot of my data acquisition using VISA.

0 Kudos
Message 3 of 5
(3,572 Views)

regardless of the data issue, there might be a better architecture to do your measurements. do your two loops have to interact with each other in any ways? at the moment you have two completely independent loops, and you wont notice when one of them crashes, because the other one continues. the outer loop is only executed once in your case. 

you could have a look at the example projects available when you create a project with the starting window, there are some useful half-ready designs you can modify to suit your purpose.

0 Kudos
Message 4 of 5
(3,530 Views)

timed loops are not multithreading compatible and can cause unexpected behaviour under a windows operating systems, especially if you are also using GUI elements inside the loop. have a look at this Tutorial: State Machines - http://www.ni.com/tutorial/7595/en/ and check out different design patterns under http://www.ni.com/white-paper/7605/en/, and working with functional global variables. hope this helps.

0 Kudos
Message 5 of 5
(3,497 Views)