DL06 - Rookie In Need of Division Help

You are loading and dividing the contents of the timer's accumulators (TA0, TA2) as if they were REAL numbers. They aren't. They're 32 bit BCD. To get to REAL number processing you woyuld have to do this:

LDD TA0
BIN
BTOR
OUTD VXXXX0
LDD TA2
BIN
BTOR
DIVR VXXXX0
OUTD V10002
 
Thanks Bernie, I will give that a shot and let you know how it goes.

Is it correct statement to say that the registers or timers cannot be assigned a number type that always stays with that register, but this must be done whenever performing an operation (add, multiply, output to screen, etc)?
 
You've got it. It' up to you to keep track of the types. You must do your own conversion. Some may see this as a lack of power of the processor but I see it as not wastint the processor's time figuring out types to see if conversions need to be done.
 
I think I found out why I am getting the wraparound problem on the power and run timers when they hit 9999 and reset.

Correct me if I'm wrong...

If my first two timers are accumulators, I should assign them to T1 and T3, so when they fill up they will go into T0 and T2 respectively. T0, T1, T2, etc are 'words' and T0-T1, T2-T3 is a 'double word'. Right now they are T0 and T2, so T1 is incremented when T2 fills up, while T0 fills up and the larger place values are incremented. I thought it shifted up when in fact it shifts down.

I'll figure it out yet...

Bernie - any ideas on how to truncate the percentage and label it like I indicated in the previous post?
 
Nope, it seems like I should keep the two accumulating timers as T0 and T2 to allow space for the double words.
 
You end up with a fractional REAL in V10002. Next do:

LDD V10002
MULR 100 - this takes it from a fractional to closer to a whole
RTOB - this will truncate the decimal portion
BCD - fianlly to BCD
OUT VXXXX - this will have 0000 to 0099

I haven't worked with the local display. I'll leave that part, formatting the display, to you.
 
Why is it that when I type in a V memory location(like V0050) it changes it into TA50?


I thought TA mean timer accumulator.
 
Also, how do I assign a constant value to the MULR function. I type in 100 or k100 and it changes it to TA100.
 
1. Since those V memory addresses are used automatically as the accumulators for timers DirectSoft is being helpful. If you don't want this go to View-Options Click on the 'Global' tab and uncheck 'Display Aliases'


2. A REAL constant is typed RXXX. So type R100
 
Okay, I have the percentage working now (just waiting to see if I have the wraparound erron on the timers when the get to the 5th digit). Thank you very much for helping me to get this far.

Is there any reason that the binary number representing the whole number portion of the uptime percentage must be written to V0000 to V0099? Could I put it as V10008 for example?
 
I think I misled you. When I wrote:

"OUT VXXXX - this will have 0000 to 0099"

I meant that you can send the result via the OUT command to any 'V' register and that the contents of that register would be from '0000' to '0099'. (Though I should have written '0000' to '0100' because it could be 100%)
 
Last edited:
Ahhh...now I see. I was going through the manual like a mad man trying to figure out why the value had to be output to one of the first 100 registers when the other ones could go anywhere.

BTW - I checked that the two timers worked past 9999 and the fifth digit came in flawlessly and the proper uptime percentage was maintained.

Thanks again for your help on this one Bernie. I appreciate you taking the time to hold my hand and walk me through it. Using the manual alone can be done, but in general learning by example is a lot quicker (and involves less banging my head on the wall).
 
Post what you came up with

Could you post your logic that you ended up with working correctly? screenshots and a program upload would be perfect for what im doing tomorrow at work.

almost funny that I find something extremely close to a way to interperet what i need to do for a timer at work tomorrw, weve got a c-more hmi that is set to only output data tags as BCD....which i then need to turn into a timer and feed back into it to be displayed correctly....as it needs to be eight hours long. After reading this whole thread I think this may be the way to do that!

Could you please respond with your logic and be open to questions as i figure it out please?
 
Could you post your logic...


This thread is over a decade and a half old. You might do better to post a new thread with a link back to this one.


Also it sounds like this is not very complicated, perhaps you can post what you have so far. Printing to a PDF file is probably the best way to do that, as not everyone will be able to load the program if you post that.
 
Also I think DL06 has retired :) ... wonder whatever happen to Mike? Bernie is still around every once in a while

DL06.png
 

Similar Topics

Hi, Mostly AB guy here with a little Koyo experience, but all of its digital. I get handed three analog I/O cards and asked to prove that they...
Replies
6
Views
479
Hi all, I am making a test rig to be able to wire in any DL06 (or DL05) And create a HMI in red lions crimson 3.1 to test all the inputs and...
Replies
4
Views
913
I have a Cmore screen which is communicating to the DL06 in BCD and need to create a timer that works in real numbers for a test, I simply need to...
Replies
3
Views
2,091
I have a client that has many Automation Direct DL06 PLCs for a municipal water/wastewater system. When there is a power outage, one of the sites...
Replies
4
Views
2,407
Hey everyone, Working on a system with a Koyo DL06 processor and it's my first experience with them. I have DirectSoft 6 and we got the program...
Replies
5
Views
2,259
Back
Top Bottom