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

#288 Add Contributions Policy #325

Merged
merged 4 commits into from
Feb 5, 2023
Merged

#288 Add Contributions Policy #325

merged 4 commits into from
Feb 5, 2023

Conversation

timyhac
Copy link
Collaborator

@timyhac timyhac commented Jan 26, 2023

  • Contains a contributions Policy
  • Includes an example of a PLC Fake, referred to in the debugging guidance.

@timyhac timyhac marked this pull request as ready for review January 26, 2023 05:38
{
// The PLC is expected to have some logic that sets the ResetFlag from true back to false after resetting the counter
await ResetTag.WriteAsync(true);
await ReceiveData();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is just a throw away example, but it bothers me that this is a race condition...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I don't see it - how would it best be written?

Copy link
Member

@jkoplo jkoplo Feb 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, in this case you're writing true to a PLC tag to presumably signal the PLC to reset a counter. And then you're reading the value of that counter with ReceiveData. Depending how fast the PLC is scanning and how much network delay, etc you will either read back the value of the counter before the PLC processes the ResetTag trigger or you'll read it back after it processes ResetTag...

Like I said for the purpose of the example it's probably fine. In real life I'd probably set ResetTag to true, poll the tag until the PLC processes and sets it back to false (assuming PLC logic and order of operations), and then read the value of CounterTag.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see! Good points

@timyhac
Copy link
Collaborator Author

timyhac commented Feb 1, 2023

@jkoplo - any comments around the Contributions Policy?

@timyhac timyhac merged commit 743492e into master Feb 5, 2023
@timyhac timyhac deleted the #288 branch February 5, 2023 02:32
@jkoplo
Copy link
Member

jkoplo commented Feb 6, 2023

And I never got back to you on the contribution policy. 👍

Looks good to me.

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

Successfully merging this pull request may close these issues.

None yet

2 participants