CX Server OPC Script Using Excel
CX Server OPC Script Using Excel
Note : Before you begin this setup make sure to use the steps outlined in the previous Excel example ( CX-Server OPC server and Cx-Server OPC Client Using Excel )
Step 1
Start Excel, using the steps outlined in the previous example, select an Omron CX Graphical Control (e.g. a Linear Gauge) from the Control Toolbox and drag it onto the Worksheet. In order to do this you have to be in the design mode. If you are not in the design mode click design mode key on the Toolbar
NOTE : If the toolbar showing Omron graphical components Toolbox If Toolbox is not visible, by selecting labeled Control and control is visible then go to step 2
Toolbars
on the
View menu and then click the button View menu and then
Toolbox
on the
OMRON CX-Server OPC under Toolbars on the View menu Then click the button labeled More Controls (the one with the hammer and spanner symbol)
Note: If you dont find Then select OMRON CX OPC Communications controls. Drag a square on the Worksheet to create the object
Step 2
Add a standard Excel command button (using the button symbol on the
Control Toolbox
Step 3
Type the name of the CX Graphical Control (e.g. Gauge1) followed by a dot. If you have typed the name correctly then a list box will appear. Scroll down this list box to find the Value command (note: you can also just type v and the list box will change selection to the correct item; if the list box disappears, e.g. because you have switched back to your web browser to read these instructions, then just press backspace then retype the dot and it will reappear).
Step 4
Now type the = character and then a number, e.g. 10. The line of VBA script now reads something like Gauge1.Value = 10 (Tip: because Value is the default property for a graphical control it can optionally be omitted - Gauge1 = 10 will also work and saves some typing)
Step 5
Click the button labeled