S7: SFC36 "MASK FLT" Help!!

STL???

Member
Join Date
Sep 2005
Location
UK
Posts
879
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
 
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.
 
Great Stuff

Thanks yet again Simon!

"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.

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
 
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)
 
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?
 
:sick: 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
 
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
 
STL??? said:
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.
 
Hi KRK,
Thanks for the clear explanation, For beginners such as myself silly little things like this are invaluable!

Regards
STL
 
I haven't understood function SFC36 , SFC58, SFC59
I have program STL ..i want to ask
can convert program STL to ladder if program like this :
[FONT=&quot]AN #TEMP17[/FONT]
[FONT=&quot] JNB M011[/FONT]
[FONT=&quot] CALL "MSK_FLT"[/FONT]
[FONT=&quot] PRGFLT_SET_MASK:=DW#16#FFFFFFFF[/FONT]
[FONT=&quot] ACCFLT_SET_MASK:=DW#16#0[/FONT]
[FONT=&quot] RET_VAL :=#TEMP18[/FONT]
[FONT=&quot] PRGFLT_MASKED :=#TEMP19[/FONT]
[FONT=&quot] ACCFLT_MASKED :=#TEMP20[/FONT]
[FONT=&quot]M011: A BR[/FONT]
[FONT=&quot] S #TEMP17[/FONT]
[FONT=&quot] AN #STAT13[/FONT]
[FONT=&quot] JC M00e[/FONT]
[FONT=&quot] R #IN0[/FONT]
[FONT=&quot] S #IN1[/FONT]
[FONT=&quot] CALL FB 2 , DB2[/FONT]
[FONT=&quot] IN0 :=#IN0[/FONT]
[FONT=&quot] IN1 :=#IN1[/FONT]
[FONT=&quot] IN2 :=#IN2[/FONT]
[FONT=&quot] IN3 :=#IN3[/FONT]
[FONT=&quot] IN4 :=#IN4[/FONT]
[FONT=&quot] OUT5:=#TEMP16[/FONT]
[FONT=&quot] OUT6:=#OUT8[/FONT]
[FONT=&quot] OUT7:=#OUT9[/FONT]
[FONT=&quot] OUT8:=#OUT10[/FONT]
[FONT=&quot] AN #TEMP16[/FONT]
[FONT=&quot] JC M003[/FONT]
[FONT=&quot] S #IN0[/FONT]
[FONT=&quot] R #IN1[/FONT]
[FONT=&quot] R #STAT13[/FONT]
[FONT=&quot] JU M003[/FONT]
[FONT=&quot]M00e: AN #STAT14[/FONT]
[FONT=&quot] JC M00f[/FONT]
[FONT=&quot] R #TEMP30[/FONT]
[FONT=&quot] S #IN5[/FONT]
[FONT=&quot] CALL FB 3 , DB3[/FONT]
[FONT=&quot] IN0 :=#TEMP30[/FONT]
[FONT=&quot] IN1 :=#IN5[/FONT]
[FONT=&quot] IN2 :=#IN2[/FONT]
[FONT=&quot] IN3 :=#IN6[/FONT]
[FONT=&quot] IN4 :=#TEMP33[/FONT]
[FONT=&quot] IN5 :=#TEMP32[/FONT]
[FONT=&quot] OUT6:=#TEMP36[/FONT]
[FONT=&quot] OUT7:=#OUT11[/FONT]
[FONT=&quot] OUT8:=#OUT12[/FONT]
[FONT=&quot] AN #TEMP36[/FONT]
[FONT=&quot] JC M003[/FONT]
[FONT=&quot] R #IN5[/FONT]
[FONT=&quot] R #STAT14[/FONT]
[FONT=&quot] JU M003[/FONT]
[FONT=&quot]M00f: CALL FB 2 , DB2[/FONT]
[FONT=&quot] IN0 :=#IN0[/FONT]
[FONT=&quot] IN1 :=#IN1[/FONT]
[FONT=&quot] IN2 :=#IN2[/FONT]
[FONT=&quot] IN3 :=#IN3[/FONT]
[FONT=&quot] IN4 :=#IN4[/FONT]
[FONT=&quot] OUT5:=#TEMP16[/FONT]
[FONT=&quot] OUT6:=#OUT8[/FONT]
[FONT=&quot] OUT7:=#OUT9[/FONT]
[FONT=&quot] OUT8:=#OUT10[/FONT]

Best Regard
Teguh Haryono
 

Similar Topics

I have a program that I've used 100 times. SQO settings: File N7:0, Mask 0FFFFh, Dest B3:1, Control R6:0, Length 8, Pos 2. Length & Position...
Replies
48
Views
943
Hi. Rockwell learning curve 132-1b. I was having trouble to change IP address on a EN2TR. Finally found out that I need to change the IP...
Replies
1
Views
746
I am working with a 1768-ENBT and I was able to connect to it through my laptop. My laptop IP is 192.168.1.10 subnet 255.255.255.0 and the PLC...
Replies
12
Views
1,554
Hi there, I'm trying to perform a mask move operation in RSlogix 500 using the S2(Status) so that it will be easier to transfer them to our SCADA...
Replies
6
Views
2,650
I could not connect to or PLC over or network so I checked and the IP address is correct, but the subnet and gateway are incorrect. It has a...
Replies
2
Views
1,983
Back
Top Bottom