PC SDK Compability Issues

PC SDK compability issues

If you are getting:

or

Then this is for you.

Background

At the core of the controller communication of the PC SDK there is some old managed code created in the days when the IRC5 was new. ABB is working on replacing it but is not there yet. This means that in the mean time the PCSDK does not yet come in a 64-bit nor a .NET 4 version. Instead it is built for 32bit and with .NET Framework 2.

This makes it a bit troublesome for a developer who wants to do a PC SDK Windows form app straight away. This since you need to tell the development environment what to do with this old stuff.

Solution for mixing with .NET Framework 4.x

Using the PC SDK dll references together with a newer .NET 4.x project will generate a TypeInitializationException runtime error. You could solve this by downgrading the whole project to a .NET Framework 2 project, but if you need/want those nifty .NET 4 features do this:

  1. Right click your project and select Add>New Item.
  2. In the dialog select Application Configuration File.
  3. In the App.config file you need to add code so that it looks like this:<?xml version="1.0" encoding="utf-8" ?> <configuration> <startup useLegacyV2RuntimeActivationPolicy="true"></startup> </configuration>

Solution for AnyCPU / x64 / x86

Using the PC SDK controller communication on 64bit will generate a BadImageFormatException so you need to tell the project to run x86 exclusively. This means that even if you are running on a 64bit OS it will run the app as a 32bit process.

  1. Right Click the project and select Properties.
  2. In the Build tab in the list Platform target: select x86

Hi John Wiberg ,thank you for your attention.I am new in using PC SDK,failed in initialization of NetworkScanner class ,my project is set to X86, ABB.Robotics.Controllers.PC.dll version 6.3.7016.2009, the same as Robot Communication Runtime. May I ask you, what is the problem and what is the solution, thank you very much.

Hi John Wiberg.
I have a question, ABB dll requires .NET version 4.5, how to downgrade the project to the .NET version 2.0? .NET Downgrade to version 2.0, the compiler will complain. I am by your practice to add the code in the App.config file you mentioned, suggesting that error, I am using VS2013, it has been set for the x86 platform.

So much I am looking forward to your reply.