Template Logic for Counting Contactor Switching Times-Step 7

Jethro Baidoo

Member
Join Date
Jun 2015
Location
Accra
Posts
35
Hi All,
I need to count my Contactor switching times. There are lots of them so I created a template logic with local variables in FC2000. Now I call FC2000 in FC2001 for each Contactor but the logic does not work. Is there anything I am missing?
I used positive edge, move, and add instructions.
 
1) Where are the declarations for CounterValue1, CounterValue1_1, and CounterValue2? Are they in TEMP or OUT or somewhere else?

2) The reset logic probably does not need to MOVE a 0 into CounterValue1_1.

2.1) I think if you use L#1 as the IN_1 parameter of the ADD_DI, then the MOVE and I_DI instructions on Network 1 can also be removed.
 
Kindly fine-tune the template for me.
I have attached the logic.
I tried without the variables and it works perfectly.
I still do not understand why it does not work when it is called.
 
I don't have Step 7 software, so I cannot open the files in that attachment. Screenshots and/or PDFs should be good enough.

But to make any progress, we need to know where those variables/tags are declared. I assume they are DINTs, but are they outputs, temporary storage, or what?

It seems to me that, for each contactor, three IN/INOUT/OUT tags need to be processed by the FC and correspond to FC-external tags:

  • CounterbitDB: IN tag; BOOL; presumably a contactor input, to control when the FC block increments the count
  • ResetbitDB: IN tag; BOOL; presumably a bit which is 1 to tell the FC block when to reset the count,
  • CounterValue2: INOUT tag; DINT; an accumulating count of the number of contactor switching events since the last reset, and is to be first input by the FC block, optionally modified by the FC block, and finally output by the FC block.
    • To be both input and output by the FC block, the simplest solution would be to define CounterValue2 as an INOUT parameter.
      • There could also be an IN tag CounterValue2_IN and an OUT tag CounterValue2_OUT, where the sum of L#1 and CounterValue2_IN is written to CounterValue2_OUT, and the same external tag used for both IN and OUT parameters.
 
Kindly fine-tune the template for me.
I have attached the logic.
I tried without the variables and it works perfectly.
I still do not understand why it does not work when it is called.




Without looking step project.


It is FC block and there is no in/out variables.


As dirtboy asked are your counters on temps?


if temp variables are used then it won't work never. Temp variables are replaced every scan so you can't use them for keeping data from previous program scans.


Change your code to use in/outs on FC or use FB block with stat or in/out area. Then it will work.
 
Hello Everyone,

Thanks for the ideas.

I've now got it working. Issue was with the IN/Out declarations.

Also I used L#1 and ADD_DI block.

Thanks so much.
 

Similar Topics

Can anyone suggest an available template to graph a flow chart that might be used to "back engineer an existing ladder project? I'm looking on...
Replies
7
Views
2,279
Hi all, Another (hopefully basic) Wonderware question. Once again, I have a template called, say, $Tank. $Tank has an attribute Number...
Replies
5
Views
813
Hello, I'm new to AutoCAD and had some questions. If I make a border at roughly 8"x11" or something like that... How do I insert something that...
Replies
11
Views
3,335
Hello, I'm using Factory Talk View SE. I have a Trend display with few Push button to invoke different trend templates. Let's say this display...
Replies
5
Views
2,910
Hi, Does anyone know if there is a "OEE" template availble for Intouch? Instead of building it up from scratch, I thought it was worth a shot...
Replies
0
Views
1,175
Back
Top Bottom