Reading variables from a beckhoff plc(or runtime)
12 次查看(过去 30 天)
显示 更早的评论
Hey all,
i'm using the beckhoff dll in matlab and trying to read and write variables from/to the plc. the setup is completely local (both the twincat runtime and matlab are running on my laptop).
I'm trying to use a specific method to read a variable from the plc and get an error saying that no method with matching signature was found for this class.
using the methods function with the '-full' flag provides the following signature for this method :
System.Object RetVal ReadSymbol(TwinCAT.Ads.TcAdsClient this, System.String name, System.Type type, logical scalar reloadSymbolInfo).
as you can see in the attached code, my method call looks like this:
myInfo = tcClient.ReadSymbolInfo("OPC_Test.Var3")
ReadPlease = tcClient.ReadSymbol("OPC_Test.Var3",myInfo.DataType,0)
the problems seems to be in the second argument which expects a System.Type variable but i'm not sure.
any thoughts on how to do this?
P.S. - i'm able to read variables in a different way with a different method but am interested in this and in knowing if there's a limitation for some reason.
Thanks,
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 R Language 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!