Jump to content

drjdpowell

Members
  • Posts

    1,964
  • Joined

  • Last visited

  • Days Won

    171

Everything posted by drjdpowell

  1. Are there plans to improve the performance of the VariantType library? The few VIs I’ve tested seem to be about an order of magnitude slower than equivalent OpenG functionality based on parsing the Int16 type array. I never use them as result. — James
  2. Here’s the modifications I made (in 2011, I’m afraid). I also incorporated most of the suggestions for name changes. OpenG Suggestions.zip
  3. I’ve had to modify all the proposed VIs to have output terminals for the objects; otherwise they all had poor performance for large objects. This was even true when they were “inline”, which means I don’t really understand what inlining actually does. — James
  4. I was joking (should have used a smilie). Of course I’m already using “Get Default Object.vi” inside “Class Name.vi” so that I’m not flattening the data of the input object (which was your initial criticism). Actually, this is why I was confused be my later time tests where “Class Name” is slower for large objects. Must be a copy going on somewhere. So I experimented and found that I could make it faster by passing the input object through to an output terminal: I modified “Qualified Class Name” in the same way. Now they give execution tines of around 4-5 microseconds, independent of object data size (up to 1 Meg, at least). Should the standard for the OpenG palette the same as for the LabVIEW palette? The current OpenG Data palette is full of VIs for doing non-standard things with variants by using the inefficient method of parsing flattened data. These new object VIs don’t look out of place. What if we call the VI “Class Display Name” to try and make the point that this is really a name for human readability rather than look-up?
  5. If only we had some VI that returns the default value of object class so we don’t need to flatten the data. Someone should make one of those. Wouldn’t by-name-lookup code use the Qualified Name, for uniqueness? Getting just the name is really for human readability, i.e. probes and the like. Also, anyone with more than a tiny bit of LabVIEW ability will take less than five minutes to identify “Get LV Class Path” as a way to get the name of a class. Now THAT is a inefficient method! I did a quick speed test of getting a name string for objects with internal data of 10kB (and 1000kB), with time in microseconds: Class Name: 7 (160) Fully Qualified Class Name: 9 (170) Get LV Class Path: 129 (630) “Get LV Class Path” is on the standard palettes, so if people are doing by-name-lookups I suspect some of them are taking the shortcut of not having a “Get Class Name” override at every level. And, hey, some of us just want to write some probes! Sounds great, but do you really want to add a method to every single command message class you write in the Actor Framework just to support the ability for someone to write a custom message probe? — James PS> Like all your VI renaming suggestions.
  6. I was imagining separate sub-palettes of a overall “LVOOP” palette, but perhaps they should be completely separate. Actually, a few days ago I was looking at the Class Library Refnum API to see if it could help me with another idea I have for a useful Object VI. One could do some interesting stuff, but unfortunately Class Refnums don't work on RunTime so one can’t put anything built on it in an exe. — James
  7. What I’d like to see is for a LVLib to not automatically load its contained LVClasses until and unless something else in memory refers to that class. In other words, have LVClasses follow the same loading rule as regular VIs in libraries. That would allow me to organize classes in libraries without issue. It would be nice if LVClass libraries could load piece-by-peice, but that is less important and probably not doable. — James
  8. Thanks Ton, we should change everything to “Object”. Regarding “Same or descendant class”, I forgot to make the inputs “required”, and the capitalization of the VI name is inconsistent with the other VIs; should be “Same or Descendant Class”. Putting these VIs in LabVIEW Data would be fine, though that library is quite large already. It might be better to have a new “LVOOP” library, especially if there is a chance of adding more tools in future, such as the Class manipulation tools jgcode linked to.
  9. “Only Used Internal to LabVIEW (oh, and, shhh… LV objects)” — James P.S. I’m actually about to use this, and it’s going to look funny when I have a case labeled “Only Used Internal to LabVIEW” where I try and cast my Variant into a LVobject.
  10. Small question: If I feed a LVOOP object (which is a “Refnum” type) into “Get Refnum Type Enum From Data”, it comes out as “Only Used Internal to LabVIEW”. Should this not be “LV object”?
  11. I went through something similar about a month ago. Most of my classes are not in Libraries now, which is not really what I would prefer, but it is necessary if I want to only load necessary software (every so often I open a new project, open a fresh VI, and drop a single object into it and see how much loads up under “Dependancies”). It’s more than just Libraries; any VI in a class that refers to another class acts as a “linker”, causing that other class to fully load in memory. It just takes a few linkers to get a sort of “domino effect” as class after class loads up.
  12. ??? There not really the either/or. I use LVOOP objects that contain queues of other LVOOP objects all the time. You need to understand queues.
  13. I actually never really learnt any LabVIEW from books or courses, so I can’t suggest any. Pretty well all my knowledge comes from “Find Examples”, reading conversations and studying code on LAVA and NI.com, and of course by actually using new features in actual code. If you want a suggestion, install the “JKI State Machine” Toolkit and try and use it in a project (there is also some video documentation to watch). Your knowledge will advance significantly even if you later decide you prefer a different architecture. — James
  14. It looks a lot like you are developing what is commonly called a “Queued State Machine”**, a common design pattern. Personally, I found it was much better to use a well-thought out and tested template developed by others, rather than develop my own. In particular, I often use the JKI State Machine Template. You might want to download that and take a look. — James ** Note: “Queued State Machine” is actually poor terminology, as they are not actually “state machines” in the proper computer science meaning. "Queued Operation Machine” is a better name. Actually, a true State Machine might be good for your problem, as your “context sensitivity” is really an issue of “state”. However, I’m not that experienced with true state machines, so hesitate to suggest it. There are others on LAVA who are experts in state machines, so perhaps one of them could chime in.
  15. My first thought is that you have a race condition due to the two parallel loops both writing to the same lossy communication channel (notifier). If you want multiple writers you need a non-lossy method, like a queue. The way I usually prevent the User pressing multiple commands is to lock the UI out while a command is executing, either just by the “Busy” cursor, or by disabling all invalid controls. — James
  16. Here are the VIs after some work on icons and adding an additional function to return the fully-qualified class name. I’ve made the smaller VIs “inline”. I also changed “Get Default Object” to being based on “Preserve Runtime Class” as I found that the zero-iteration method sometimes didn’t work when in an inline VI (some detail of the complier that I don’t understand). PS to jgcode> what is the next step in possibly getting these into OpenG? OpenG Suggestions.zip
  17. More reasons for me to finally upgrade from LabVIEW 8.6.
  18. You should look into something known as a “callback”, though I just think of them as a “return address”. You make a method of replying to the message part of the message, rather than sending replies to a dedicated command queue. The process making the request can always attach its own command queue if it wants replies to return in sequence with all other commands; but it also has the option of creating and attaching a temporary response queue and waiting for the reply on that queue (destroying it afterwards). Thus you can use a callback asynchronously OR synchronously as needed. So you could Start module A, wait for it to reply “Done”, then Start module B. Here’s what a subVI that does an synchronous send-and-wait-for-reply looks like in the messaging system I use: It creates a new queue, attaches it to the message, sends the message, and waits (with timeout) for a reply, before destroying the queue. The process at the receiving end of the message calls the “Reply” method on the message in order to send a response back along the temporary queue (unless there is an error, in which case it replies with an error message instead): I use this when I start up modules; I send a series of initializing messages, with the last one being sent as a Query, where I wait for a repines from the module. For example, here is a startup of a “Camera” module: Ignore the details, but you can see a series of messages sent, with the last message being sent as a Query. I don’t even care what the response is, other than if it is an error (which is automatically sent out the error terminal). — James
  19. Works now. Great work! I must have a hundred times though “Why can’t I just right-click a child class?" Suggestions off the top off my head (no idea how hard any of it is to do): 1) Automatically open the Properties window of the new child (as that’s always the next step). 2) On the popup that asks for the child’s name, have checkbox options for: — copy parent class icon to child — copy parent private data control icon to child Usually the child needs icons that are modifications of the parents icons, so this would save a lot of cut-and-paste. — James
  20. I successfully installed it with VI Package Manager (no error), but I can’t find it, either right-clicking or under Tools>>LAVA. Looking for the files, I seem to be missing a \resource\Framework\Providers\CreateChildClass directory. Other files seem to have installed.
  21. Another possibility; seeing if the object is the default value for it’s class: Maybe that’s too trivial. But the issue is code clarity; whether the icon is an advantage.
  22. No, it preserves the wire type, so no need to "cast back”: There are stronger arguments against “Same Class” than “Same or Child”. Also, with the above suggested OpenG VIs, one can build “Same Class” functionality in a clearer way (Is the default type of each object the same? —> Same class, for example). — James BTW, what do people think about error terminals on any of these VIs? I’ve left them off.
  23. Mike, It returns the name of the class of the child object on the wire (in contrast to the “GetLVClassInfo.vi” that comes in vi.lib\Utility\VariantDataType, which returns the name of the class of the wire datatype, rather than the actual object on the wire).
  24. This OpenG Review is closed. See Summary Post here. Please start a new thread to discuss new changes to this VI. Read this post for start of review. I’d like to suggest these three VIs (or similar) as possible LVOOP-object additions to the OpenG Toolkit: “Get Class Name” is a modification of “Get Name of Class of Object” posted by AQ. Here it just returns the basic class name (which I use often in custom probes and the like). "Get Default Object” is inspired by this discussion and uses AQ’s zero-iteration loop method. This is a very simple VI, but using it instead of the raw code is much clearer to the reader. “Same or child class” just uses “Preserve Runtime Class” as a tester. Again, the advantage here is code readability (or it will be, as soon as someone comes up with a good icon for it). Thoughts? — James OpenG Suggestions.zip
  25. I think going away from “one incoming message queue per message loop” would be a mistake. If your having problems on ordering shutdown, perhaps those can be solved a different way. How do you shutdown your processes? If you use a technique that tells all processes to shutdown at the same time (like a common global, say), than a better technique is to shutdown processes individually by sending individual “shutdown” messages to them. Send the shutdown messages in the order needed, and if necessary, wait for each process to acknowledge shutdown before ordering another to shutdown.
×
×
  • Create New...

Important Information

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