LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cycling through Multiple Channels on DAQ-mx

Solved!
Go to solution

Decided to go ahead with one counter and that got rid of the issue.

Now I realize that the program is taking too long between samples, I would like all 8 channels to be read and written to file every second (And for each row of data to have a time-stamp) right now it takes around 90 seconds for the data to be written for all 8 channels and for the program to progress to the next row. How can I make this vi faster and writing data every second?

 

0 Kudos
Message 21 of 22
(519 Views)

The fact that you iterate 8 times and need "around 90 seconds" suggests to me that you are probably timing out on every single iteration through the loop.  I also notice that your code is suspiciously suppressing timeout errors, which might make the program *look* like it runs, but it won't be producing good data.

 

Other specific advice:

1. Don't clear the tasks inside the main While loop.  The Start and Stop should be enough.  Do the clearing after the While loop.

2. Open your file & write your header before the While loop.  Write to it inside the While loop.  Close it after the While loop.

3. Take a few steps back and troubleshoot more simply and carefully.

 

   Make sure your sensors are producing the right kind of signals and are attached to the right place.  First look at them on a scope or with an analog input channel in MAX.  Are they clean pulses at the right voltage levels for digital logic?

 

   If so, next use MAX to do edge counting of a known-good sensor signal.  Are you seeing the count increment at about the right rate?

 

  I'm pretty sure you've got a signal or config problem that you're going to need to investigate, understand, and fix before any further code review is going to matter.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 22 of 22
(511 Views)