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

Bool tag write not working #291

Closed
avnet78 opened this issue Oct 14, 2022 · 4 comments
Closed

Bool tag write not working #291

avnet78 opened this issue Oct 14, 2022 · 4 comments

Comments

@avnet78
Copy link

avnet78 commented Oct 14, 2022

Here's my sample code. The bool tag write doesn't seem to be working:
I am getting false in both reads.

var tag1 = new Tag<BoolPlcMapper, bool>()
  {
      Name = "Glob_RCE_EIP_Bool_2",
      Gateway = deviceIPAddress,
      PlcType = PlcType.ControlLogix,
      Path = tagPath,
      Protocol = Protocol.ab_eip
  };

Console.WriteLine("Writing bool tag");
  tag1.Value = true;
  tag1.Write();
  var tag1Read = tag1.Read();
  Console.WriteLine($"Reading bool tag value: {tag1Read}");

  Console.WriteLine("Writing bool tag");
  tag1.Value = false;
  tag1.Write();
  tag1Read = tag1.Read();
  Console.WriteLine($"Reading bool tag value: {tag1Read}");
@timyhac
Copy link
Collaborator

timyhac commented Oct 14, 2022

We do have outstanding issues with bool mapping because of the myriad of ways boolean values can be represented in PLCs.
Have you read through this ticket? #178

In the example you've posted, the issue could be either read or write.

@avnet78
Copy link
Author

avnet78 commented Oct 19, 2022

I understand, do you have timeline in mind on when the bool read/write issue will be resolved?
We have tested all other data types and they seems be be pretty accurate. Only issue is with the bool tags.

@timyhac
Copy link
Collaborator

timyhac commented Oct 20, 2022

There is no timeline for any development, but you may be able to use the existing bool mapper classes for some of your use cases. If you're writing software for specific hardware models (as opposed to library code which needs to abstract the details of data access) I would recommend using the non-generic Tag class, whose interface is very close to the core library's.

@avnet78
Copy link
Author

avnet78 commented Oct 26, 2022

Thank you for the update @timyhac

@avnet78 avnet78 closed this as completed Oct 26, 2022
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

2 participants