Tod Ob10-ob17

taz3m

Member
Join Date
Apr 2008
Location
St pierre
Posts
23
Hi all,

Can someone help me about how to use an SFC 29 "CAN TINT" to cancel a time of day interrupt after it has been activated.

Say i want to deactivate my OB 10 after one hour or a condition like the temperature of tank is 42 c.

Moreover can i activate a memory bit say M 0.0 in my OB10 and use this bit in say FC1 to activate an output together with other conditions.. because im trying to do so, but it fail..

Smone help, pls.. thanks..

Taz...
 
Are you getting an error code or are you not sure how to start. If you do this you will have to do a SFC30 to start back up again.

To make it simple why don't you just jump around the code when you don't want it to run...then enable again once you need it. A little crude but effective.

Nick
 
Hi, no there is no error code at all. the actual prob is that, when my OB10 is activated, An output as well is activated, my electro valve. after 1 hour or if i get a condition of 42 C, this valve must be reset, and the output reset, so that tomorrow it can take place again, coz my period being used is daily.

But i have try to reset my output, but i cant do it, even when using the SFC 29, but i think im not using it properly..

When you say to jump around the code, you mean use the jump function,???
If so how should i proceed..???
Thanks...

Taz...
 
I'm not sure what you are refer to with the 42C. It sounds to me like you are better to just write code that check for TOD (time of day) and starts and stops when you need it. Please explain what you are trying to achieve.


Nick
 
Hello taz3m;

You have setup OB10 to be called every day at the same time. Inside the OB10 you have programmed M0.0 to become active while OB10 is active; are you using a SET function?
OB10 is an interrupt that only stays active for a microsecond or so, at the time you specified in the CPU properties. It can be used to SET M0.0, and then you can use M0.0 status to control other functions or networks in other functions. But OB10 is not active once it has given back control to OB1, so cancelling it like you are trying to do makes no sense (Can_TINT is used to remove a programmed OB10 from the CPU logic, not activate/ deactivate the OB10).
Now once M0.0 has been set (in OB10) and is used to control further logic, you only need to reset it (at the moment you need or as a consequence of certain conditions only you can decide) to block the same logic. It will remain SET until a RESET instruction is used to bring back it's value to 0.
I hope I am making myself clear. Please write back to the forum if any more information is required.
Hope this helps,
Daniel Chartier
 
Hello,
i will explain the situation in detail.. at a specific time say, 16h 00. i need to activate a 3/2 way electro valve if this condition is satisfied that is, my water tank temperature is less than 40 degree Celsius. hence the water will go through a Gas Heater instead of going to the solar panels. Now i dont want to use the gas heater continously, only 1 hour it should be run or if the temperature of the water is 42 degree celsius. i.e i need to reset my electro valve after these conditions are satisfied.

Dany, yes i have used a set function to activate the M 0.0 in my OB10. at the same time i have make this M 0.0 call my FC1.. when i need to reset this memory, i cant do it even when reseting this function.

thanks , now i know what is the purpose of the CAN_TINT..
one thing if you are saying that the OB10 is active only for microseconds, this means that when it has been activated, we wont be able to reset it unless we make it before this time duration ???????

IM USING CPU 315 2DP, which consist of only 1 Time of day interrupt, OB10, for my entire project i will need 3 time of day interrupr, anyone has some function that can set a bit at a specific time without calling another time of day interruopt,

Thanks..

Taz..
 
Hi Taz,

It would be easier for you to control your valve using comparisons for the various time elements you need - see attached ladder example.

If you wish to use this method, I've included FC15 along with compiling instructions in case you're not familiar with the procedure.
 
hello taz;
Once the OB10 has passed control back to OB1, your M0.0 is set. You should be able to reset it anywhere in any block; there is nothig special about that set/reset function. It will stay set only if another piece of logic is writing a 1 to the bit continuously... I would check the cross-reference for this address (M0.0, MB0, MW0, MD0) to see if anything is writing a value to the register. if you have an HMI panel or a SCADA screen attached to the PLC, make sure they are not writing anything to this address.
You only have a single TOD interrupt in the CPU 315-2; but you can generate alternate logic in your program to mimic this OB10:

1)Read the CPU's real-time clock with SFC1 "READ_CLK" (from the Standard and System Functions library)

2) use FC8 "DT_TOD"(from the IEC Function Blocks library)to extract the Time_of_Day value from the real-time clock to a DINT register

From the Siemens Step 7 Online help:
A TOD data type is stored as an unsigned integer number of milliseconds, with zero equal to midnight

3)So what you need now is a way to compare between the extracted ToD millisecond value and the millisecond equivalent of the time you seek. For 8:00 AM, it would be [8 hours * 3,600,000 ms/hour] a value of 28,800,000 (ms).
4)Since there is a good possibility that you miss this exact microsecond value due to the PLC scan time, I suggest you use a GR_D (greater than, Double-Integer comparison) with a POS (positive edge-detector) to detect only the first time the comparison comes true. That will ensure that you will enable the required action only once, when the comparator becomes true.

Hope this helps,
Daniel Chartier
 
Taz

Don't think of OB10 doing the 'activating' of the valve. You need this valve to be controlled by the PLC at all times of the day and night. Putting the 'activation' logic inside a block which, as Daniel explained, is only executed for a few microseconds is clearly (on second thoughts, if it was clear we wouldn't have this thread!) well anyway it's not going to achieve what you want.

Write your control logic for the valve (to open it, to close it etc - what exactly does 'activate' mean?) in an FC that is ultimately called from OB1. Call the FC whatever you want - FC99. This way the valve is continuously controlled. You should write this logic such that it includes a bit, say M99.0, to represent a 'request to activate' from anywhere else in the PLC. It should also include a 1 hour-timer, and some logic to turn the 'request to activate' bit false.

Now, in your OB10, you write some checking logic. Is your temperature less than the desired value. If it is, set the 'request to activate' bit true. End. That's all you want OB10 to do. Decide whether the valve needs to be activated. Nothing else.

A few microseconds after OB10 has executed, every other OB, FC, FB in the PLC which is checking the 'request to activate' bit now knows whether M99.0 it is true or false and can react accordingly. If it's true, FC99 activates the valve, starts the 1 hour timer and then after 1 hour sets M99.0 false again. One day later OB10 does it's checking task again and send the appropriate message to FC99 via M99.0

It is absolutely standard practice to set a bit true in one part of logic and set it false elsewhere provided the two bits of logic are never in competition and can produce an unpredictable result.
 
Hello,,
Daniel i will try the MImic TOD and let you know if im having any trouble.. i will also try the method krk gave me and choose the optimum one...

Can someone explain to me, when i have written sme condition to set M0.0 in my OB10 and make this memory bit to activate an output in my FC1, it fails i.e my M0.0 is sen activated but not my output although the FC1 is being called continuosly in my OB1.... But if me using M100.0 in OB10 instead of M0.0, the output is activated... why??????

Ken i have tried what you told me, it work but not with M0.0 instead with M100.0 its OK!! now when i want to reset this memory in OB10 itself i cannot do it. it remains set ..!!!!

I will try to reset this memory elsewhere as you said and see what the result..!!!!
 
Hello taz3m;

Can someone explain to me, when i have written sme condition to set M0.0 in my OB10 and make this memory bit to activate an output in my FC1, it fails i.e my M0.0 is sen activated but not my output although the FC1 is being called continuosly in my OB1.... But if me using M100.0 in OB10 instead of M0.0, the output is activated... why??????
It will stay set only if another piece of logic is writing a 1 to the bit continuously... I would check the cross-reference for this address (M0.0, MB0, MW0, MD0) to see if anything is writing a value to the register
Hope thia helps,
Daniel Chartier
 
Hello,
Ken,.. Daniel, i can set and reset the memory in OB10 if i reset it elsewhere i.e. not in the OB10. It works,..

Daniel, i have tried the TOD mimic , and this is working beautifuly,.. thanks a lot...

Thanks to everybody....

Thanks again Daniel... It has truly Helped..

Taz...
 

Similar Topics

So what I thought would be simple has turned out not to be, or at least it hasn't become obvious enough to me yet. I have a DINT coming into a...
Replies
6
Views
3,998
Hello All, I've been challenged with a task, if possible. I have been asked by our engineer if the Panelview 800 controlling one of our machines...
Replies
1
Views
3,031
Hi, folks, how’s going? On our one production line, we use AB Logix5000 as main plc and others as slaves. We name slave plc program as...
Replies
2
Views
1,620
I have a system of about 16 PLC's all 90-30. I have a GE Proficy iFIX SCADA system two redundant I/O servers, a Terminal server (about 8 thin...
Replies
4
Views
2,446
So, in the example below, why is the first two numbers after the $ symbol considered control characters? I would think they should be converted...
Replies
3
Views
2,449
Back
Top Bottom