Please read our Legal Disclaimer before executing any steps on this article.
Overview
In ORiN2 SDK, DCOM (Distributed Component Object Model) of Microsoft Corporation is adopted as a distributed object technology. The DCOM based CAO can be used from various program languages such as C++, JAVA, and Visual Basic.
This article is meant to help to gather information on resources that can help you get started with interfacing with the CAO Engine in Python. This article is not intended to aid you with programming in Python.
Tools and Parts needed
- ORiN 2 SDK Install
- PC running Windows OS
NOTE: The following sample code is provided "AS IS" under the MIT License. Programming support service of Visual Basic is out of warranty. Please note that we do not provide any programming support service beyond basic setup and troubleshooting.
Previous Steps...
Please make sure that you have reviewed the ORiN2 - Overview article and that your RC controller is properly setup. You can use the CAOTester to make sure that your PC is ready to communicate with the controller.
Set up your controller to accept messages from the PC. | ORiN 2 - Robot Controller Setup (RC8 / RC8A / COBOTTA) |
Test communication using CAO Tester application | ORiN 2 - Operation check using CAOTester (CAO Engine) |
Install the Python for Windows Extensions files Python needs to have the pywin32 files to have access to the Windows API of CAO. |
Programming References
At this point, you should be ready to begin programming your application to interface with your robot controller. When connecting to the controller, you will need to specify the ORiN provider you are trying to use to establish communication. The provider differs based on the robot controller you are using. RC5, RC7, and RC7M controllers use the NetwoRC provider. RC8, RC8A, and COBOTTA controllers us the RC8 provider.
NetwoRC provider directory
C:\ORiN2\CAO\ProviderLib\DENSO\NetwoRC
RC8 provider directory
C:\ORiN2\CAO\ProviderLib\DENSO\RC8
NOTE: Please consult the Owner's manual for information on how to program your DENSO Robot or details on specific robot commands.
Programming using the Provider
The following samples are for performing various basic but essential operations. The samples are for connecting using the RC8 Provider.
For more information you can reference Section 4 RC8 Programming Using the Provider from the RC8 Provider User's Guide PDF document.
Variable Sample
The sample program uses the automatically created workspace and reads/writes the variable I11 (the 11th global integer variable).
IP should be set to the value for the target controller. This sample program uses the following value. IP:192.168.0.1
# coding:utf-8 import win32com.client # Create CAO engine handler (start CAO.exe) eng = win32com.client.Dispatch("CAO.CaoEngine") # Creating a CAO controller handler ctrl = eng.Workspaces(0).AddController("RC8", "CaoProv.DENSO.RC8", "", "Server=192.168.0.1") # Creating a Variable object (Global Variable Integer I11) I11 = ctrl.AddVariable("I11", "") # Read Value and print print I11.Value # Write new value by adding one to current value I11.Value = I11.Value + 1 # Read Value and print print I11.Value
Owner's Manual Reference
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article