# Reference Structured Text Question

**URL:** <https://community.br-automation.com/t/reference-structured-text-question/11541>\
**Category:** Programming\
**Tags:** structured-text\
**Created:** [June 11, 2026, 3:02pm UTC](https://community.br-automation.com/t/reference-structured-text-question/11541 "2026-06-11T15:02:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin.todorov](https://avatars.discourse-cdn.com/v4/letter/m/FF8800/32.png) [@martin.todorov](https://community.br-automation.com/u/martin.todorov)\
**Post date:** [June 11, 2026, 3:02pm UTC](https://community.br-automation.com/t/reference-structured-text-question/11541/1 "2026-06-11T15:02:46Z")

</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 := myMotorParameters;  
…  
)

However, first I would like to set the reference of myMotorParameters to two different structured variables based on a Boolean condition.

Example:

IF cond THEN  
myMotorParameters := myMotorParameters1;  
ELSE  
myMotorParameters := myMotorParameters2;  
END\_IF;

If I try to declare myMotorParameters as a reference, the CPU goes into a page fault…  
So I wanted to ask what is the best way to handle this case?  
I’m not sure if I’ve explained myself clearly.  
The idea is that, based on the condition, the FB reads/writes one structure rather than the other.

Thank you.

---

<div class="post-metadata">

**Author:** ![Matt\_Buck](https://avatars.discourse-cdn.com/v4/letter/m/FF8800/32.png) [@Matt\_Buck](https://community.br-automation.com/u/Matt_Buck)\
**Post date:** [June 11, 2026, 4:13pm UTC](https://community.br-automation.com/t/reference-structured-text-question/11541/2 "2026-06-11T16:13:44Z")

</div>

the correct syntax to provide the address of what you are referencing to the access command.

myMotorParameters ACCESS ADR(myMotorParameters1);
