WHY CANT I CHANGE A TONs (PRESET)???

miller20

Member
Join Date
Jan 2020
Location
michigan
Posts
41
So I am running into something i have never ran into for some reason i cant change the preset on a timer every time i do it just reverts right back to what it was can anyone help with this? T4:80 is the timer i want to change.

InkedCapture_LI.jpg Capture 1.PNG
 
the cross reference that you've posted shows that the Preset for that timer is addressed in Rung 6 and in Rung 7 - but you've only shown us Rung 7 ...

maybe what's going on in Rung 6 is causing your problem ... take a look at that rung - and post again if necessary ...

next question: WHERE exactly are you trying to make (enter) the change? ... inside the TON instruction itself? - or in the MOV command? - or somewhere else? ...
 
Welcome to the forum!


You don't state your programming experience level, so I will explain as if to a beginner.


I assume the PLC executes the rungs shown, and many others, on every program scan, and it make one program scan tens, or hundreds, perhaps even a thousand, times per second.



The discrete bit [Bottle Selection 20 OZ L.W. B27:0/11] must be either 0 or 1.

The MOV instruction on Rung 0006 assigns 1800 into T4:80.PRE if and only if the B27:0/11 bit is 1*

The MOV instruction on Rung 0007 assigns 2700 into T4:80.PRE if and only if the B27:0/11 bit is 0**

Since 0 and 1 are the only two possibilities for B27:0/11, exactly one of them will be True on every scan, so the value of T4:80.PRE will be assigned a value, i.e. either 1800 or 2700, on every scan.

So with the program as written, and scanned and executed many times per second, any change made to T4:80.PRE external to those MOV instructions on rung 0006 and 007 will be overwritten, to either 1800 or 2700, by one of those MOV instructions on the next scan, and the overwriting will happen so fast (milliseconds) that you will never see the changed value.




* the XIC instruction means "look for a 1 in my bit, and make the output rung True if that 1 was found.")


** the XIO instruction means "look for a 0 in my bit, and make the output rung True if that 0 was found."
 
Last edited:
Thank you very much makes sense so i will have to add some new logic in there to get that to do what i want?

To be honest, you haven't told us exactly what you want to do, only that you can't do what you want.

If you just want to punch in a preset value from the programming terminal, it's not going to work, because as already explained, rungs 6 and 7 will just put it back to what the programmer decided it should be.

If you want to "experiment" with different timer presets, then yes, go ahead and add a new rung after rung 7 to move another register's value into the .PRE, but precede the move with an XIC of a spare bit that you can turn on when you need to do the tests. A situation of "last one wins" will be the case here, so regardless of what rungs 6 and 7 do, your "test" rung will override if your "test" bit is true.
 
Thank you very much makes sense so i will have to add some new logic in there to get that to do what i want?


Yes.


The PLC will always do exactly what you tell it to do.


If you have a pure heart, and are very clever, and very very lucky, sometimes it will do what you want it to do.


:D
 

Similar Topics

Compactlogix. Newest version of rslogix 5000. Online editing open up PID dialog cant change values. What am i doing wrong or missing? Thank you
Replies
2
Views
1,929
I have a sysmac omron plc C200H CPU01,only the power led is ON,using CX-ONE programmer software, and connecting to the plc via Host link LK202-V1...
Replies
2
Views
695
Good morning, we have a lot of coolant mist around our machines and sometimes the fans on the drives inside our electrical cabinets will suck the...
Replies
7
Views
1,283
I cannot get CCW to add a controller, i keep getting a error message saying that the device is not authorized. This happens with any model and...
Replies
1
Views
1,337
Hey guys, Frustrating issue here. I have one particular PC with Proficy 8 installed that no matter what I try, I cannot get the variable...
Replies
6
Views
1,421
Back
Top Bottom