Home / FactoryTalk Optix / Optix for HMI
Description
Discover how to work with ComboBoxes in FactoryTalk Optix! It is easier than it seems at first sight. You don’t even have to use NetLogic and C# for basic aplications. Then link the seleccted value with your PLC Tag, to update the controller each time you change the selection.
Sample code can be found here:
https://github.com/xavierflorensa/FactoryTalk_Optix_ComboBox
Contributed by Xavier Florensa – YouTube – LinkedIn – GitHub
Transcript
(00:01) Hi everyone. In this video, I will show you how to work with combo boxes. I have been looking at the examples documentation and every time it was using C. So I found it complex. But I want to show you how to do it without using C or net logic. Here we have the application with a combo box pointing to the variable of a PLC.
(00:37) This is mode. If we change the mode here to degrees, we can see that the variable in the PLC is changing. And if you turn back to millimeters mode, you have a zero here. you have also a change and once again one in mode. So how to do this? Let’s go to the application. First you have to do is to define a variable in model of type enumeration.
(01:18) Uh to define a enumerated variable you can go to model and new and then you have to go to all. In all you can find data type and in data type you will find the enumeration. That’s how you create this variable. Then you have to define the uh states or what do you want to show here in the table like this one giving some values integer value and a display name.
(01:58) What do you want to display when you open the combo box? Then you can just go to the screen where you have the combo box and put a combo box. Okay. And start filling four things here. First of all is the variable enumerated we have created. Another one is the display value. We will point to this aliases item and variable and attribute display name.
(02:41) Third one is the select value path. You can go to aliases item variable and value and then you can go to selected value to point to the PLC. Just you just click on the PLC tag. You want to look how this is working here. We can write in both sides to the PLC. So if you write to the PLC, you will change this.
(03:20) And if you change the combo box, you will change the PLC. And that’s all. If you want to show here the selected number or index, you can point this way. You have to the UI the screen where you have the combo box. Select the UI selected item pointer and then pointed note. Here you will have the number of this. As we can see here, the number that you selected will appear here.
(04:01) And um this is all. I hope you enjoy and thank you very much.
Tutorial List
- Linking pushbuttons to a Logix tag
- Dynamic Link Key-Value Converter
- Create reusable graphics
- Object model alias
- Alias with Logix a UDT
- Dynamic alias index with Logix UDT
- Popup Dialog Box
- Build a faceplate
- Create Variables with Structured Data Types
- Rockwell Automation Device Libraries for Optix
- Optix Presentation Engines
- New Windows for Web Presentation Engine
- Changing Languages for Localization
- ComboBox to Change PLC Tag
- Custom Made Buttons
