Beckhoff / TF6000_ADS_DOTNET_V5_Samples

Sample code for the Version 6.X series of the TwinCAT ADS .NET Packages
https://infosys.beckhoff.com/content/1033/tc3_ads.net/9407515403.html?id=6770980177009971601
BSD Zero Clause License
37 stars 15 forks source link

Error retrieving symbols with PowerShell script #23

Closed drvic10k closed 2 years ago

drvic10k commented 2 years ago

when using the script to retrieve the list of symbols of a twincat3 server, this exceptin is thrown

image

without the -resurse switch it works

RalfHeitmann commented 2 years ago

Could you give me an indication which TcXaeMgmt Version you are using?

get-module TcXaeMgmt

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     6.0.27                TcXaeMgmt                           {Add-AdsRoute, Add-MqttRoute, Close-TcSession, Co…

or

get-module TcXaeMgmt -list

Because the problem is bound to a specific symbol: Which TwinCAT3 Server do you mean? Can the problem made reproduceable with a simple deployment on my side?

without the -resurse switch it works

The responsible Symbol will be one that is not in the root level of the Symbols but an child object in the Symbols tree. Could you narrow it down with limiting to specific symbols?

Get-TcSymbol -path Main.myFb -recurse #With or without -recurse

It seems that only Structs/FBs are relevant.

drvic10k commented 2 years ago

my version was 6.0.22, after updating to 6.0.33 it listed the symbol also with -recursive

thanks for the help

RalfHeitmann commented 2 years ago

For others that stumble about this problem: I assume you build your own Ads Server with the package Beckhoff.TwinCAT.Ads.SymbolicServer In that package there was an refactoring for StructTypes/RpcCallableStructTypes simplifiying the code in the latest version. This change needs an actual version of the TcXaeMgmt too.