Making measuring insensitive to 5% of the input

juzeko

Member
Join Date
Jun 2008
Location
Vrbovec
Posts
47
I have one problem regarding the simatic s7-300 and step 7. I have 4 analog inputs of 0-20mA by which i am measuring the gas flow. When the valve is closed I still get some current so I need to make it insensitive to 5% of the input. Any elegant ideas, is there any block in library for it?
THX!
 
Here's a block that you can use to pre-process your PIW value and then pass the output on to FC105 via a temp variable.

Code:
FUNCTION FC 3 : VOID
TITLE =
VERSION : 0.1

VAR_INPUT
  iPIWValue : INT ; 
  iPerCentToIgnore : INT ; 
END_VAR
VAR_OUTPUT
  iPIWDesensitised : INT ; 
END_VAR
BEGIN
NETWORK
TITLE =
// If iPIWValue > (27648 * iPercenttoIgnore/100.0)
// then
//   iPIWDesensitised:=iPIWValue
// Else
//   iPIWDesensitised:=0
// Endif
//..
      L     #iPerCentToIgnore; 
      ITD   ; 
      DTR   ; 
      L     2.764800e+002; // 27648/100
      *R    ; 
      RND   ; 
      L     #iPIWValue; 
      <I    ; 
      JC    ok; 
      L     0; 
ok:   T     #iPIWDesensitised; 
      SET   ; 
      SAVE  ; 
END_FUNCTION
 

Similar Topics

Hi, I have seen a few post with similar topics and I have tried contacting the authors however I have not had any luck so I am posting this new...
Replies
14
Views
990
Hi everyone I've created an FC that includes the blocks TCON, TDISCON, TSEND and TRCV. This block has to be as generic as possible across...
Replies
15
Views
1,474
Hi all, I have been working on a tool for my company that handles a specific task our company runs into often related to PLC's. This is a tool I...
Replies
15
Views
2,867
Hi, i need to make: 1- A PLC Program on Omron PLC CP2E-N using high speed counter E6C3-AG5B 360P/R 2M(Absolute) ,to Reject bottles on Conveyor...
Replies
4
Views
858
I was taught to go to Combined > Make Change > go to Offline > will prompt to save > Save > Exit out of program > will prompt to save again >...
Replies
0
Views
676
Back
Top Bottom