Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with Soft Logix #7

Open
ltemimi opened this issue Nov 14, 2019 · 3 comments
Open

Does not work with Soft Logix #7

ltemimi opened this issue Nov 14, 2019 · 3 comments

Comments

@ltemimi
Copy link

ltemimi commented Nov 14, 2019

Hi
I tried your software with Soft Logix 19 and I get format error and could not read the tags
Does it work with soft logix? if yes any idea why I a unable to read tags?

Thanks
Laz

@franklupo
Copy link
Member

Hi,
ok change the CpuType.
For cpu see https://github.com/kyle-github/libplctag/wiki/Tag-String-Attributes

Best Regards

@ltemimi
Copy link
Author

ltemimi commented Nov 16, 2019

Hi Frank
I still have the issue I tried the csharp-wrapper and it works

internal Tag(Controller controller, string name, int size, int length = 1)
        {
            Controller = controller;
            Name = name;
            Size = size;
            Length = length;
            ValueManager = new TagValueManager(this);
            TypeValue = typeof(TType);

            var url = $"protocol=ab_eip&gateway={controller.IPAddress}";
            if (!string.IsNullOrEmpty(controller.Path)) { url += $"&path={controller.Path}"; }
            url += $"&cpu={controller.CPUType}&elem_size={Size}&elem_count={Length}&name={Name}";
            if (controller.DebugLevel > 0) { url += $"&debug={controller.DebugLevel}"; }

            //create reference
            **Handle = NativeLibrary.plc_tag_create(url, controller.Timeout);**

            Value = TagHelper.CreateObject<TType>(Length);
        }

in line //create reference
Handle = NativeLibrary.plc_tag_create(url, controller.Timeout);

I get an exception System.BadImageFormatException. 'An attempt was made to load a program with
an incorrect format. (Exception from HRESULT 0x8007000B')

please help
Laz

@ClusterNaddy
Copy link

ClusterNaddy commented Dec 9, 2019

Hi Frank
I still have the issue I tried the csharp-wrapper and it works

internal Tag(Controller controller, string name, int size, int length = 1)
        {
            Controller = controller;
            Name = name;
            Size = size;
            Length = length;
            ValueManager = new TagValueManager(this);
            TypeValue = typeof(TType);

            var url = $"protocol=ab_eip&gateway={controller.IPAddress}";
            if (!string.IsNullOrEmpty(controller.Path)) { url += $"&path={controller.Path}"; }
            url += $"&cpu={controller.CPUType}&elem_size={Size}&elem_count={Length}&name={Name}";
            if (controller.DebugLevel > 0) { url += $"&debug={controller.DebugLevel}"; }

            //create reference
            **Handle = NativeLibrary.plc_tag_create(url, controller.Timeout);**

            Value = TagHelper.CreateObject<TType>(Length);
        }

in line //create reference
Handle = NativeLibrary.plc_tag_create(url, controller.Timeout);

I get an exception System.BadImageFormatException. 'An attempt was made to load a program with
an incorrect format. (Exception from HRESULT 0x8007000B')

please help
Laz

Hi Laz,

Were you able to find a solution for this issue?
I am experiencing the similar problem. I have tried other referenced wrappers and it works fine with ASP.NET Framework. I tried using this wrapper(ASP.NET Standard) on a new ASP.NET core application but with no luck.

BR,
Naddy

Update: In order to fix the issue I had to use Dependency Walker to identify the missing dll that this wrapper/plctag.dll had dependency on. To fix the VC++ .dll file dependency I modified the Visual Studio to add Desktop Development using C++ (any other module that uses C++ can be added though).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants