HMC5883 Compass icon HMC5883 Compass Reads HMC5883 3-axis compass via I2C and updates EZ-Script variables on demand; polled control offers periodic heading data, for connected sensors. Try it →
USA
Asked — Edited

Ez-Sdk Windows / Simple Project Not Running

I'm trying to connect to EZ-B through code (Console Application) without success.

this is the code:


namespace EZConsoleApplication1
{
    using System;
    using EZ_B;
    internal class Program
    {
        private static EZB ezb;
        private static void Main(string[] args)
        {
            ezb = new EZB();
            Console.WriteLine("Connecting to EZ-B v4...");
            ezb.Connect("192.168.18.54");
            if (!ezb.IsConnected)
            {
                Console.WriteLine("Unable to connect to EZ-B v4");
                return;
            }
            ezb.Servo.SetServoFineTune(Servo.ServoPortEnum.D0, 90);
            Console.WriteLine("Done!");
            ezb.Disconnect();
        }
    }
}

first i tried the EZ Windows SDK, then i used the nuget package.

the program compiles, no errors, but when i run i get the following exception/error:

User-inserted image

also i tried to run the exe file outside Visual studio and the exception is the same.

machine: Visual Studio 2013 Framework .net 4.5


ARC Pro

Upgrade to ARC Pro

Become a Synthiam ARC Pro subscriber to unleash the power of easy and powerful robot programming

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#1  

Please follow the instructions in the README.TXT that is included with the SDK package.

Author Avatar
PRO
USA
#2  

my bad..

the application needs to be compiled for x86 only.

Thanks

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#3  

No prob:D - also ensure the files are copied as well. The reason for x86 is due to speed optimization. There are no 64 bit values used in the sdk, which is why x86 makes execution faster:D