Sign in to follow this  
Followers 0
ex_ilustre

SFC51 - HOW?

9 posts in this topic

hello, Can somebody helo me with SFC51? I need to know what parameters are needed at the RET_VAL, BUSY, SZL_HEADER and DR(see attached file). I've seen the simatic help but can't understand,havent used to SFC's yet. What I want is to use the BATF of S7-300 to trigger a Memory address(M79) when there is a battery failure. You may send me bitmap/pic of the program similar to the attached file if you can. Thank you so much for your time. I_dont_know_this.bmp

Share this post


Link to post
Share on other sites
You can probably find answer somewhere from siemens knowledge base. There's some examples too, I think. http://support.automation.siemens.com/WW/l...&viewreg=WW

Share this post


Link to post
Share on other sites
Hi. Have you the sfc51 on S7 manager? focus on it and press F1 (help) Through the partial list with id # W SZL 16xy11 show the identification of a particular unit. The header of SZL SZL ID W # 16 # xy11 is structured as follows: etc.. Now in your Attached File, you ask to Cpu SZL_ID= 119. Why? 119 which Cpu you use. The Sfc51 is a function is strong. You must in input call which list and which index e it come back the Struct of list and PointerAny or Len of struct. If is the first time that you use it, is better monitor the retVal for help. Esemple: #INDEX = 1, #SZL_iD =W#16#692 Ask to cpu the state of node profibus It come bak ine struct of 16 Byte where the first 32 bit are the curret status Fault About the node profibus. Each list and each index return data and different struct. Bye

Share this post


Link to post
Share on other sites
hellow, Thank you for the quick reply jylilaht and GixRamones. Yes, I do have SFC51 on my S7 manager and I've already tried F1 help but can't really understand it all. I'ts supposed to be 19 and not 119..sori about that. I want to use the status of Module LED's. Its 19 I guess. I'm using CPU 315-2DP(6ES7 315-2AF02-0AB0). I want to use the Status of Module LED's specifically the BAF(Batt fault) thats why my index is W#16#0008.... but I dont know how to used the RET_VAL to turn a Memory address(M79) or an alarm. I also don't know what to put in BUSY, SZL_HEADER and DR. Does the SZL_ID different for every CPU type? I think I will need your example..because I will also use profibus..ET200M. Your reply is really helpful. Problem Summary: I want to use BATF,Profibus error..and all other possible basic hardware error.. using SFC51 to trigger an alarm. Example: 1.)When the battery is shorted or removed, BATF will cause an alarm to signify Batt error is occurring. 2.)When the profibus cable is accidentally cut or removed,.an alarm sound signifying there is error due to profibus cable. How do we deal with this.? Edited by ex_ilustre

Share this post


Link to post
Share on other sites
OB81 can be used to determine a battery has failed, it is called with fault ID B#16#21. For LED's: The SSL-ID of the partial system status list W#16#0019 Status of all LEDs W#16#0119 Status of one LED The reply is 4 bytes Name Length Meaning Index 1 word LED ID (only relevant for SSL-ID W#16#0119) W#16#0001: SF (group error) W#16#0002: INTF (internal error) W#16#0003: EXTF (external error) W#16#0004: RUN W#16#0005: STOP W#16#0006: FRCE (force) W#16#0007: CRST (restart) W#16#0008: BAF (battery fault/overload, short circuit of battery voltage on bus) W#16#0009: USR (user-defined) W#16#000A: USR1 (user-defined) W#16#000B: BUS1F (bus error interface 1) W#16#000C: BUS2F (bus error interface 2) W#16#000D: REDF (redundancy error) W#16#000E: MSTR (master) W#16#000F: RACK0 (rack number 0) W#16#0010: RACK1 (rack number 1) W#16#0011: RACK2 (rack number 2) W#16#0012: IFM1F (interface error interface module 1) W#16#0013: IFM2F (interface error interface module 2) led_on 1 byte Status of the LED: 0 : off 1 : on led_blink 1 byte Flashing status of the LED: 0: not flashing 1: flashing normally (2 Hz) 2: flashing slowly (0.5 Hz) This is all gleamed from the manual 'System Software for S7-300/400 System and Standard Functions' which can be downloaded from HERE <=== CLICK

Share this post


Link to post
Share on other sites
hello, I don't have problem with manuals. I just don't know how to use the RET_VAL of the SFC. About using OB81, how do I use the OB81_FLT_ID? Can you send me a program or bitmap using OB81 to detect batf? Thank you. Edited by ex_ilustre

Share this post


Link to post
Share on other sites
OB81 need only be present to be called, the status information is held in the TEMP area, so you would need to read the status and place information in your own memory addresses. The RET_VAL is an error message, it will only contain data if an error occured whilst calling SFC51. SFC51, the error codes, the SYS area description and OB81 are all described in detail in the manual I allured to earlier.

Share this post


Link to post
Share on other sites
The link you gave me sends me to a Product list and Order Number of Siemens product. I get the idea that in OB81, the status information is held in the TEMP area...but don't know how to read it. likewise in RET_VAL of SFC51...don't know how to read the data for usage. That's my problem. Can you please just send me an example program (or picture of the program) using OB81 or SFC51 to detect Battery Fault(BATF). thank you.

Share this post


Link to post
Share on other sites
The link takes you to Siemens support, download area, where you can get to the manuals. try this link which should go straight to the manual. http://support.automation.siemens.com/GB/l...amp;treeLang=en In OB81, you just load the fault word from the TEMPs ie L #OB81_FLT_ID now its in the accumulator. For SFC51 you create a TEMP Integer, call it whatever you like ie TMP_RET_VAL assign #TMP_RET_VAL to RET_VAL, then L #TMP_RET_VAL places that value in the accumulator and then check if its non zero.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0