todd Posted September 16, 2011 Report Share Posted September 16, 2011 I wish I'd seen Michael's vishots about classes and instruments a few months ago. I've made it to that level of functionality and am looking for the next baby step of having multiple instruments to iterate over - just for init, status and cleanup functions. (Most of the actual instruments stream data. I put that into a queue as it arrives, and process that queue into an LV2/AE - though it seems a look at classes +| IPE may be in order, as long as the performance is there.) I'm playing around with an instrument class that has child classes of dmm, gpio, power supply, serial binary streaming device, etc. Each of those classes has a child class for specific devices - for example, dmm might have child classes: agilent 34401, simulated and custom. I saw someone use a "create" or "new" method somewhere on the forums, here, but I can't find it now. Basically, I want a case statemtent to return a "simulated" or "34401" class, but in a subvi. See the attachment. I apologize for not taking the time to post code. The blue circles error out as expected, since real instruments are not installed. The red one does not. All that's in the "get new class.vi" is that case statement. (I added the "base" class instrument in an attempt to use dynamic dispatching and class-casting. Of course I've learned better than that by reading the forums. I remember seeing an example of this in someone's code on the forums, here, but I can't find it. Anyone remember the link - or have any other feedback? Thanks, --Todd Quote 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.