0

I need to access to a "combo box array" object's properties from my Main (PRG) on Codesys 3.5.8.

How can I do this?

Max Markson
  • 800
  • 1
  • 19
  • 34

2 Answers2

2

Unfortunately you can't access the combo box array properties directly. You are going to access them through the visualization. Since a visualization is like a FB (or class if you're from the object oriented world) you are going to have to create a visualization with input and output variables. Do this in the Interface Editor for the visualization. Use the input and output variables in the visualization for the properties you want to access (such as combo box arry properties). You then create another visualization and drag in the previous visualization (creating an instance of the visualization). You can then assign variables that are available to the Main program.

For example

//inputs 
VAR_INPUT
  number:INT;
  InGear:BOOL;
  InCam:BOOL;
END_VAR

//outputs
VAR_IN_OUT
   axisIndex:INT;
END_VAR

enter image description here

mrsargent
  • 2,267
  • 3
  • 19
  • 36
0

This depends on the property. If it is something like position for example, you may create variable in your program and set that variable in the property directly, just like you bind other properties. Thus you can work with that variable directly in the programm.

Sergey Romanov
  • 2,949
  • 4
  • 23
  • 38