(you are viewing a thread; or go back to
list of threads)
count up/ count down (by Alex)
i was trying to make a counter from 0 to 10, like this
LADDER DIAGRAM:
|| ||
|| X1 Cnew ||
0001||-------] [----------[CTR 10:0]----||
24|| ||
|| ||
|| X2 Cnew ||
0002||-------] [----------[CTC 0:10]----||
28|| ||
|| ||
|| ||
2||------[END]-----------------------||
58|| ||
|| ||
I/O ASSIGNMENT:
Name | Type | Pin | Port | Pin name
----------------------------+--------------------+-----+------+-----------
Cnew | contador | | |
X1 | entrada digital | | |
X2 | entrada digital | | |
VAR LIST:
2 bytes CA Now not used !!!
2 bytes Cnew Now not used !!!
* I want to make an up/down counter that starts from 0, but it starts from 10. How can i make the logic ladder?
(no subject) (by Alex)
ladder:
|| ||
|| X1 Cnew ||
||-------] [----------[CTR 10:0]----||
|| ||
|| ||
|| X2 Cnew ||
||-------] [----------[CTC 0:10]----||
|| ||
|| ||
|| ||
||------[END]-----------------------||
|| ||
|| ||
(no subject) (by MGP)
Use the ADD and SUB instructions, not the circulair up and down counters.
Remember that they are circulair!
(no subject) (by Alex)
yeah, it worked, thanks a lot :)
(no subject) (by Ihor Nehrutsa)
In fact, the use of counter is intuitive to the user and the processor uses less memory.
(no subject) (by MGP)
Yes, it uses less memory, but he needed a up/down counter with the same variable name as far as I have understood his question.
With a circulair counter you can't do this.
(no subject) (by Alex)
yeah, one of the advantage of ldmicro is that it is intuitive to the user, the first idea i got for a 0-10 counter and vice versa was using counters(CTC , CTR), but it always started in 10, i could make an arrangement to make it start in 0 as ldmicro is intuitive, finally using the add sub as MGP told me it worked ok
(no subject) (by Alex)
this is the first attempt with CTC and CTR
(no subject) (by Alex)
this is with CTC and CTR with arrangement
(no subject) (by Ihor Nehrutsa)
this is with CTC and CTR (CTU, CTD) with init
(no subject) (by Alex)
yeah many ways with ldmicro, then so Counters use less memory for the processors or ADD/SUB with MOVE?
(no subject) (by Ihor Nehrutsa)
You are free to conduct research, which of the equivalent operations takes less memory.
The numbers in left side of ladder diagram is
- rung number,
- number of internal operations,
- number of ASM/HEX operations. <- compare these numbers for different rungs.
(no subject) (by Alex)
I see Ihor, thanks for your reply
Post a reply to this comment:
|