-
Notifications
You must be signed in to change notification settings - Fork 46
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
Conversation
timyhac
commented
Jan 26, 2023
- Contains a contributions Policy
- Includes an example of a PLC Fake, referred to in the debugging guidance.
{ | ||
// 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(); |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see! Good points
@jkoplo - any comments around the Contributions Policy? |
And I never got back to you on the contribution policy. 👍 Looks good to me. |