Reading variables from a beckhoff plc(or runtime)
Show older comments
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,
Answers (0)
Categories
Find more on Language Support in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!