Timing Freelance Programs

Hello everyone,

what would be the preferred way to time Freelance programs?

My setup is the following: I'm testing numerical routines for model-based control written in SCL on an Emulator and an AC 800F (16 MB). There are multiple vector/matrix calculations involved as well as square roots. I'd like to obtain an indicator for system load/reserves as well as how well the algorithm scales when computing multiple control loops.

In common PC-based high-level languages, I'd use a timing command offered by the OS, or compare the system timer before and after the routine in question. In Freelance, alas, I cannot seem to obtain <RES>.DateTime from SCL for syntax reasons, and even if I could, I'm not sure if it yielded meaningful values even if I accessed it directly (i.e. not over process image/without "@").

Thanks for any hints or insights,

best regards

Björn


Add New Comment


b.schliessmann   

asked 1 month ago
Closed



Best Answer

1

Hello Björn,

using <RES>.DateTime on the AC800F should be fine for your purpose if you use it with and without Process image at appropriate times. You can convert it to something you can handle or can convert the difference.

On the AC800F you can observe the CPU load changes with and without your calculation task running.

I am not sure about the resolution right now, but I think it is not bigger than 5ms.

On the diagnostic web page there is a task scheduling summary, giving min/average/max execution times. Redundant controllers give different results for redundant tasks.

It is possible to control the priority of multiple application tasks, but most system tasks have higher priority.

If Emulator means Freelance emulator, it is more difficult. In current versions the DateTime variable is updated twice a second or so. Function blocks like M_GEN or TREND will have a better time, but I just have no idea how to access it in the controller. It would be possible to evaluate the trend archive offline or to have an OPC alarm client tracking the MGEN alarms.

Best regards

Jürgen

JuergenV   

answered 1 month ago


 


By JuergenV on 8/15/2017 | Like (1) | Report

There is an internal function block library for this type of measurements that has a resolution of one microsecond. It is even possible to measure with disabled interrupts. Maybe it is possible that you get access to this lib on an exceptional base on request.
Best regards
Jürgen


By b.schliessmann on 8/17/2017 | Like (0) | Report

Hello Jürgen,

thank you very much for your suggestions. A 5 ms resolution should suffice for now, I think. Even though I don't need it (yet), the microsecond resolution sounds tempting; whom would I contact about this -- ABB technical support?

Indeed I mean the Freelance Emulator. But that's not a real problem, we've got a spare AC 800F with a 230 V power supply that I probably could use.

I recognised my syntax error: I tried to use a ressource variable directly from inside a SCL UFB. I suppose I can use the DateTime variable in the proposed way if I attach it to a UFB input using direct access (i.e. without "@"). With my high-level language background, I implicitly assumed SCL UFBs to be call-by-value functions which doesn't seem to be true. Am I correct?

By the way, is it possible that in the emulator, the cycle time monitoring doesn't really work? I've enabled "Alarm on overload" (analogously) for a task to test the function, but the alarm didn't fire even with an endless loop inside the task. (The next load however caused a timeout error which stopped the emulated controller.)

Thanks and best regards


Björn


By JuergenV on 8/17/2017 | Like (1) | Report

The variable access should work identically inside UFBs. The UFBs work like macros, the content is expanded internally.
Overload detection is done by the task itself at the time it starts the next execution in the cycle. Maybe the "overload" term is a bit misleading. The overload indicates that the task executes too late considering the configured cycle mode which is an overload indicator for the whole configuration in the current application state.


By b.schliessmann on 8/18/2017 | Like (0) | Report

Makes perfect sense, thanks for clarification!


Add New Comment


Answers

1

Hello Björn,

using <RES>.DateTime on the AC800F should be fine for your purpose if you use it with and without Process image at appropriate times. You can convert it to something you can handle or can convert the difference.

On the AC800F you can observe the CPU load changes with and without your calculation task running.

I am not sure about the resolution right now, but I think it is not bigger than 5ms.

On the diagnostic web page there is a task scheduling summary, giving min/average/max execution times. Redundant controllers give different results for redundant tasks.

It is possible to control the priority of multiple application tasks, but most system tasks have higher priority.

If Emulator means Freelance emulator, it is more difficult. In current versions the DateTime variable is updated twice a second or so. Function blocks like M_GEN or TREND will have a better time, but I just have no idea how to access it in the controller. It would be possible to evaluate the trend archive offline or to have an OPC alarm client tracking the MGEN alarms.

Best regards

Jürgen

JuergenV   

answered 1 month ago


 


By JuergenV on 8/15/2017 | Like (1) | Report

There is an internal function block library for this type of measurements that has a resolution of one microsecond. It is even possible to measure with disabled interrupts. Maybe it is possible that you get access to this lib on an exceptional base on request.
Best regards
Jürgen


By b.schliessmann on 8/17/2017 | Like (0) | Report

Hello Jürgen,

thank you very much for your suggestions. A 5 ms resolution should suffice for now, I think. Even though I don't need it (yet), the microsecond resolution sounds tempting; whom would I contact about this -- ABB technical support?

Indeed I mean the Freelance Emulator. But that's not a real problem, we've got a spare AC 800F with a 230 V power supply that I probably could use.

I recognised my syntax error: I tried to use a ressource variable directly from inside a SCL UFB. I suppose I can use the DateTime variable in the proposed way if I attach it to a UFB input using direct access (i.e. without "@"). With my high-level language background, I implicitly assumed SCL UFBs to be call-by-value functions which doesn't seem to be true. Am I correct?

By the way, is it possible that in the emulator, the cycle time monitoring doesn't really work? I've enabled "Alarm on overload" (analogously) for a task to test the function, but the alarm didn't fire even with an endless loop inside the task. (The next load however caused a timeout error which stopped the emulated controller.)

Thanks and best regards


Björn


By JuergenV on 8/17/2017 | Like (1) | Report

The variable access should work identically inside UFBs. The UFBs work like macros, the content is expanded internally.
Overload detection is done by the task itself at the time it starts the next execution in the cycle. Maybe the "overload" term is a bit misleading. The overload indicates that the task executes too late considering the configured cycle mode which is an overload indicator for the whole configuration in the current application state.


By b.schliessmann on 8/18/2017 | Like (0) | Report

Makes perfect sense, thanks for clarification!


Add New Comment



Get weekly AKS updates


Partner Exclusive Webinars

 

> – Login to the partner portal to register



Points Redemption Program - Redeem your points for ABB training, Bluetooth speakers and mugs. Terms and conditions >


Earn points when you refer a friend
AKS Referral Program is "Live" - Learn more



AKS Experts


avatar
Ask Stefan Stromqvist   

Rank: 1

I joined ABB in the year of 1994 and has since 1999 been working as a Service & Support Engineer at BU Control Technologies in Västerås, Sweden. My areas of expertise are: 800xA Base, 800xA for Advant Master, Information Management, operating systems, RNRP and Ethernet comms/networking in general.


avatar
Ask Flavio Mussolin   

Rank: 5

ABB AVP, Senior Electronic and Automation Engineer with over 30 years of experience in the field of process automation automotive, pharmaceutical, hollow glass, steel and rolling.


avatar
Ask MMM   

Rank: 4

ABB PA CT Technical Support


avatar
Ask nikismith   

Rank: 260

I have been a part of the Recording & Control Factory team for 17 years in total, having spent a number of years as a repairs technician withi the manufacturing department, but being in my current role for 9 years now.


avatar
Ask Govindaraj   

Rank: 10

Working in ABB India Operation Center. Have Project engineering and commissioning experience in ABB 800xA, Freelance, AC500.


avatar
Ask Dieter Henkel   

Rank: 24


avatar
Ask Rob Lyon   

Rank: 3

info@lymac.co.nz I'm an independent DCS software and commissioning engineer with extensive experience in 800xA and other ABB products. I've worked in almost every corner of the world and still haven't seen it all.


avatar
Ask kstoilov   

Rank: 21

Control System Engineer: 800xA, Compact 800, AC500, AC31-50, Advant Master, Simatic, AC&DC Drives 11 years worked for ABB - Control Systems


avatar
Ask Sumit Gargav   

Rank: 2

I have worked with Freelance in majority, with 800xA FD and Melody system partly. Also had opportunity to work with Protocols - HART,Profibus,FF & Modbus.


avatar
Ask Harsha.D   

Rank: 6

Tech.Support,software and commisioning engineer with Proficient knowledge in 800xA and its products, RNRP,Networking in general.