07-10-2008 11:23 AM
07-11-2008 02:28 PM
tzj,
I would highly recommend using a producer/consumer architecture. The producer loop would be reading analog input, place the data in a queue, and the consumer loop would remove and process data from the queue. Your coding architecture is not very efficient because the analog read waits until the inner most for loop is complete. A producer/consumer template can be found selecting File>>New and expanding the following folders VI>>From Template>>Frameworks>>Design Patterns>>Producer/Consumer Design Pattern (Data). Also, remember to clear your analog input task by using AI Clear.vi. Let me know if this assists or if this seems to be a hardware issue.
07-14-2008 10:09 AM
07-14-2008 11:49 AM
07-16-2008 10:42 AM
07-17-2008 05:10 PM
tzj,
Using a square wave is a great way to tell if it is software or hardware. I have also attached a test vi that I utilized to see how many counts occur from a point that is above the high threshold and the previous value is below the low threshold. It has changes from your original code but it might spark more architecting idea. Also, make sure to initialize your shift registers as Lynn said. This will ensure that you always will start at a count of zero. Let me know what the results were from the square waveform test.
07-18-2008 01:36 PM