Jump to content


Photo
- - - - -

Creating a DVR to a class

lvoop dvr

  • Please log in to reply
5 replies to this topic

#1 neil

neil

    Extremely Active

  • Members
  • PipPipPipPip
  • 410 posts
  • Location:Surrey, UK
  • Version:LabVIEW 2012
  • Since:2004

Posted 09 February 2012 - 11:33 AM

Hi All,

Can anybody explain to me why it is not possible to create a DVR to a class in a VI outside of that class?

Of the two images attached the first one (with the broken wire) is from a VI that is outside the class, the one that is not broken is from a VI that lives inside the class.

The error message is Polymorphic terminal cannot accept this data type

Does the DVR have to be created inside a class member VI?

Attached Thumbnails

  • broken DVR.png
  • fixed DVR.png

CLA, CPI and CTM (Certified Tea Maker)

#2 mike5

mike5

    Very Active

  • Members
  • PipPipPip
  • 159 posts
  • Location:Slovenia
  • Version:LabVIEW 2010
  • Since:2009

Posted 09 February 2012 - 11:52 AM

*
POPULAR

It's a property setting:

LV-DVR-prop.png

Br, Miha
Close the world, txEn eht nepO.

#3 neil

neil

    Extremely Active

  • Members
  • PipPipPipPip
  • 410 posts
  • Location:Surrey, UK
  • Version:LabVIEW 2012
  • Since:2004

Posted 09 February 2012 - 02:02 PM

Thanks Miha, :thumbup1:

Now that you mention it, I do remember changing this before when I had this problem last time, but I totally forgot about it!
CLA, CPI and CTM (Certified Tea Maker)

#4 jgcode

jgcode

    LabVIEW Renegade

  • OpenG
  • PipPipPipPipPipPip
  • 2,397 posts
  • Location:Australia
  • Version:LabVIEW 2009
  • Since:2005

Posted 10 February 2012 - 11:20 PM

Thanks Miha, :thumbup1:

Now that you mention it, I do remember changing this before when I had this problem last time, but I totally forgot about it!


In case you are wondering what is the point of this feature:
One of the reasons for doing this is so you have the ability to force the user to use your constructor method as opposed DVR'ing the object with x state.
This maybe important sometimes when you need to guarantee that any methods/setup that are required to run are indeed run, then you can DVR the object -> you have complete control.

#5 neil

neil

    Extremely Active

  • Members
  • PipPipPipPip
  • 410 posts
  • Location:Surrey, UK
  • Version:LabVIEW 2012
  • Since:2004

Posted 11 February 2012 - 09:48 PM


In case you are wondering what is the point of this feature:
One of the reasons for doing this is so you have the ability to force the user to use your constructor method as opposed DVR'ing the object with x state.
This maybe important sometimes when you need to guarantee that any methods/setup that are required to run are indeed run, then you can DVR the object -> you have complete control.


thanks Jon. My OO experience is quite limited, so I have not really ever needed to start mucking about with those checkboxes. Your explanation does make sense though. Most of the apps I develop are really 1 person projects, so I have never really had to think too much about someone "misusing" any of my classes.
CLA, CPI and CTM (Certified Tea Maker)

#6 Aristos Queue

Aristos Queue

    LV R&D: I write C++/# so you don't have to.

  • Premium Member
  • 2,620 posts
  • Location:Austin, TX
  • Version:LabVIEW 2011
  • Since:2000

Posted 15 February 2012 - 03:55 AM

It's not just someone else misusing. It's also about making your own debugging easier as your code base expands.





Also tagged with one or more of these keywords: lvoop, dvr