Working with both data dictionary and base workspace

Hi!

I am trying to build code for my PLC from Simulink model which uses both data dictionary and base workspace. It simulates fine in Simulink.
But upon building code, I get an error complaining about missing variable in the data dictionary, but it is defined in the base workspace.
image

Do B&R blocks have certain priority for data dictionary over base workspace if they find it linked to the model? Any suggestions on how to fix this?

Thanks

Hej Akash - first of all, welcome to the B&R Community. You can definitely use both data defined in a data dictionary or in the base workspace. After you add a data dictionary to your model, you might have to ensure that the checkbox “Enable dictionary access to base workspace” is checked:

How is the variable sampleTime used in your model? What version of AS Target for Simulink are you using?

Hi Daniel! Thanks for the reply! Your suggestion solved my issue.

The variable sampleTime is being used to pass the value for Fixed-step size for solver options

And the AS target version is 6.8.0