Discussion:
HSDIO 6552 HardwareCompare 1st Error Bit Then Stop
(too old to reply)
engwei
2008-07-02 08:10:10 UTC
Permalink
Hi All,
 
Need help..
I take the example from Hardware Compare - Error locations.vi and modify so the data acquisition will stop once the first error bit found.
If user need to know only the first error location, run of the whole test pattern is quite waste of time.
 
So I modify the code to stop the test (don't wait until done) once it found any error. But the result seems still catching a lot of error sample.
Em.. someone can help me ?  ... thanks. ..


Forum.JPG:
Loading Image...
G Lo
2008-07-02 20:40:08 UTC
Permalink
engwei,
I am not sure what you have done in the rest of your code but from the JPG it seems that you are controling the while loop with the output of HardwareCompare.SamplesErrorsBacklog.  This will stop the while loop but the rest of the code should run when the while loop is complete.  If you would like to find the first Error Sample then you may want to wire 1 to the Number of Sample Errors to Read input of the Fetch Sample Errors.vi.  You should not have to change much on the example of you just wish to read one Error Sample.  For future reference, try to include more details such as hardware, software version, and possibly attaching the code.  
engwei
2008-07-03 03:40:06 UTC
Permalink
Thanks for your reply, G lo.
 
But, I need to STOP the generation and acquisition once I  found first error. If I fetch the first error sample only, the rest of the generation and acquisition will still going on, and, it would waste of time.
Thanks.
G Lo
2008-07-08 00:10:08 UTC
Permalink
engwei,
Sorry about that, I misunderstood your original concern.  One method that you could go about doing this is placing a while loop around the fetching portion of the code. (Make sure to include the generation task line and the property node, though)  Basically, you could continuously fetch the errors and check to see if you have encountered the first error.  If so, then you can stop the loop and cease generation.  The wait until done would have to be removed as well because it is causing the program to pause until the data operation is complete.  As of now, your while loop is only over the Property Node but you would need to expand it to encompass the fetches.  Also, it does not seem like you are ceasing generation in your code.  Make sure to do this by closing the Generation Session when the first error is encountered.     
engwei
2008-07-08 02:10:14 UTC
Permalink
Hi,
Thanks for your answer. I will try it. :)
ChrisNI
2008-07-08 13:10:07 UTC
Permalink
Another way of stopping the operation is to use the "niHSDIO Abort" function - it interrupts the operation but doesn't close down the task.  All data lines are sent to the "idle state".  You can then restart the task if you want without the overhead of redownloading waveforms, etc.
 
Hope this helps,
Chris
engwei
2008-07-09 03:10:06 UTC
Permalink
Thanks !!

Loading...