Skip to content

Instantly share code, notes, and snippets.

@clope031
Created May 15, 2020 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clope031/b60cb9a237e5314b698f06281d1e0025 to your computer and use it in GitHub Desktop.
Save clope031/b60cb9a237e5314b698f06281d1e0025 to your computer and use it in GitHub Desktop.
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment