12-09-2011 10:21 AM - edited 12-09-2011 10:22 AM
Try putting a 1mS delay in the loop. Can you post the VI that is doing that?
12-09-2011 10:25 AM
Sorry..."Stupid Stamp"...I had a "miswire". Thanks for the solution. It works like a charm.
12-09-2011 10:42 AM
@MarkDavid wrote:
I'm getting bizzar numbers between counts. It goes 1...then 3.406e9 then .2... then 3.406e9.. I keep getting 3.406e9 between increments.
When it should be 1...2...3...4...
Any ideas?
Does your original code that you posted display "bizzar" numbers? Not likely.
If you are using the example posted above and modifying to meet your needs, I suspect that you are not feeding the right hand shift reg correctly at all times. Some other logic at play not passing the shift reg data through.
Post another example of your code. The examples posted above should do what you wanted it to do without bizarre numbers.
10-06-2012 10:19 AM
Hi I am new to NI and I hope you can help on this topic. I have attached the VI file as well.
Regards,
NKR
10-06-2012 10:36 AM
You probably should have started a new thread with your question rather than tacking on to the end of a nearly year-old one.
One problem with your code is that your switch A is read only once before the while loop starts. It is never read again, so there is no way to detect the change. You will need to move that into the loop.
It sounds like you want to monitor either a true to false, or false to true change and do something at that moment. You should store the value of the switch in a shift register and compare its value in the current iteration with the previous iteration. With the correct boolean logic, you can detect either the true to false or false to true change. (Not previous AND current would give a true on the false to true change.)
10-06-2012 02:50 PM
Thanks for the feedback, it works now.
Sorry I didn't realise the postings was a year old!.
Cheers,
NKR