Jump to content

LVOOP on RT--stories from the field?


Recommended Posts

I finally decided to write a real application using OO on RT. I am wondering what experiences others who have tried this have had. Maybe we can help each other avoid the same issues?

I did write a couple small test projects using OO on RT and found that they worked fine, albeit a little more slowly than the comparable cluster-based implementation (which is what I eventually used for my previous actual subsystem code).

Accordingly, I decided to implement the next subsystem in OO on RT, hoping that this would allow me to take advantage of 1) reusable code (common to subsystems), 2) object-oriented patterns (State Pattern, particularly) and 3) ownership of data and methods in a class (to take advantage of OO file management and structure, which makes the code much easier to debug and maintain).

I found writing the code wasn't markedly different from working on My Computer (not surprisingly). I did encounter a number of bugs with the project and file management, but these weren't huge and probably are platform independent. In the end I had an application that did indeed offer me the advantages I listed above.

When I attempted to deploy the code, though, I encountered a number of pitfalls and bugs, some of which I think are major. (I am awaiting resolution from NI on resolutions of some of these issues, so the jury is open on them. Maybe they have something to do with the particular code I wrote, although I can't see why.)

One note. A test I ran with a trivial implementation of the State Pattern showed that writing a (featherweight) object to another--at least in this instance--using an accessor method takes > 140 us (on a cRIO 9074). So... if you use a model where you pluck off an object, have it do something, and then put it back in your model (which is a common thing to do!) and you don't have this at a level where this is private data, you can only do about three of these actions each millisecond. In my case I had a class that no longer had methods but was just present for hierarchical organization, but I had to get its member objects with accessor methods (since I did this inside a method belonging to a higher-level class), and I did this a lot. I found it expedient to convert this class to a cluster and performance dramatically improved. So... maybe someone else will find it helpful to think carefully about where to use accessor methods for objects within objects.

Anyway, if anyone has tried OO on RT and is willing to share what they have learned (maybe some workarounds for issues encountered), that could be helpful.

  • Like 1
Link to comment
  • 1 year later...

Join the conversation

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

Guest
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.