Note 4419 - Galil
Note 4419 - Galil
Note 4419 - Galil
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Application <strong>Note</strong> #<strong>4419</strong><br />
Using Indusoft Web Studio with <strong>Galil</strong> ActiveX Controls<br />
Introduction<br />
This application note provides a simple example for communicating to a <strong>Galil</strong> DMC-<br />
1830 controller through Indusoft Web Studio v5.1. In order to access <strong>Galil</strong> controllers<br />
through Indusoft, the user must use the <strong>Galil</strong> ActiveX controls. The example described<br />
below can be run in Windows NT 4, 2000, or XP. In the future, Indusoft will have their<br />
own <strong>Galil</strong> driver that will eliminate the need for the ActiveX tools. Also, the Indusoft<br />
driver will provide compatibility in Windows CE as well as the operating systems listed<br />
above. The <strong>Galil</strong> ActiveX tools used for the application below will not operate in<br />
Windows CE.<br />
Installation<br />
1. Install both the <strong>Galil</strong> ActiveX toolkit (DMCOCX) and a standard<br />
communication interface like DMC Terminal or DMCWIN32. Once<br />
DMCOCX has been installed, run the REGOCX utility to register all the<br />
ActiveX controls. Also, install Indusoft Web Studio v5.1.<br />
2. If the controller is BUS based (i.e. DMC-17x0, DMC-18x0, etc.) power down<br />
the PC and install the controller in an available BUS slot. Otherwise, connect<br />
the controller to the PC with the appropriate cable (USB, Serial or Ethernet).<br />
3. Run the <strong>Galil</strong> Terminal software and add the controller to the registry if<br />
necessary. See the controller manual for the installation procedure. Establish<br />
communication to the controller through the terminal software to verify that the<br />
driver is working properly. Disconnect from the controller after verifying<br />
reliable communication.<br />
- 1 -<br />
<strong>Galil</strong> Motion Control, Inc. • 3750 Atherton Road • Rocklin, CA 95765 USA • 800-377-6329 • Ph: 916-626-0101 • Fax: 916-626-0102 • www.galilmc.com
Project Creation<br />
1. Starting a New Indusoft Project<br />
Open up Indusoft Web Studio and click on the File 1 menu to create a “New Project”.<br />
Click on the Project tab in the pop-up window and enter the “Application name:” and<br />
“Location:” for the project. For this example, “CEView Standard” should be chosen<br />
as the “Target platform:”.<br />
Figure 1. New Project Window<br />
1 Throughout the text, Indusoft screens, windows, function tabs, workspace components and icons will be<br />
shown in Bold. Menu items, tagnames, folder names, window options, toolbar items and user-defined text<br />
will be written in “quotes”.<br />
- 2 -<br />
<strong>Galil</strong> Motion Control, Inc. • 3750 Atherton Road • Rocklin, CA 95765 USA • 800-377-6329 • Ph: 916-626-0101 • Fax: 916-626-0102 • www.galilmc.com
After clicking “OK” in the New window, a Project Wizard window will appear.<br />
Choose the settings in that window according to Figure 2. Click “OK” when finished.<br />
Figure 2. Project Wizard Window<br />
Under the Workspace section on the left of the Indusoft development screen, click<br />
the Graphics tab and right click on the “Screens” folder. “Insert” a new screen and a<br />
dotted white grid will appear to the right.<br />
- 3 -<br />
<strong>Galil</strong> Motion Control, Inc. • 3750 Atherton Road • Rocklin, CA 95765 USA • 800-377-6329 • Ph: 916-626-0101 • Fax: 916-626-0102 • www.galilmc.com
2. Adding the Components<br />
To add ActiveX components to the screen, click on the button labeled “OCX” on the<br />
right edge of the development screen. The following window will appear.<br />
Figure 3. ActiveX Tool List<br />
- 4 -<br />
<strong>Galil</strong> Motion Control, Inc. • 3750 Atherton Road • Rocklin, CA 95765 USA • 800-377-6329 • Ph: 916-626-0101 • Fax: 916-626-0102 • www.galilmc.com
Add a DMCShell Control, a DMCTerminal Control, a DMCPoll Control and a<br />
DMCAnalog Control to the screen. Also, add three buttons to the screen. Arrange<br />
and resize the components to look like Figure 4.<br />
Figure 4. Screen1 Layout<br />
At this point, it may be wise to click on the File menu and save the screen as<br />
Screen1.<br />
- 5 -<br />
<strong>Galil</strong> Motion Control, Inc. • 3750 Atherton Road • Rocklin, CA 95765 USA • 800-377-6329 • Ph: 916-626-0101 • Fax: 916-626-0102 • www.galilmc.com
To ensure that Screen1 is the screen that opens first when the application is executed,<br />
got to the Project menu in the Indusoft development environment and click<br />
“Settings”. In the Project Settings window, click on the Runtime Desktop tab and<br />
type “Screen1” in the “Startup Screen:” box.<br />
Figure 5. Project Settings Window<br />
To have menu option on the runtime screen, check the “Menu” box in the Project<br />
Settings window and then click on the “Options…” button. Configure the Runtime<br />
menu options window as shown in Figure 6.<br />
Figure 6. Runtime Menu Options Window<br />
- 6 -<br />
<strong>Galil</strong> Motion Control, Inc. • 3750 Atherton Road • Rocklin, CA 95765 USA • 800-377-6329 • Ph: 916-626-0101 • Fax: 916-626-0102 • www.galilmc.com
3. Configuring the ActiveX Tools<br />
Next, right click on the DMCShell Control and select “Properties”. The Object<br />
Properties window will appear as shown in Figure 7.<br />
Figure 7. Object Properties Window<br />
Click the “Properties” button and make sure that the “DMCController:” number is the<br />
one to be accessed from the <strong>Galil</strong> Registry. The default controller number is 1.<br />
Figure 8. DMCShell Properties<br />
Repeat this process for the DMCTerminal Control.<br />
- 7 -<br />
<strong>Galil</strong> Motion Control, Inc. • 3750 Atherton Road • Rocklin, CA 95765 USA • 800-377-6329 • Ph: 916-626-0101 • Fax: 916-626-0102 • www.galilmc.com
For the DMCAnalog Control set the “DMCAnalogInput:” to one, and add the<br />
“Caption:” “Analog Input 1”. This DMC Analog Control will display the voltage of<br />
analog input 1 at a “DMCPollInterval:” of 500 samples per update (500msec for<br />
TM1000).<br />
Figure 9. DMCAnalog Properties<br />
Under the DMCPoll Control properties, select “0-Standard” as the<br />
“DMCPollMethod:” and “TEX” as the “DMCCommand:”. The “Caption:” for the<br />
DMCPoll Control should read “X-Axis Position Error”.<br />
Figure 10. DMCPoll Properties<br />
- 8 -<br />
<strong>Galil</strong> Motion Control, Inc. • 3750 Atherton Road • Rocklin, CA 95765 USA • 800-377-6329 • Ph: 916-626-0101 • Fax: 916-626-0102 • www.galilmc.com
4. Configuring the Buttons<br />
The button in the upper right of the Indusoft development screen needs to be labeled<br />
as an exit button. Right click on it, go to “Properties” and add the “Caption:” “Exit”.<br />
Figure 11. Exit Button Properties<br />
Also, add the “Caption:” “Jog X-Axis at 5000” to the button below the DMCPoll<br />
Control, and add the “Caption:” “Stop Jog” to the button below that. The<br />
development screen should then look like Figure 10.<br />
Figure 12. Fully Labeled Development Screen<br />
- 9 -<br />
<strong>Galil</strong> Motion Control, Inc. • 3750 Atherton Road • Rocklin, CA 95765 USA • 800-377-6329 • Ph: 916-626-0101 • Fax: 916-626-0102 • www.galilmc.com
The Exit button must be formatted to exit out of the runtime environment. Highlight<br />
the Exit button by left clicking on it, and click on the icon that looks like a computer<br />
mouse in the right toolbox of the development screen. Next, right click on the Exit<br />
button and go to “Properties”. Select “On Down” from the pull down menu in the<br />
upper right corner of the Object Properties window. In the first “Expression” box<br />
type in the following:<br />
XSet(“DMCShell1”,”DMCConnect”,”False”)<br />
The XSet function call is a utility within Indusoft for setting a value (”False”) to the<br />
property (“DMCConnect”) of the ActiveX object (“DMCShell1”). This particular<br />
call ends communication with the controller. The other ActiveX calls within Indusoft<br />
are XGet and XRun. For more information, see the Indusoft documentation.<br />
In the second “Expression” box, add the text “Shutdown()”. This command will<br />
shutdown and exit the Indusoft runtime screen. Figure 13 shows the Object<br />
Properties window for the Exit button.<br />
Figure 13. Configuration Properties for the Exit Button<br />
Repeat the configuration process for the X-Axis Position Error button, but use the<br />
following function in the “Expression” box instead:<br />
XSet(“DMCShell1”,”DMCCommand”,”JG5000;BGX”)<br />
This function will send the commands JG5000;BGX to the controller. The Object<br />
Properties window for the X-Axis Position Error button should look like Figure 14.<br />
Figure 14. Configuration Properties for the X-Axis Position Error Button.<br />
- 10 -<br />
<strong>Galil</strong> Motion Control, Inc. • 3750 Atherton Road • Rocklin, CA 95765 USA • 800-377-6329 • Ph: 916-626-0101 • Fax: 916-626-0102 • www.galilmc.com
Likewise, the Stop Jog button should be configured in the same fashion. For this<br />
button, the “Expression” box in the Object Properties window should contain the<br />
following function:<br />
XSet(“DMCShell1”,”DMCCommand”,”STX”)<br />
This function will stop motion on the x-axis.<br />
5. Adding the Startup Screen<br />
Now that the ActiveX tools have been configured, they must be referenced and<br />
initialized from a Startup screen. Go to the Tasks tab under the Workspace, right<br />
click on the “Math” folder and “Insert” a math screen. Enter the word “Startup” in<br />
the “Description:” and the number “1” in the “Expression:” box. Setting the<br />
“Expression:” to 1 ensures that the Startup screen always executes.<br />
The next step is to add three “Tag Name” entries into the Startup math window. The<br />
first tag should be called “Connect”. After entering this name into the “Tag Name”<br />
box, Indusoft will ask the user, “Would you like to create this tag?”. Click “Yes” and<br />
select “String” as the tag “Type:”.<br />
Figure 15. Properties for the “Connect” tag<br />
This “Connect” tag should have the following “Expression”:<br />
XGet(“DMCShell1”,”DMCConnect”)<br />
This function call will determine whether or not communication has been established<br />
with the <strong>Galil</strong> controller. It will assign the string, “True” to the “Connect” tag if the<br />
controller is connected and “False” if it is not connected. If communication has not<br />
been established, it is necessary to make the connection through a second function<br />
call. In the following “Expression:” box, enter the function call below.<br />
- 11 -<br />
<strong>Galil</strong> Motion Control, Inc. • 3750 Atherton Road • Rocklin, CA 95765 USA • 800-377-6329 • Ph: 916-626-0101 • Fax: 916-626-0102 • www.galilmc.com
If(Connect"True",XSet("DMCShell1","DMCConnect","True"))<br />
This expression says that if the “Connect” tag is not equal to “True” then establish<br />
communication to the card with the XSet function call. This “If” statement does not<br />
require a “Tag Name”.<br />
Next, enter the word “Poll” into the third “Tag Name” box on the Startup screen.<br />
When prompted to make “Poll” a tag, click “Yes” and select “String” as the tag<br />
“Type:”. The “Expression:” for the “Poll” tag should be as follows:<br />
XGet(“DMCPoll1”,”DMCPollController”)<br />
This function call determines if the software is polling the controller or not.<br />
The following “Expression:” box should contain a function call to initiate the<br />
DMCPoll Control. It should be written as follows:<br />
If(Connect"True",XSet("DMCPoll1","DMCPollController","True"))<br />
The third “Tag Name” called “Analog” will have the “Expression”:<br />
XGet(“DMCAnalog1”,”DMCPollController”)<br />
The following “Expression” box should contain an “If” statement for initiating the<br />
DMCAnalog Control. It should be written as follows:<br />
If(Connect"True",XSet("DMCAnalog1","DMCPollController","True"))<br />
- 12 -<br />
<strong>Galil</strong> Motion Control, Inc. • 3750 Atherton Road • Rocklin, CA 95765 USA • 800-377-6329 • Ph: 916-626-0101 • Fax: 916-626-0102 • www.galilmc.com
The finalized Startup screen should look like Figure 16.<br />
Figure 16. Startup Math Screen<br />
- 13 -<br />
<strong>Galil</strong> Motion Control, Inc. • 3750 Atherton Road • Rocklin, CA 95765 USA • 800-377-6329 • Ph: 916-626-0101 • Fax: 916-626-0102 • www.galilmc.com
Run the Application<br />
The project has now been fully developed. Return to the Indusoft development<br />
screen and click on the Run Application icon on the upper toolbar. This button has a<br />
small picture of a computer with a down arrow next to it.<br />
A CEView window should appear on the screen that looks similar to Figure 17. If<br />
there are compilation errors with the application, they will appear in the log window<br />
at the bottom of the Indusoft development screen.<br />
Figure 17. CEView Runtime Screen<br />
At this point, the user can send commands from the terminal utility, jog and stop the<br />
x-axis with the command buttons, view the voltage on analog input one and view the<br />
x-axis position error in the polling window.<br />
To end the application, either go to the File menu and “Exit”, click the “X” button at<br />
the upper right of the CEView screen, or click the Exit button above the Analog<br />
Input 1 box.<br />
- 14 -<br />
<strong>Galil</strong> Motion Control, Inc. • 3750 Atherton Road • Rocklin, CA 95765 USA • 800-377-6329 • Ph: 916-626-0101 • Fax: 916-626-0102 • www.galilmc.com
Conclusion<br />
Indusoft Web Studio is a helpful tool for integrating several devices into the same<br />
programming environment. Some of these devices include Allen Bradley PLCs and<br />
OPTO 22 I/O racks as well as <strong>Galil</strong> Motion Controllers. Contact Indusoft for a full<br />
list of communication drivers in the Web Studio software.<br />
The example shown above does not utilize the full capabilities of Indusoft Web<br />
Studio. For detailed programming questions contact Indusoft at 1-877-463-8763, or<br />
for specific <strong>Galil</strong> support call 1-800-377-6329.<br />
The example application described above is called IINTRO and is available for free<br />
download at http://www.galilmc.com/ftp/pub/indusoft/. There is also a more<br />
complicated application at this location called DMCDEMO.<br />
- 15 -<br />
<strong>Galil</strong> Motion Control, Inc. • 3750 Atherton Road • Rocklin, CA 95765 USA • 800-377-6329 • Ph: 916-626-0101 • Fax: 916-626-0102 • www.galilmc.com