Monitoring multi-instance FB in Step7 SCL

RollingPin

Member
Join Date
Feb 2008
Location
Bangalore
Posts
36
Hello All,
I have a problem wih monitoring variables when multiple instances of an FB are called within another FB in Step7 SCL.
1. I create FB61 using SCL.
2. I call this FB61 twice in FB62. FB62 is also written using SCL.
3. I create an instance DB62 for FB62 and call FB62.DB62() in OB33.

I would like to debug FB61. So I open FB61 in SCL and click on the monitor icon (goggles). I can see the variables for the first instance of FB61. How do I see the variables from the second instance of FB61?

I have hit a road bloack on this one. Any ideas?? I have fooled around with the "Call Environment Blocks" option. But could make no headway.
 
You can use the open data blocks check box in the call environment. You have to add some SCL code to refer to a different DB just prior to calling each instance.

scl009008.JPG
 
Hi LD,
You have lost me there. I tried exactly the same thing that you did and didn't get the same result.o_O Attached is the SCL source file. "Global" is DB1. I have used DB2 and DB3 only for the sake of triggering the monitor. When I call referring to DB2 or DB3, there is no monitor data. See below screenshot. When I refer to DB1, the monitor data for the first instance is displayed.
Env.jpg
I tried passing the DB2 and DB3 via the "Env" parameter of FB61 and then selective monitor works. But then, it would mean creating an Env parameter is all FBs only for the sake of fixing the monitoring call. That sounds quite stupid. Of course, the whole thing is stupid. SCL implementation in S7 is indeed primitive compared to ABB, Schneider UnityPro, CoDeSys, etc.
My SCL version is v5.3+SP5. I wonder if that is making a difference.
 
Parameters are passed to an FB by first copying them to the instance DB. Whatever DB was last opened before calling the FB will be the trigger DB for call up path monitoring - this will include global DB's in the parameter list.

Debug FB61 as a single instance, then when you are happy with it use it in multiple instances.
 
Hi LD,
I was surprised that I couldn't get the right FB61 on monitor when I tried your method of calling DB2 or DB3 just before FB61. It seemed to work for you. In the screenshot, I had selected FB61 and FB62. But that was a screenshot mistake. The actual situation is below.
Env.jpg

The actual FB in my project is quite complex and is well tested and working for long. The problem is that if something does not work right because the conditions are not right, the customer engineer sometimes needs to look into the code to figure out the missing condition. That becomes impossible unless there is an easy way of monitoring each instance independently. I prefer programming in Structure Text (SCL). But this problem in Step7-SCL sometimes gets customers arguing that SCL shouldn't be used.
 

Similar Topics

Hello everyone! I need to connect to a DL205-1 CPU and, as far as I know, I need to use DirectSOFT 6 software for the connection. Is anyone...
Replies
1
Views
67
Our punch press has a SLC500 with HELM weight module (HM-604-WM) for tonnage monitoring. The operator enters the weight range on the HMI, which is...
Replies
9
Views
207
Hello, I have been trying to figure out how to connect to and monitor a DLR that is on a remote rack from my PLC. The local has a 1756-L81E and...
Replies
0
Views
124
Good day, we have 15 analog inputs, we need to log the data in excel and monitor these values through web browser. We're planning to go with Delta...
Replies
1
Views
132
I have several plc’s that I’d like to monitor Into our SCADA when the comms break or plc faults. These are (SLC-505 & Compact Logic PLC’s) I...
Replies
6
Views
748
Back
Top Bottom