fisothemes / LabVIEW-TwinCAT-ADS

Easy to use unofficial LabVIEW TwinCAT ADS API for communicating with Beckhoff PLCs via ADS. Features include Invoking Rpc Methods, Reading/Writing of PLC variables (including all Standard, Time, Strings, WStrings, Structs composed of the aforementioned, Nested STRUCTs and Multi-dimensional Arrays of the aforementioned datatypes) and more!
MIT License
12 stars 1 forks source link

Error in Read Method Information.vi #5

Closed nristovs closed 1 month ago

nristovs commented 1 month ago

There is an issue with the following VI when used with TwinCAT 3.1.4024.62. The following properties no longer exist in the TwinCAT.Ads.dll

image

fisothemes commented 1 month ago

Hi @nristovs I am struggling to reproduce this issue, can you tell me which version of the TwinCAT.Ads assembly you're using? I have 4024.62 installed. The version I was using for development was TwinCAT.Ads(4.3.32.0). I also tried TwinCAT.Ads(4.4.0) from nuget.

Please tell me which version of LabVIEW and its bitness you're using?

Try deleting the wire reference wire or clicking on the greyed out elements.

github-issue-5(0)

To find out which version you're using, right click on the green wire coming out of get_item on the ReadOnlyMethodParameterCollection invoke node and create a constant. Then right click on that constant, got to Select .NET Class and then Browse.

My last resort would be to wipe my whole system and reinstall 4024.62 from scratch as well as LV which I am not inclined to do.

nristovs commented 1 month ago

I am currently using 4.3.32.0 as well. I've taken two screenshots to show the version and what properties are available for in the reference. This has happened on two separate installations on two computers. Is there any extra packets that should be installed on the in TwinCAT? ReferenceError_Fiso ReferenceError_Fiso2

fisothemes commented 1 month ago

Interesting. Looks like I'll have to do a clean install on a VM. This might take a while.

fisothemes commented 1 month ago

Hi, can I also have the LabVIEW version you used as well as its bitness.

fisothemes commented 1 month ago

I found out what your issue was. You're using the wrong DLL. See:

image

Beckhoff may have mixed up the dlls. You can ask for a previous version of the XAR/XAE stating that you have a bug with it.

Another way is to read the .NET Assembly help file and use the correct dll: image Found at View >> .NET Assemblies in Memory >> Help

fisothemes commented 1 month ago

This issue is caused by Beckhoff installing the wrong TwinCAT.Ads.dll during the installation of TwinCAT 3.1.4024.62. The version installed is for WinCE, which doesn't support the TcRpcLengthIs attribute. Since LabVIEW doesn't run on Windows CE, attempting to fix this would only mask the underlying issue.

Recommended Fix:

  1. Contact Beckhoff and inform them that TwinCAT 3.1.4024.62 may be installing the WinCE version of TwinCAT.Ads.dll into the Global Assembly Cache (GAC). Ask them to verify and address this potential issue.

  2. Manually replace the TwinCAT.Ads.dll in the GAC at:

    C:\Windows\Microsoft.NET\assembly\GAC_MSIL\TwinCAT.Ads\

    with the correct DLL for x86 Windows, located at:

    C:\TwinCAT\AdsApi\.NET\vA.B.CDEFG\

    Make sure the version number in the GAC matches the one in the C:\TwinCAT\... folder.

(Optional) Uninstall TwinCAT and ask Beckhoff for an older version of the XAE/XAR.

Note:
For users on version 4026, the TwinCAT folder is located at C:\ProgramData\Beckhoff\.

fisothemes commented 1 week ago

Fixed on Pre-release v1.2.6.14

Note: that this is still an issue on Beckhoff's end, I just found an elegant way to mask it. I still advice you contact their technical support and inform them about the issue.