Jump to content

Dynamically loaded classes on RT


FlamingYawn

Recommended Posts

  • 1 year later...

I've seen it used once before. It was implemented to load a class from a file path, based on a configuration that provided the class name. Then the ref was cast to a more specific class, which was in fact the parent class of the originally targeted class. At first glance, it seemed entirely backwards, but my first inclination looking at the data is that the use of "To More Specific Class" and the parent class as the class that the ref was cast to was done in order to ensure that the class called was aware of its inheritance. Though I don't definitively understand how it functioned, it did work quite smoothly.

Link to comment

Has anyone used "Get LV Class Default Value VI" to dynamically load classes on RT?

 

I did, using a variant of the factory pattern. It was an instrument driver for a USB serial device that could have two different device types. Implemented the low level drivers for each device as a derived class of the main class which was the actual interface used by a user of the driver. Depending on a selection by the user either of the two low level drivers was instantiated and used for the actual implementation of the device communication. Worked fine except that you need to do some path magic to allow for execution on the RT target. It's mostly the same as what you need to do for execution in a build application but there is a difference between the paths when you deploy the program directly from the project (during debugging for instance) and when you build an rtexe application and execute that.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.