[RFC] Modbus Module runtime.lvclass: fix instance refcounting#72
Open
rtollert wants to merge 1 commit intoLabVIEW-DCAF:masterfrom
Open
[RFC] Modbus Module runtime.lvclass: fix instance refcounting#72rtollert wants to merge 1 commit intoLabVIEW-DCAF:masterfrom
rtollert wants to merge 1 commit intoLabVIEW-DCAF:masterfrom
Conversation
Fix for LabVIEW-DCAF#71. modbus initialize API object.vi: - New design assertions: 1. Refcounts (Clients Count DVRs) are never closed. 2. All API objects participate in refcounting, not just serial masters. This does not affect the behavior of things that aren't serial masters, and dramatically simplifies logic both here and in close.vi. - Accordingly, the FGV variant now holds (Modbus API, refcount) tuples instead of (Modbus Master, refcount) tuples. And it is notionally getting indexed by (class, address) tuples, e.g. ("serial master", VISA instrument), or ("TCP master", IP address, port). close.vi: - Unwire "error in" from Decrement Clients Count.vi and the rest of that shutdown chain, to ensure that it always runs. This helps preserve normal close semantics for this VI. - Remove Delete DVR call to Clients Count DVR, because modbus initialize API object.vi is now guaranteed to hold it open. Add a brief comment to this effect. Reorder final Merge Errors call accordingly. Build lookup key for configuration.vi: - Builds the strings of (class, address) tupes which are used to index into the FGV variant in modbus initialize API object.vi. - "ok?" indicator controls whether or not reusing the modbus instance from the FGV is permitted -- false for everything but serial masters. (Refcount DVRs are always reused.)
agomez08
approved these changes
Oct 23, 2019
Contributor
agomez08
left a comment
There was a problem hiding this comment.
Changes look good and work as described
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix for #71; untested.
modbus initialize API object.vi:
This does not affect the behavior of things that aren't serial masters, and dramatically simplifies logic both here and in close.vi.
close.vi:
Build lookup key for configuration.vi:
Builds the strings of (class, address) tupes which are used to index into the FGV variant in modbus initialize API object.vi.
"ok?" indicator controls whether or not reusing the modbus instance from the FGV is permitted -- false for everything but serial masters. (Refcount DVRs are always reused.)