Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modbus Module runtime.lvclass: fix instance refcounting
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.)
- Loading branch information