Host Engineering Forum

General Category => CTRIO and CTRIO2 => Topic started by: jb on May 16, 2012, 10:49:38 AM

Title: CTRIO will not reset count
Post by: jb on May 16, 2012, 10:49:38 AM
I'm using a H0-CTRIO with a DL-06.  I have a linear encoder connected to A channel to use as an up counter.  Not using any scaling with raw output to v5000. 

I cannot get the counter to reset.  When I issue a out-B5054.1  the count does not reset.  If I add (ld K0) and (out v5000) then it will go to 0 as long as the reset button is depressed, but then returns to the previous value.  I also tried hard wiring the C channel as a reset with the same results.

The weird part is that it did work when I set up the program.  Then I added the output programs to run a step motor.  It seems like there is something internal that is keeping it from resetting. 

Any thoughts?
Title: Re: CTRIO will not reset count
Post by: Greg on May 16, 2012, 02:07:39 PM
My first thought is you have a programming conflict. Something is stepping on B5054.1 bit.

To test, you can insert an END at the top of your program, leaving your CPU in RUN mode. Then use a DataView to turn that bit ON.
Title: Re: CTRIO will not reset count
Post by: jb on May 16, 2012, 03:40:27 PM
I moved the reset command rung to the beginning of the program, and before any of the stages(I'm using rll plus).  Now it works.  It doesn't make sense why it would work here and not inside a stage.  Oh well, It's working now.