# \#structured-text

**URL:** https://community.br-automation.com/tag/structured-text/94.md

[Latest](https://community.br-automation.com/latest.md) · [Categories](https://community.br-automation.com/categories.md) · [Tags](https://community.br-automation.com/tags.md)

---

## [AS6 ST OOP – How to share a class across multiple programs?](https://community.br-automation.com/t/as6-st-oop-how-to-share-a-class-across-multiple-programs/12980)

<div class="topic-metadata">

**Author:** [@steve.guerin](https://community.br-automation.com/u/steve.guerin)\
**Replies:** 7\
**Last updated:** [October 15, 2026, 8:27am UTC](https://community.br-automation.com/t/as6-st-oop-how-to-share-a-class-across-multiple-programs/12980 "2026-10-15T08:27:47Z")

</div>

Hi everyone, I’m currently working with Automation Studio 6.7.1.5 and trying to understand how ST OOP classes can be shared across multiple programs within the same project. I would like to declare a class only once (f…

---

## [Is anyone already using ST\_OOP?](https://community.br-automation.com/t/is-anyone-already-using-st-oop/11968)

<div class="topic-metadata">

**Author:** [@Alexander\_Apos](https://community.br-automation.com/u/Alexander_Apos)\
**Replies:** 3\
**Last updated:** [September 14, 2026, 7:28am UTC](https://community.br-automation.com/t/is-anyone-already-using-st-oop/11968 "2026-09-14T07:28:47Z")

</div>

Hello, I´m new to AS6 and AS Code. In the past I used AS4.12 and Codesys with emphasis on OOP. I was wondering if anyone is already using ST\_OOP as the available functions are limited and in addition there are some hea…

---

## [Convert Integer to HEX string](https://community.br-automation.com/t/convert-integer-to-hex-string/895)

<div class="topic-metadata">

**Author:** [@maggejunior](https://community.br-automation.com/u/maggejunior)\
**Replies:** 7\
**Last updated:** [September 7, 2026, 12:35pm UTC](https://community.br-automation.com/t/convert-integer-to-hex-string/895 "2026-09-07T12:35:20Z")

</div>

What is the most elegant way to convert an integer variable to a string? The string should represent the value of the variable in hexadecimal format. The solution should be programmed in ST.

---

## [Reference Structured Text Question](https://community.br-automation.com/t/reference-structured-text-question/11541)

<div class="topic-metadata">

**Author:** [@martin.todorov](https://community.br-automation.com/u/martin.todorov)\
**Replies:** 1\
**Last updated:** [June 11, 2026, 4:13pm UTC](https://community.br-automation.com/t/reference-structured-text-question/11541 "2026-06-11T16:13:44Z")

</div>

Hello, I have a programming question. Let’s say I have a function block instance where, among the variables, I have a structured variable declared as VAR\_IN\_OUT. Example: fbMotor( … motorParameters := myMotorParame…

---

## [Check in ST if a REFERENCE is valid](https://community.br-automation.com/t/check-in-st-if-a-reference-is-valid/10901)

<div class="topic-metadata">

**Author:** [@Samuel](https://community.br-automation.com/u/Samuel)\
**Replies:** 2\
**Last updated:** [April 15, 2026, 11:58am UTC](https://community.br-automation.com/t/check-in-st-if-a-reference-is-valid/10901 "2026-04-15T11:58:27Z")

</div>

Hi Community, I have a project programmed in Structured Text. There I use the following line: DiagMC\_BR\_ShReadInfo\_0\[i\].Enable := NOT DiagMC\_BR\_ShReadInfo\_0\[i\].Error AND ShAxis\[i\].controlif \<\> 0; ShAxis/controlif is …

---

## [DRV\_mbus Slave Configuration – Using Multiple CS1030 Modules on X20CP0410](https://community.br-automation.com/t/drv-mbus-slave-configuration-using-multiple-cs1030-modules-on-x20cp0410/10690)

<div class="topic-metadata">

**Author:** [@frogman](https://community.br-automation.com/u/frogman)\
**Replies:** 2\
**Last updated:** [March 31, 2026, 6:19am UTC](https://community.br-automation.com/t/drv-mbus-slave-configuration-using-multiple-cs1030-modules-on-x20cp0410/10690 "2026-03-31T06:19:49Z")

</div>

Hello, community. I have a question about the DRV\_mbus slave. I am working on a setup where I have one X20CP0410 CPU with seven CS1030 modules installed, and I am writing a program so that each module functions as an in…

---

## [B&R Funktion BOOL\_TO\_STRING](https://community.br-automation.com/t/b-r-funktion-bool-to-string/10285)

<div class="topic-metadata">

**Author:** [@Ronny\_F](https://community.br-automation.com/u/Ronny_F)\
**Replies:** 8\
**Last updated:** [February 25, 2026, 5:03pm UTC](https://community.br-automation.com/t/b-r-funktion-bool-to-string/10285 "2026-02-25T17:03:20Z")

</div>

Hello everyone, I use the B&R function BOOL\_TO\_STRING to convert Boolean values into strings. Basically, this works perfectly. The generated string is then transferred to a JSON script and processed there. However, BOO…

---

## [Variable mapping](https://community.br-automation.com/t/variable-mapping/9156)

<div class="topic-metadata">

**Author:** [@Krishna\_Kumar\_Murali](https://community.br-automation.com/u/Krishna_Kumar_Murali)\
**Replies:** 1\
**Last updated:** [November 26, 2025, 2:40pm UTC](https://community.br-automation.com/t/variable-mapping/9156 "2025-11-26T14:40:07Z")

</div>

Hello, I am trying to turn on a gripper for my Delta robot. I am using X20DO6322 Output mdule. I mapped the gripper boolean variable with IO module. I created a global variable for Gripper on and off operation. Now when…

---

## [In userdefined Library , Function Block to Reset Variables to FALSE on Cold or Warm Restart in B&R Automation Studio](https://community.br-automation.com/t/in-userdefined-library-function-block-to-reset-variables-to-false-on-cold-or-warm-restart-in-b-r-automation-studio/8643)

<div class="topic-metadata">

**Author:** [@chandrasekhar.rk](https://community.br-automation.com/u/chandrasekhar.rk)\
**Replies:** 3\
**Last updated:** [October 22, 2025, 7:27am UTC](https://community.br-automation.com/t/in-userdefined-library-function-block-to-reset-variables-to-false-on-cold-or-warm-restart-in-b-r-automation-studio/8643 "2025-10-22T07:27:23Z")

</div>

Hi all, I’m looking for an example or best practice on how to implement in user defined Function Block (FB) in B&R Automation Studio (IEC 61131-3 Structured Text) that resets the selected BOOL variables to FALSE during …

---

## [Return operator in motion program actions](https://community.br-automation.com/t/return-operator-in-motion-program-actions/7087)

<div class="topic-metadata">

**Author:** [@mykalrudie](https://community.br-automation.com/u/mykalrudie)\
**Replies:** 8\
**Last updated:** [September 19, 2025, 6:35am UTC](https://community.br-automation.com/t/return-operator-in-motion-program-actions/7087 "2025-09-19T06:35:33Z")

</div>

I am writing a motion program with a \_MAIN program that calls an action named HARVEST. There is a conditional in the HARVEST action that if true I’d like to return back to the \_MAIN program before finishing the action. …

---

## [Use constant in enum](https://community.br-automation.com/t/use-constant-in-enum/7180)

<div class="topic-metadata">

**Author:** [@Paddern](https://community.br-automation.com/u/Paddern)\
**Replies:** 15\
**Last updated:** [July 23, 2025, 11:26am UTC](https://community.br-automation.com/t/use-constant-in-enum/7180 "2025-07-23T11:26:24Z")

</div>

Hello Community Is it possible to use a constant in an enumeration? Use Case: In a B&R library, constants are used for configuration for various input parameters. To standardize our internal function block, I would li…

---

## [Block comment shortcut in AS Code for ST program](https://community.br-automation.com/t/block-comment-shortcut-in-as-code-for-st-program/7500)

<div class="topic-metadata">

**Author:** [@jakub.krieger](https://community.br-automation.com/u/jakub.krieger)\
**Replies:** 2\
**Last updated:** [July 4, 2025, 1:02pm UTC](https://community.br-automation.com/t/block-comment-shortcut-in-as-code-for-st-program/7500 "2025-07-04T13:02:08Z")

</div>

Hello. How to add block comment in ST program in AS Code? Ctrl + / doesn’t work, the same is for Ctrl + K, Ctrl + C. Do you have any ideas?

---

## [Finding difference in Datastructures](https://community.br-automation.com/t/finding-difference-in-datastructures/7498)

<div class="topic-metadata">

**Author:** [@Niklas\_Richter](https://community.br-automation.com/u/Niklas_Richter)\
**Replies:** 1\
**Last updated:** [July 4, 2025, 6:22am UTC](https://community.br-automation.com/t/finding-difference-in-datastructures/7498 "2025-07-04T06:22:23Z")

</div>

Hello, i wan’t to check a data-structure for any difference. Let’s say i have two variable of the same datatype Variable 1: dummyStructure1.test1 := 2; dummyStructure1.test2 := 3; dummyStructure1.test3 := 4; Varia…

---

## [Converting a USINT to a Character](https://community.br-automation.com/t/converting-a-usint-to-a-character/7101)

<div class="topic-metadata">

**Author:** [@CJ\_Bienia](https://community.br-automation.com/u/CJ_Bienia)\
**Replies:** 5\
**Last updated:** [May 29, 2025, 11:57am UTC](https://community.br-automation.com/t/converting-a-usint-to-a-character/7101 "2025-05-29T11:57:01Z")

</div>

Does anyone know if there is a B&R Library that has a function in it to convert a USINT value to a Character value?

---

## [Specification of signed integer overflow/wraparound behavior](https://community.br-automation.com/t/specification-of-signed-integer-overflow-wraparound-behavior/6580)

<div class="topic-metadata">

**Author:** [@Lukas\_Kimme](https://community.br-automation.com/u/Lukas_Kimme)\
**Replies:** 12\
**Last updated:** [April 29, 2025, 1:31pm UTC](https://community.br-automation.com/t/specification-of-signed-integer-overflow-wraparound-behavior/6580 "2025-04-29T13:31:27Z")

</div>

Hi everyone, from C/C++ I’m used to signed integer overflows being undefined behavior. In “the (B&R) automation world” I got the impression that it is sometimes common to rely on a certain well-defined signed integer b…

---

## [How to dereference a pointer](https://community.br-automation.com/t/how-to-dereference-a-pointer/6740)

<div class="topic-metadata">

**Author:** [@Axel\_van\_Straaten](https://community.br-automation.com/u/Axel_van_Straaten)\
**Replies:** 2\
**Last updated:** [April 25, 2025, 9:25am UTC](https://community.br-automation.com/t/how-to-dereference-a-pointer/6740 "2025-04-25T09:25:16Z")

</div>

Hi B&R community I was wondering if there is a way to dereference a pointer value. the program that i have walks through an array filled with addresses of different output variables. When searching online the symbol ^ …

---

## [Binary Data not showing as ASCII data using ArEventLog library](https://community.br-automation.com/t/binary-data-not-showing-as-ascii-data-using-areventlog-library/6656)

<div class="topic-metadata">

**Author:** [@Axel\_van\_Straaten](https://community.br-automation.com/u/Axel_van_Straaten)\
**Replies:** 3\
**Last updated:** [April 18, 2025, 9:43am UTC](https://community.br-automation.com/t/binary-data-not-showing-as-ascii-data-using-areventlog-library/6656 "2025-04-18T09:43:29Z")

</div>

Hi B&R community I am working on creating a functionblock that logs a message in a custom log module. A message is created and logged in a module, a description in Binary Data is added to that log and all this is displ…

---

## [Alternative to Union from Codesys](https://community.br-automation.com/t/alternative-to-union-from-codesys/6150)

<div class="topic-metadata">

**Author:** [@Kili\_Theiler](https://community.br-automation.com/u/Kili_Theiler)\
**Replies:** 6\
**Last updated:** [March 12, 2025, 7:21am UTC](https://community.br-automation.com/t/alternative-to-union-from-codesys/6150 "2025-03-12T07:21:02Z")

</div>

Has B&R in Automation Studio with structured text something similar to Union from Codesys?

---

## [USB Printer](https://community.br-automation.com/t/usb-printer/3171)

<div class="topic-metadata">

**Author:** [@bhaglanid](https://community.br-automation.com/u/bhaglanid)\
**Replies:** 4\
**Last updated:** [March 11, 2025, 2:48pm UTC](https://community.br-automation.com/t/usb-printer/3171 "2025-03-11T14:48:32Z")

</div>

Hi, The requirement is to use USB printer with C70 and C80, which library should I use and what can be the flow for the same ? Your replies will really help me. Thanks

---

## [Checking for Null Pointers in IEC Functions and Function Blocks](https://community.br-automation.com/t/checking-for-null-pointers-in-iec-functions-and-function-blocks/5356)

<div class="topic-metadata">

**Author:** [@Stefan\_Hirschen](https://community.br-automation.com/u/Stefan_Hirschen)\
**Replies:** 5\
**Last updated:** [January 7, 2025, 9:21am UTC](https://community.br-automation.com/t/checking-for-null-pointers-in-iec-functions-and-function-blocks/5356 "2025-01-07T09:21:14Z")

</div>

In Automation Studio, there are several ways to pass pointers (or pointer-like references) to functions and function blocks. Below, I’ve compiled three common approaches, outlining their advantages and potential pitfalls…

---

## [TON Timer not Working](https://community.br-automation.com/t/ton-timer-not-working/4973)

<div class="topic-metadata">

**Author:** [@maxim.bozek](https://community.br-automation.com/u/maxim.bozek)\
**Replies:** 4\
**Last updated:** [November 20, 2024, 1:59pm UTC](https://community.br-automation.com/t/ton-timer-not-working/4973 "2024-11-20T13:59:36Z")

</div>

Hi, I got these 2 tasks in my project (these are running in parallel): First task: one that sends JSON formatted messages to AWS if connected to the internet. If not connected, the program will buffer these messages as…

---

## [Sysmac Studio conversion to Automation Studio](https://community.br-automation.com/t/sysmac-studio-conversion-to-automation-studio/4093)

<div class="topic-metadata">

**Author:** [@bart.harris](https://community.br-automation.com/u/bart.harris)\
**Replies:** 2\
**Last updated:** [November 1, 2024, 1:28pm UTC](https://community.br-automation.com/t/sysmac-studio-conversion-to-automation-studio/4093 "2024-11-01T13:28:28Z")

</div>

Hi, Has anyone got any experience converting a Omron Sysmac Studio project to Automations studio project. Is there an easy way or any advice on the best way of - Exporting and then importing the ST programs, Var and Type…

---

## [Debug editor/possibilities in Automation studio 4.9](https://community.br-automation.com/t/debug-editor-possibilities-in-automation-studio-4-9/3974)

<div class="topic-metadata">

**Author:** [@Estanislau\_2001](https://community.br-automation.com/u/Estanislau_2001)\
**Replies:** 2\
**Last updated:** [August 12, 2024, 7:50am UTC](https://community.br-automation.com/t/debug-editor-possibilities-in-automation-studio-4-9/3974 "2024-08-12T07:50:55Z")

</div>

Hello, I’m new to the B&R PLC code development area, I’ve always programmed in Siemens and AB, I’m having difficulty making a quick diagnosis of the logic. Is there any function that I can enable or any tips for having …

---

## [Limit use right () left () idea for expansion?](https://community.br-automation.com/t/limit-use-right-left-idea-for-expansion/4018)

<div class="topic-metadata">

**Author:** [@c580527](https://community.br-automation.com/u/c580527)\
**Replies:** 4\
**Last updated:** [September 14, 2024, 7:44am UTC](https://community.br-automation.com/t/limit-use-right-left-idea-for-expansion/4018 "2024-09-14T07:44:14Z")

</div>

i have this problem I have a string of 450 characters : ‘LINE1=1;COMMENT\_LINE1$nLINE2=2;COMMENT\_LINE2$nLINE3=3;COMMENTO\_LINE3$nLINEA 4=4;COMMENTO\_LINEA4$nLINEA 5=5;COMMENTO\_LINEA5$nLINEA 6=6;COMMENTO\_LINEA6$nLINEA 7=7;…

---

## [Creating local reference variables](https://community.br-automation.com/t/creating-local-reference-variables/3680)

<div class="topic-metadata">

**Author:** [@dfaustino](https://community.br-automation.com/u/dfaustino)\
**Replies:** 14\
**Last updated:** [September 2, 2024, 9:12am UTC](https://community.br-automation.com/t/creating-local-reference-variables/3680 "2024-09-02T09:12:06Z")

</div>

I am trying to create a local reference variable in my project but it will not allow me to do so. I get the message " Reference variables have to be declared local. Change file path or remove reference flag" . I am tr…

---

## [Converting custom Data Structure to String](https://community.br-automation.com/t/converting-custom-data-structure-to-string/3922)

<div class="topic-metadata">

**Author:** [@mateo.p](https://community.br-automation.com/u/mateo.p)\
**Replies:** 8\
**Last updated:** [August 6, 2024, 9:22am UTC](https://community.br-automation.com/t/converting-custom-data-structure-to-string/3922 "2024-08-06T09:22:14Z")

</div>

Struggling with finding a solution for converting this custom data\_type to a string: I need to convert them to create a valid send string for my connected sigmatek controllers. Any suggestions on how I could accompl…

---

## [I cannot reset multiple timers from one program](https://community.br-automation.com/t/i-cannot-reset-multiple-timers-from-one-program/3949)

<div class="topic-metadata">

**Author:** [@c601154](https://community.br-automation.com/u/c601154)\
**Replies:** 3\
**Last updated:** [August 1, 2024, 2:18pm UTC](https://community.br-automation.com/t/i-cannot-reset-multiple-timers-from-one-program/3949 "2024-08-01T14:18:37Z")

</div>

I have the following code: PROGRAM \_INIT (\* Insert code here \*) END\_PROGRAM PROGRAM \_CYCLIC (\* Insert code here \*) FOR i := 0 TO 11 DO IF i = 0 THEN Timers\_v\[i\].IN := TRUE; ELSE Timers\_v\[i\].IN := Timers\_v\[i-1\].…

---

## [Simple program with one second delay](https://community.br-automation.com/t/simple-program-with-one-second-delay/3942)

<div class="topic-metadata">

**Author:** [@c601154](https://community.br-automation.com/u/c601154)\
**Replies:** 7\
**Last updated:** [August 1, 2024, 12:48pm UTC](https://community.br-automation.com/t/simple-program-with-one-second-delay/3942 "2024-08-01T12:48:09Z")

</div>

Hello! I want to make a simple program that turns on all the LEDs on a digital output with a delay of one second, but I’m having problems creating the delay, in the attached pictures I’ll show you how I tried to do it. …

---

## [Line return, with STRING variable](https://community.br-automation.com/t/line-return-with-string-variable/3558)

<div class="topic-metadata">

**Author:** [@c593065](https://community.br-automation.com/u/c593065)\
**Replies:** 4\
**Last updated:** [July 26, 2024, 12:17pm UTC](https://community.br-automation.com/t/line-return-with-string-variable/3558 "2024-07-26T12:17:27Z")

</div>

Hi, Is it possible to return to the line in a STRING or WSTRING type variable, in structured text. I tried a lot of things: \\n, $n, |, etc… Nothing seems to work

---

## [HEX decimal data points to decimal](https://community.br-automation.com/t/hex-decimal-data-points-to-decimal/3500)

<div class="topic-metadata">

**Author:** [@abhai.dhatavkar](https://community.br-automation.com/u/abhai.dhatavkar)\
**Replies:** 1\
**Last updated:** [June 12, 2024, 9:04am UTC](https://community.br-automation.com/t/hex-decimal-data-points-to-decimal/3500 "2024-06-12T09:04:22Z")

</div>

In Modbus protocol, we need to read two HEX decimal data points and convert them to decimal. Which function code should be used for the conversion? We need to write a 32-bit (data type: REAL) register address fr…

[Next page](https://community.br-automation.com/tag/structured-text/94.md?match_all_tags=true&page=1&tags%5B%5D=structured-text)
