09-01-2016 07:08 AM
I'm not able to solve DVRs problem. See project file.
1. IO.lvlib exists in two versions: one with single variables + processSimulation.vi that simulates process/machine i.e. takes outputs, calculates process behaviour and writes inputs; the second version of IO.lvlib has variables as IOaliases. Simply swaping these two versions allows to run project on real target with machine or to run project on PC without target/machine. Thats why I use these IO.lvlib variables.
2. Every subsystem is an object/class with method DoSomething that calculates response to inputs and writes outputs.
3. I¨d like to call these objects DoSomething.vi method in one loop. Thats why it's not possible to have inputs/outputs as terminals of DoSomething.vi
4. I've tried to solve the problem with DVRs: every object is created by constructor including inputs/outputs DVRs initializing. However I'm not able to use DVRs inside DOSomething method. What am I doing wrong?
One solution is to avoid loop call and spread all (about 50) DoSomething.vi calls including inputs/outputs terminals onto block diagram. But this is definitely not well arranged solution.
Do you see anything wrong concerning my solution in general? How to access DVR inside class method? Any other ideas, comments? Thanks.
09-01-2016 09:22 AM
I've corrected an error in DoSomething.vi...
09-01-2016 09:25 AM - edited 09-01-2016 09:26 AM
I won't comment on your approach, but your vi "xcTest.lvclass: DoSomething.vi" is simply wired incorrectly. You haven't wired your DVR to the In Place Structure correctly. I fixed one of them to show how you should be doing it:
Fix them both and the VI becomes runnable.
09-01-2016 10:28 AM
Yes, I've corrected it yet. However this approach doesn't work. NI support said the DVR isn't valid inside class and it's not able to write to variables in library.