![]() |
||
|
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
| ||
New Here? Please read this important info!!!
|
|
#1 |
|
Member
![]() 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.
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 |
|
|
|
#2 |
|
Member
|
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.
|
|
|
|
#3 | ||
|
Member
![]() Join Date: Sep 2005
Location: UK
Posts: 867
|
Thanks yet again Simon!
Quote:
Quote:
and in theory if i disable selection, via the hmi - which never changes anyway, i can bin all of this? Once again Simon - Thanks |
||
|
|
|
#4 |
|
Member
|
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) |
|
|
|
#5 |
|
Member
![]() 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? |
|
|
|
#6 |
|
Member
|
Amazing, I made the same mistake and thought the mask was binary until I noticed it is DW#16#10000000
|
|
|
|
#7 |
|
Member
![]() 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 |
|
|
|
#8 |
|
Member
|
DW#16#10000000 is 10000000 Hex
|
|
|
|
#9 |
|
Member
![]() Join Date: Sep 2005
Location: UK
Posts: 867
|
Thanks for clearing that up ! Hopefully i will have answers to this tomorrow.Regards |
|
|
|
#10 |
|
Member
![]() 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 |
|
|
|
#11 | |
|
Lifetime Supporting Member
![]() Join Date: Aug 2004
Location: Kent
Posts: 757
|
Quote:
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. |
|
|
|
|
#12 |
|
Member
![]() 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 |
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |