Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a demo for the features introduced in the last commit, using an…
… OPC access component
- Loading branch information
unknown
authored and
unknown
committed
Dec 10, 2009
1 parent
20f3f64
commit 91fc072
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
require "luacom" | ||
|
||
opc = luacom.CreateObject("OPCDataCtrl.OPCDataCtrl.1") | ||
assert(opc) | ||
|
||
opc:setOPCServer("Matrikon.OPC.Simulation.1") | ||
|
||
print(opc.OPCServer) | ||
assert(opc:Connect()) | ||
|
||
print(opc:ReadVariable("Random.Int2")) | ||
print(opc:ReadVariable("Random.Int2")) | ||
print(opc:ReadVariable("Random.Int2")) | ||
code, t1, t2 = opc:ReadMultiVariables({ Type = "array of string", Value = { "Random.Int2", "Square Waves.Real8" } }) | ||
print(code) | ||
for k, v in pairs(t1) do | ||
print(k, v) | ||
end | ||
for k, v in pairs(t2) do | ||
print(k, v) | ||
end | ||
|
91fc072
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello,
I have a Problem with Luacom for OPC, can you please help me?
Can you tell me, how can I get your Code worked, I have installed the luacom using all methods, but i got always the error when i created "CreateObject("OPCDataCtrl.OPCDataCtrl.1") ".
Thank you very much!
HM