Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - Arithmetic Instructions Help?

(you are viewing a thread; or go back to list of threads)

Arithmetic Instructions Help? (by Mohamed Osama)
Hi every one

I want to know how to use arithmetic instructions?

I wrote the following program:


|| XStart {ADD R :=} ||
||-------] [------------------{ 5 + 6 }-----------||
|| ||
|| ||
|| ||
||------[END]----------------------------------------||

And in the simulation when I turn on start R should be 11 but nothing happens and R value doesn't change !!!
Wed Nov 11 2009, 02:19:25
(no subject) (by Jonathan Westhues)
All variables starting with X (input), Y (output), A (analog input), T (timer), and R (internal relay) are special. Though I should fix how that gets displayed, since it's confusing.
Wed Nov 11 2009, 02:26:40
(no subject) (by Mohamed Osama)
So there is a problem with arithmetic instructions that will be fixed in a later version of the program ??
Fri Nov 13 2009, 02:36:57
(no subject) (by Samukelo Shezi)
If I understand Jonathan correctly, he's basically saying he will find a way to rephrase the manner it's entered, since the presence manner, though correctly functional, but is confusing to some of us.(He will just restructure it a bit)
Fri Nov 13 2009, 04:48:52
(no subject) (by Mohamed Osama)
I don't know what is different from the above program but this program works:

|| XStart {ADD r :=} ||
||-------] [------------------{ 5 + 4 }-----------||

can any one explain??
Fri Nov 13 2009, 06:48:27
(no subject) (by Jonathan Westhues)
Do not start a variable name with R, X, Y, T, or A, unless it is an internal relay, input, output, timer, or analog input respectively.

LDmicro should have warned you about that (and probably will in a later version), but the code shouldn't have worked.
Fri Nov 13 2009, 08:51:07
(no subject) (by Mohamed Osama)
I don't know but the variable name is "r" and the code works 100%
Fri Nov 13 2009, 13:07:31
(no subject) (by Mohamed Osama)
I got it ..
When the variable name is capital r (R) the program doesn't work.
When it is small r (r) the program works.

Anyway I hope there will be no restrictions in variable name in future versions
Fri Nov 13 2009, 13:10:42
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):