Migrating a Siemens TIA Portal Project to B&R Automation Studio 6.x – FB Structure and Cyclic Program

Hi everyone,

I’m currently trying to transfer a project from Siemens TIA Portal to B&R Automation Studio 6.x, and I have a few questions regarding function block organization, variable scope, and program execution.

1. How should I structure and call function blocks in B&R?

In my TIA Portal project, I have several FBs, such as Robot, Robot_Input, and Robot_Output. These FBs are called from the Main block, which coordinates the overall program execution.

What would be the recommended way to implement a similar structure in B&R Automation Studio?

Specifically:

  • How should I organize these FBs and their associated variables in B&R?

  • What is the recommended approach for managing variable scope, such as global variables versus local variables or FB instance variables?

  • Should I create separate programs or function blocks for Robot, Robot_Input, and Robot_Output, and then call them from a main program? Or is there a more idiomatic B&R approach?

2. Execution order of programs within the same cyclic object

If I assign multiple programs containing _CYCLIC sections to the same cyclic object (for example, Cyclic #1), are these programs executed sequentially in a defined order during each cycle, or can they execute asynchronously or in parallel?

For example, if Robot_Input updates some variables and Robot reads those variables in the same cycle, can I rely on Robot_Input executing first, so that Robot reads the updated values?

If execution order is configurable, where can I configure or verify it in Automation Studio 6.x?

I would appreciate any recommendations, examples, or documentation for structuring a B&R project in a way that is conceptually similar to a typical Siemens TIA Portal project.

Thanks in advance for your help!

Hello Ha Dao;

Firstly, a warm welcome to B&R community.

Regarding the B&R structuring, the architecture depends on each preference and experience, B&R work with both structured text (ST) and ladder (LD) (and other languages). We usually recommend using ST. That said, Function block (FB) names alone really doesn’t really give away the scope of it’s function so it’s hard to recommend in your case (all three feels like it belongs to same module…). Usually in B&R each mechatronic module (axis, robot etc) is handled by an different task, and then a higher task manage them (ex: a task controlling a axis, then another controls a pump etc, then a global task controls those tasks to create the sequence).

If multiple tasks are in the same cycle time, then it’s run sequentially, from top to bottom, the variable that are modified in a higher task can be used in lower task (assuming those variables are global)

To configure the order in which those tasks run, you right click on the plc in the physical view, click on “software” and then drag and drop the task among the different cycle time

You can find quite a bit of online information on help, take a look on getting started here

That being said, I would highly recommend reaching out to your local office (Finland according to your profile) to see training options.

Wenbo Ruan

Best regards

Hi,
Thank you so much for your information.
I also have others questions about Sequential Function Chart. I am wondering if there is any way that I can directly assign variable to a value in the action step. For example, like what I
am doing in Tia Portal? For me, using a separate action file for each assignment like this is way too much.

image
And is it possible that in B&R to split the whole sequence into sub-sequences for the sake of readibility.
Thanks

Hi @harry what is status of your issue? can you update us?

Hi, my issues were mostly solved after receiving your asistance. Thanks you so much.