Ladder logic problem

ALIMARY15

Member
Join Date
Jul 2011
Location
italy
Posts
75
Good evening to everyone, here is my question..

I have typed a software in ladder using a plc dl05 and interfacing it with a Cmore micro lcd panel. This software is aimed to control a milling machine.I have made a linear axis control using a linear encoder and configuring the plc into the HSIO mode 40 for quadrature input as showed in the plc manual.There is also an operator interface with the Cmore micro where the operator can set the value of the displacement of the axis wanted and also can choose the direction of the movement.

In my program when the operator has chose a value on the lcd panel and has chose the direction (left or right), by pressing the Go button on the panel, the motor is switched on and the axis of the miller starts moving and there is the part of the software which makes the control for the position.

In the software, that i attach here, you can see i used the counter CT76 as in the manual of the PLC explained for MODE 40 of the HSIO.
The wiring and the software seems to work well except for a little problem : lets say the operator inserted a value and press go, then the motor will run and the counter will increment till it reaches the wanted value, then the reset option will reset the value of the counter to zero. But if lets say i try to insert a new value for the displacement and i again press Go the counting won't start to 0 but from a non zero value.

I don't manage to understand, i think there should be another set for the reset variable of the counter into the program. Can someone help?

I know my request my be hard but i have been debugging this software for ten days already and i don't manage to come up with a solution

i attach here both software and monitor interface with cmore micro
 
The UDC counter uses two V memory locations for its preset. In rungs 3 and 4 make sure to use Double size math instructions and ending with the OUTD instruction to write to V2102 and V2103.

The only time I have used the quadrature counter (UDC CT76) I had it in a rung before any stages or subroutines. And I had only one of them (I does coun't both ways you know). I am having difficulty seeing the logic behind the two counters in subroutines.
 
Last edited:
The UDC counter uses two V memory locations for its preset. In rungs 3 and 4 make sure to use Double size math instructions and ending with the OUTD instruction to write to V2102 and V2103.

The only time I have used the quadrature counter (UDC CT76) I had it in a rung before any stages or subroutines. And I had only one of them (I does coun't both ways you know). I am having difficulty seeing the logic behind the two counters in subroutines.


thank you bernie you are always very helpful!!! i will change the code and try again to run the program! hope it will work!!!!


mary
 
The UDC counter uses two V memory locations for its preset. In rungs 3 and 4 make sure to use Double size math instructions and ending with the OUTD instruction to write to V2102 and V2103.

The only time I have used the quadrature counter (UDC CT76) I had it in a rung before any stages or subroutines. And I had only one of them (I does coun't both ways you know). I am having difficulty seeing the logic behind the two counters in subroutines.

hello again bernie, I'm trying to change the code, but I'm having a question.
In rung 3 also have I to use double memory locations? because i need to load the value from the lcd panel and make the following instructions:

ld v2004
mul k7
div 10
out v2102

but if i turn everything to double how the boxes MUL and DIV will become? i don't manage to use MULD and DIVD with a constant like K7 or K10 why?

thank you
 
The UDC counter uses two V memory locations for its preset. In rungs 3 and 4 make sure to use Double size math instructions and ending with the OUTD instruction to write to V2102 and V2103.

The only time I have used the quadrature counter (UDC CT76) I had it in a rung before any stages or subroutines. And I had only one of them (I does coun't both ways you know). I am having difficulty seeing the logic behind the two counters in subroutines.

I have put two counters cause i thought the counter would go from 0 to 99999 and so if I'm moving in the other direction i wouldn't be able to count. So lets say the counter is at 0 and i move in the other direction how can i know when i reached the limit? From which value the counter starts to count in this case?

thank you
 
If you are sure that the counts you are using won't go over 99999999 then use MUL and DIV. Make sure to save the preset into two V memory locations using OUTD.

If this is a linear movement then establish and end point (either the highest or lowest) as indicated by a switch. Move the axis to that point then store the appropriate value into the counter's accumulator. It's just a set of two V memory locations (CTA76 as an alias).

Since you chose a quadrature Up/Down counter it should be able to count up or down within a positive range. Use that appropriate comparison for the direction of movement.
 

Similar Topics

please help i didn't solve this problem with rslogix. I counted but i am not using timer. How i will fix this situation? Please anyone solve this...
Replies
18
Views
4,915
It would be awesome if someone could help me out with this problem. We can only use basic XIC XIO OTE OTL and OTU instructions. I'm not sure on...
Replies
33
Views
9,061
I'm using MotionWorks IEC Pro to write a Function Block program. There is also an HMI that needs to interact with this bit of programming. This is...
Replies
3
Views
4,552
We are asked to program a conveyor to carry two boxes along it and seperate the long from the short by the means of a kicker at end of...
Replies
53
Views
23,317
I am trying to change the preset valve of timer from HMI (IFIX) seems like i can't put any V mem address in that section Is there any trick for...
Replies
6
Views
6,570
Back
Top Bottom