S7 FP in Function block problem

Miika

Member
Join Date
Aug 2004
Location
Etelä-Suomi
Posts
50
Hi guys,

I have a problem with one shot fp when using it in FB. Fp variable is declared as a stat variable. For some reason it isn't one shot. It stays in true condition fot the same time as the triggering bit. I tried to use temp variable also, but no result. With merker address it works fine, but is should be a variable.

I passed this problem by making the pulse manually with help pulse bit, but still wondering why the fp doesn't work. More confusing is the thing I have used stats as a fp in fb before, but now it doesn't work. Is it another siemens problem or is it just me.. ?

Thanks in advance!
 
I always do it like this

A sCondition
FP sHelpflag
= sOSP

sHelpflag is of static but is not the oneshot it self but the memory flag of the previous sCondition.

So sHelpflag is high when sCondition is high. sOSP is oneshot positive flank whn sCondition is on and sHelpflag is off.
 
Miika - If the one shot works with a marker but not with a static variable in an FB, there must be something wrong with your code and it is not a Siemens problem. Maybe the instance DB is out of date or you have an indirect addressing bug - there are quite few possibilities. If the static variable for the one-shot store is being overwritten then what else is being overwritten that you haven't found yet ? You must find out what is going on.
 

Similar Topics

I am using Codesys as my PLC Programmer. I use structured text as the language. I tried using a timer inside a function block and then mentioning...
Replies
2
Views
1,554
Hi, I have attached herewith one image which our programmer has been used in S7 1500 PLC. Now we need to use the same instructions in S7 1200 PLC...
Replies
4
Views
117
Please see attached file. I need this program in Function Block form but I am totally lost on this. Any help would be appreciated. Thanks!
Replies
8
Views
293
Hi! I am using a TM200CE40T PLC from Schneider to write data over Modbus. I have used Memory words (%MW) before using the Write variable...
Replies
1
Views
531
Hi folks. New to the forum, but been working with PLCs for several years now. Would like some advice on whether you would keep this logic, or...
Replies
9
Views
1,064
Back
Top Bottom