Is my math right?

Forshock

Member
Join Date
Apr 2002
Location
Apple Valley, CA
Posts
7
here we go, trying to get this right i want to add 15 to a number in v7770 (Realtime Clock minutes) and store it in v2548 (User storage so i can do:

LD
V7770

ADD
K15
OUT
V2548

and taht should add 15?

PLC: DL05 /w Realtime clock card

Thanks
Mike
 
DirectSOFT will fight you on this one... It doesn't allow you to ADD a constant. Just swap the constant and variable. Same end result

LD K15
ADD V7770
OUT V2548

-Eric
 
It will be interesting to see if you can find v2548, since you cannot use any 8's or 9'2 with Direct Logic.

Good luck!
 
Good point Bubba!!! I only looked at the problem with the instruction sequence. I should have noticed this other error! :oops:

Yes Terry, but the constant (K15) is also BCD, so it will work fine. I regularly subtract K12 from the hours value when converting to 12hr format (for HMI display purposes).

beerchug

-Eric
 
Soooo...... Eric,

K15 is a constant stored in BCD Format? Says who?

I don't see K15 format being declared as BCD, but I'll take your word that it is.

So, all of the values involved are BCD.

And... K15 and V7770 are ADD'ed... Would that be a Binary ADD? or a BCD ADD?

I see Forshock ADD'ing 15-Binary (K15) to mm-BCD (V7770).

Am I totally lost, again?
 
The DL's native format is BCD. You have to specify a different instruction (eg ADDB = Add Binary) to utilize a different base. The K15 would automatically be BCD (actually Hex because you can do constants like K7A but then a BCD math instruction errors out). I get caught by the ADD instruction not allowing a constant as an argument also when I get to writing quickly.
 
Terry... I think Bernie answered those questions MUCH better than I would have. Still lost?

beerchug

-Eric

__________________

- Error: Keyboard not attached. Press F1 to continue.
 

Similar Topics

Hey guys, I'm programming this stepper motor to go back and forth at two set angles. After programming, I realized that my program only works when...
Replies
8
Views
2,256
If i am flowing a fluid at 300 GPM with a density of 8lb per gallon and an receiving one pulse per lb, i would be getting 1 pulse every 25ms...
Replies
17
Views
2,996
I have an expression in a structured text routine of a Logix controller that looks more or less like the following: ResultInteger := Integer1 *...
Replies
13
Views
286
This application has a motor with encoder feedback that drives a linear actuator that moves in/out, and is at roughly 45 degs from horiz. As the...
Replies
19
Views
1,352
Hi all. First time programming a machine of this type. A center driven unwind feeding to a center driven rewind. No dancers or load cells, just...
Replies
37
Views
4,849
Back
Top Bottom