RobotStudio event

RobotStudio 6.07+: Issues loading IRC5 controller on 64bit systems

Sverrir
Sverrir
edited September 2018 in Developer Tools
I'm developing a C# addin to the 64bit ABB RobotStudio 6.07.01 SP1 program. 
Due to unfortunate external requirements I must build it for the 64bit version of the RobotStudio.exe and cannot use 32bits.

I believe I have stumbled on a blocking bug in the C# API that affects the 64 bit version and not the 32bit version of RobotStudio. 

What I'm trying to do

I'm trying to obtain a reference to the IRC5 virtual controller for the default ABB robots (e.g. IRB_120_3kg_0.58m) so that I can read and subscribe to its IOSignals. 

The exception I get

Could not load file or assembly 'ABB.Robotics.Adapters.IRC5, Version=5.15.2005.2, Culture=neutral, PublicKeyToken=1da709b7d1f14b7b' or one of its dependencies. The system cannot find the file specified. 

The cause 

The cause seems to be that the assembly in question is only available in the GAC_32 location and not GAC_64 or GAC_MSIL. 
This causes an exception while loading the controller in question.

When I try this exact same code in the 32bit version of RobotStudio I have no issues and I can read and subscribe to signals just fine.
I've verified that the same bug exists in v6.07 as well as v6.07+ 

Repro 

Code to reproduce the issue: 
<div><span>var scanner = new NetworkScanner();
</span><span>var cInfos = scanner.GetControllers(NetworkScannerSearchCriterias.Virtual);&nbsp;
</span><span>var first = cInfos.FirstOrDefault();&nbsp;
</span><span>foreach (ControllerInfo c in cInfos) {&nbsp;
</span><span>&nbsp; &nbsp; Debug.Print("{0} : {1} : {2}", c.ControllerName, c.Id, c.SystemId);&nbsp;
</span>}&nbsp;</div>

Also reproducible using the example code from the ABB developer docs: 
<div>Station station = Project.ActiveProject as Station;
<span>var activeTask = station.ActiveTask;&nbsp;
</span><span>RsIrc5Controller rsIrc5Controller = (RsIrc5Controller) activeTask.Parent;&nbsp;
</span><span>var controller = new Controller(new Guid(rsIrc5Controller.SystemId));&nbsp;
</span><span>Debug.Print("Found Controller: {0}", controller.Name);&nbsp;
</span></div>
Anybody encountered this same issue or similar? 
Any known work-around for this for those of us that MUST use the 64 bit version of RobotStudio?
If this is a bug, any timeline on a fix?

BCT Technology AG, Im Lossenfeld 9, 77731 Willstätt, Germany, https://www.bct-technology.com
Vorstand/Officers: Klaus Erdrich, Jürgen Hillemann. Registergericht/Registry Court: Amtsgericht Freiburg, HRB 371105
Aufsichtsrat/Supervisory Board: Prof. Dr. h.c. Horst Weitzmann (Vorsitzender/Chairman), Katja Weber, Markus Menges 

Comments

  • Hi,
    It looks like you are using a very old version of PCSDK. Try installing the latest version.

    Regards, Johannes
    Johannes Weiman
    Software Engineer
    RobotStudio Team, ABB Robotics
  • Sverrir
    Sverrir
    edited September 2018
    Hi Johannes, 

    Edit (Incorrectly reported this solved before): 
    I just now downloaded and ran the PCSDK.6.07.7936.1011.zip installer (which is the latest) and having it did not solve my issue.
    The problem is still there when I build the system as 64bit.

    <div>Exception thrown: 'System.IO.FileNotFoundException' in SVERRIR.dll
    Additional information: Could not load file or assembly 'ABB.Robotics.Adapters.IRC5, Version=5.15.2005.2, 
    Culture=neutral, PublicKeyToken=1da709b7d1f14b7b' or one of its dependencies. 
    The system cannot find the file specified.</div>
    The only installer I've run on my machine is the installer for RobotStudio 6.07 and then the RobotStudio 6.07.01 SP1 (and just now the latest PCSDK). 
    There has never been anything else from ABB on this machine.

    Regards,
    Sverrir S.

    BCT Technology AG, Im Lossenfeld 9, 77731 Willstätt, Germany, https://www.bct-technology.com
    Vorstand/Officers: Klaus Erdrich, Jürgen Hillemann. Registergericht/Registry Court: Amtsgericht Freiburg, HRB 371105
    Aufsichtsrat/Supervisory Board: Prof. Dr. h.c. Horst Weitzmann (Vorsitzender/Chairman), Katja Weber, Markus Menges 

  • Johannes Weiman
    edited September 2018
    Which assemblies are you referencing? Note that you should not reference ABB.Robotics.dll or ABB.Robotics.Controllers.dll (legacy PCSDK) but instead ABB.Robotics.Controllers.PC.dll (new PCSDK).

    Johannes Weiman
    Software Engineer
    RobotStudio Team, ABB Robotics
  • Hi again,

    Yeah, I'm referencing the ABB.Robotics.Controllers.PC.dll and using classes from it.


    BCT Technology AG, Im Lossenfeld 9, 77731 Willstätt, Germany, https://www.bct-technology.com
    Vorstand/Officers: Klaus Erdrich, Jürgen Hillemann. Registergericht/Registry Court: Amtsgericht Freiburg, HRB 371105
    Aufsichtsrat/Supervisory Board: Prof. Dr. h.c. Horst Weitzmann (Vorsitzender/Chairman), Katja Weber, Markus Menges 

  • Sverrir
    Sverrir
    edited September 2018
    @Johannes Weiman  Your comment sent me on the right path, I had a closer look at the references and there seems like there was indeed a conflict in the dll references.

    After removing the following references:
        <Reference Include="RobotStudio.UI.Controller">&nbsp; &nbsp; <Reference Include="ABB.Robotics, Version=5.15.2005.0, Culture=neutral, PublicKeyToken=1da709b7d1f14b7b, processorArchitecture=MSIL" />
        <Reference Include="ABB.Robotics.Controllers, Version=5.15.2005.0, Culture=neutral, PublicKeyToken=1da709b7d1f14b7b, processorArchitecture=MSIL" />
    
    All is working again in 64bits *phew*

    Note, I had referenced both the new and the old PCSDK dlls in my project (yeah, that was stupid). But even though I was not using any references from the old dll in my code, just having it in my project seemed to cause issues. Also there was a conflict with the ControllerInfo class which got solved when I removed ABB.Robotics.dll as well.

    Thanks for taking the time to help, it is much appreciated :)

    -Sverrir

    BCT Technology AG, Im Lossenfeld 9, 77731 Willstätt, Germany, https://www.bct-technology.com
    Vorstand/Officers: Klaus Erdrich, Jürgen Hillemann. Registergericht/Registry Court: Amtsgericht Freiburg, HRB 371105
    Aufsichtsrat/Supervisory Board: Prof. Dr. h.c. Horst Weitzmann (Vorsitzender/Chairman), Katja Weber, Markus Menges 

  • I can confirm that the solution above also works on sample code "Accessing Controller Data":
    - remove obsolete ABB .dll's references
    - add new reference: (current year example: ...\ABB\SDK\PCSDK 2021\ABB.Robotics.Controllers.PC.dll)
    - change build target .NET framework to latest on each project that uses new .dll's