Host Engineering Forum
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
June 23, 2017, 03:32:29 pm


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: BRX, Encoder  (Read 137 times)
ivelectric
Newbie
*
Posts: 2


« on: June 12, 2017, 09:14:55 pm »

Hi,
I have a BX-DM1E-36ED13-D hook up to a Quad encoder. i'm using a greater than instruction and the quadrature counter function to set some outputs, the problem am having is that the
encoder value its lost at power up after a power outage. can somebody help me with this?
Thank u.
Logged
Evilbeard
Sr. Member
****
Posts: 99


« Reply #1 on: June 14, 2017, 09:06:45 am »

You'll basically need to store the encoder count in a memory location. Then, on first scan, you can write the stored number back into the $encoder.acc location.
Logged
BobO
Host Moderator
*****
Posts: 3527


Yes Pinky, Do-more will control the world!


« Reply #2 on: June 14, 2017, 09:40:29 am »

You'll basically need to store the encoder count in a memory location. Then, on first scan, you can write the stored number back into the $encoder.acc location.

That's half right. The accumulator location is an output from the counter hardware, writing directly to it won't help. The workaround requires three registers...we'll call them Accumulator, LastAcc, AccOffset...and LastAcc and AccOffset must be retentive.
1. In $tFirstScan, MATH AccOffset = AccOffset + LastAcc
2. In $TopOfScan, MOVE $Ctr.Acc to LastAcc and MATH Accumulator = $Ctr.Acc + AccOffset
3. In your code, reference Accumulator instead of $Ctr.Acc
4. When you reset the counter, be sure to reset AccOffset

We will definitely fix this. The fix will be in the next release.
Logged

"We would rather apologize to 20% for what we chose not to do, than to apologize to 100% for what we did poorly." -BobO
ivelectric
Newbie
*
Posts: 2


« Reply #3 on: June 16, 2017, 06:24:42 pm »

Ok, thank you guys for your reply.
i will give it a try.
Logged
BobO
Host Moderator
*****
Posts: 3527


Yes Pinky, Do-more will control the world!


« Reply #4 on: June 17, 2017, 12:17:14 am »

Ok, thank you guys for your reply.
i will give it a try.

We've already fixed this, but it won't be released until August. In the meantime, the workaround I described should be fine.
Logged

"We would rather apologize to 20% for what we chose not to do, than to apologize to 100% for what we did poorly." -BobO
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM