-
-
Save clope031/ec11628185143816608003bfdb5eb9ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim g_eng As CaoEngine | |
Dim g_ctrl As CaoController | |
Dim g_val As CaoVariable | |
Private Sub Command1_Click() | |
' Read variable | |
Text1.Text = g_val.Value | |
End Sub | |
Private Sub Command2_Click() | |
' Write variable | |
g_val.Value = CBool(Text2.Text) | |
End Sub | |
Private Sub Form_Load() | |
Set g_eng = New CaoEngine | |
' Connect RC: IP setting depends on your RC setting. | |
Set g_ctrl = g_eng.Workspaces(0).AddController("RC8", "CaoProv.DENSO.RC8", "", "Server=192.168.0.1") | |
' Variable name "IO150" | |
Set g_val = g_ctrl.AddVariable("IO150", "") | |
End Sub | |
Private Sub Form_Unload(Cancel As Integer) | |
' Delete variable object | |
g_ctrl.Variables.Clear | |
Set g_val = Nothing | |
' Delete controller object | |
g_eng.Workspaces(0).Controllers.Remove g_ctrl.Index | |
Set g_ctrl = Nothing | |
' Delete CaoEngine | |
Set g_eng = Nothing | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment