You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old April 11th, 2006, 02:18 AM   #1
STL???
Member
United Kingdom

STL??? is offline
 
Join Date: Sep 2005
Location: UK
Posts: 867
S7: SFC36 "MASK FLT" Help!!

Hi,
I've not come across this SFC before and the S7 Help file has left me confused also, In the code snippet below SFC36,37,38 are called every scan and i was wondering how it is applied, ie does it mask the value in the accumulator, DB??

I've attached the network in question below, a OPN DB statement is on the network before this.




AN "TRANS-BEGINN"
S "TRANS-BEGINN"
A "TRANS-ENDE"
R "TRANS-ENDE"
AN #Stat_Approval
JC M004
L "SBNR"
T DBW 24
T #TEMP36
CALL "MSK_FLT"
PRGFLT_SET_MASK:=DW#16#10000000
ACCFLT_SET_MASK:=DW#16#0
RET_VAL :=#TEMP37
PRGFLT_MASKED :=#TEMP38
ACCFLT_MASKED :=#TEMP39


UC FC [#TEMP36] // 101 or 102
CALL "READ_ERR"
PRGFLT_QUERY:=DW#16#10000000
ACCFLT_QUERY:=DW#16#0
RET_VAL :=#TEMP43
PRGFLT_CLR :=#TEMP44
ACCFLT_CLR :=#TEMP45
L #TEMP44
L DW#16#10000000
==D
S #IO32
CALL "DMSK_FLT"
PRGFLT_RESET_MASK:=DW#16#10000000
ACCFLT_RESET_MASK:=DW#16#0
RET_VAL :=#TEMP40
PRGFLT_MASKED :=#TEMP41
ACCFLT_MASKED :=#TEMP42
M004: NOP 0
AN #IO32
A #Stat_Approval
= #OUT24
A "TRANS-ENDE"
CC "SEQ STEP GENERATION"
NOP 0




The DB referenced is 1136 bytes long offline could this be the cause of this work around?

Any advice on this would greatly be appreiciated

Thanks
STL
  Reply With Quote
Old April 11th, 2006, 06:27 AM   #2
SimonGoldsworthy
Member
United Kingdom

SimonGoldsworthy is offline
 
SimonGoldsworthy's Avatar
 
Join Date: Mar 2005
Location: England
Posts: 1,079
This code is masking the "Called function (FC) does not exist" error (Bit 28 in the error mask). The "SBNR" variable selects which FC will be called, and, as the "Called FC does not not exist" error has been masked it will not stop the PLC or cause the error OB to be run if "SBNR" contains a non valid FC number. Hope this helps.
  Reply With Quote
Old April 11th, 2006, 07:14 AM   #3
STL???
Member
United Kingdom

STL??? is offline
 
Join Date: Sep 2005
Location: UK
Posts: 867
Thumbs up Great Stuff

Thanks yet again Simon!

Quote:
"Called FC does not not exist" error has been masked it will not stop the PLC or cause the error OB to be run if "SBNR" contains a non valid FC number.
This makes perfect sense as the Station number (1-4) is passed via HMI, then 100 is added to call either FC101/102. If 3 or 4 is selected IO32 is set which is a station Error message.

Quote:
This code is masking the "Called function (FC) does not exist" error (Bit 28 in the error mask)
Just one more question well two, where did you find that bit related info?
and in theory if i disable selection, via the hmi - which never changes anyway, i can bin all of this?

Once again Simon - Thanks
  Reply With Quote
Old April 11th, 2006, 07:40 AM   #4
SimonGoldsworthy
Member
United Kingdom

SimonGoldsworthy is offline
 
SimonGoldsworthy's Avatar
 
Join Date: Mar 2005
Location: England
Posts: 1,079
I did an F1 when the cursor was on the call to the SFC, then I took a green hyperlink to "Masking Synchronous Errors" which shows you the bit layout. It is also in Berger's book.

Yes you could disable it and replace it with calls to FC101 and FC102 which are enabled with a simple compare. (FC101 and FC102 will now appear in the xref as well)
  Reply With Quote
Old April 11th, 2006, 07:44 AM   #5
STL???
Member
United Kingdom

STL??? is offline
 
Join Date: Sep 2005
Location: UK
Posts: 867
OK Managed to get my STL berger book back at last! and it has the following:

BIT 28 B#16#3C - called function (FC) doesn't exist

But the PRGFLT_SET_MASK in SFC36 is DW#16#10000000, isnt that 40hex?
  Reply With Quote
Old April 11th, 2006, 07:53 AM   #6
SimonGoldsworthy
Member
United Kingdom

SimonGoldsworthy is offline
 
SimonGoldsworthy's Avatar
 
Join Date: Mar 2005
Location: England
Posts: 1,079
Amazing, I made the same mistake and thought the mask was binary until I noticed it is DW#16#10000000
  Reply With Quote
Old April 11th, 2006, 08:09 AM   #7
STL???
Member
United Kingdom

STL??? is offline
 
Join Date: Sep 2005
Location: UK
Posts: 867
Whooops,I mean 80hex - Can't seem to find anything relevant to this value?

I'm not at work until later, so ill remove the code and see what the diagnostic buffer brings up if anything!

Regards
  Reply With Quote
Old April 11th, 2006, 08:20 AM   #8
SimonGoldsworthy
Member
United Kingdom

SimonGoldsworthy is offline
 
SimonGoldsworthy's Avatar
 
Join Date: Mar 2005
Location: England
Posts: 1,079
DW#16#10000000 is 10000000 Hex
  Reply With Quote
Old April 11th, 2006, 08:27 AM   #9
STL???
Member
United Kingdom

STL??? is offline
 
Join Date: Sep 2005
Location: UK
Posts: 867
Thanks for clearing that up ! Hopefully i will have answers to this tomorrow.

Regards
  Reply With Quote
Old April 12th, 2006, 12:55 AM   #10
STL???
Member
United Kingdom

STL??? is offline
 
Join Date: Sep 2005
Location: UK
Posts: 867
Hi Simon,
i removed the SFC logic from the code and entered a value out of range to cause an Error. Sure enough the PLC went into stop and was asking for OB121,the Diagnostic buffer revealed the cause of the stop was a FC not loaded as you suggested, strange one though with the Mask value?

Scrapped the code now and replaced with a Integer compare!

Anyway thanks again for your Help
  Reply With Quote
Old April 12th, 2006, 02:09 AM   #11
krk
Lifetime Supporting Member
England

krk is offline
 
Join Date: Aug 2004
Location: Kent
Posts: 757
Quote:
Originally Posted by STL???
strange one though with the Mask value?
Nope... as Simon stated:

DW#16#10000000 (HEX) = 2#0001_0000_0000_0000_0000_0000_0000_0000 (BIN)

...which is bit 28 set.

The B#16#3C in the Berger book to the right of bit 28 is the error code returned for this fault.
  Reply With Quote
Old April 12th, 2006, 02:30 AM   #12
STL???
Member
United Kingdom

STL??? is offline
 
Join Date: Sep 2005
Location: UK
Posts: 867
Hi KRK,
Thanks for the clear explanation, For beginners such as myself silly little things like this are invaluable!

Regards
STL
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
COnverting S5 Real (KG) to S7 Real smersh LIVE PLC Questions And Answers 9 August 8th, 2011 09:53 AM
Siemens S5 and S7 Dual Masters for Profibus daveswerld LIVE PLC Questions And Answers 15 December 16th, 2008 02:15 AM
MPI comunication Manuel Raposo LIVE PLC Questions And Answers 22 July 16th, 2007 06:24 AM
S7 IEC timer - RESET functionality. JesperMP LIVE PLC Questions And Answers 6 May 28th, 2004 03:26 AM
Siemens S7 ethernet protocol fzhang LIVE PLC Questions And Answers 3 May 19th, 2004 12:06 PM


All times are GMT -5. The time now is 05:16 PM.


.