LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use of DVR inside class

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.


*** LV2018 ***
0 Kudos
Message 1 of 4
(3,158 Views)

I've corrected an error in DoSomething.vi...


*** LV2018 ***
0 Kudos
Message 2 of 4
(3,127 Views)

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:

 

DVR_Wire.PNG

 

Fix them both and the VI becomes runnable.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 3 of 4
(3,124 Views)

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.


*** LV2018 ***
0 Kudos
Message 4 of 4
(3,108 Views)