RayR Posted May 26, 2011 Report Share Posted May 26, 2011 I have a test environment that can consist of 4 different modems that are connected to 2 or 3 different radios. Each radio type supports a given set of frequency bands, bandwidths and modulation types. Not a matching set between radio types. Would frequencyBand, BW & modulation classes (child) be necessary or recommended? Let's call these modems A, B & C; and, radios R1 & R2. The 4th modem is integrated with the radio, so we'll call it DR3. The modems may or may not have the same command set, or the command may be slightly different. Regardless, I consider each modem as having different commands. Would this require a command class for each modem? Or rather a command class which is a child of each modem (maybe that is wording it better). The modem & radio combinations are usually tested in pair, but can be redundant. Radio / modem combos are tested in High/Low pairs. For instance, you could have the following combinations: Basic: A-R1-low with A-R1-high Mixed: B-R2-low with C-R1-high Mixed: C-R1-low with DR3-high Redundant Basic: A-R1-R1-low with A-R1-R1-high Redundant/Mixed: B-R2-R2-low with C-R1-R1-high and so on.. There are various tests that are run on these units, let's call them TestA, TestB, TestC, etc.. Each of the tests have sub-sections of test, giving: TestA-sub1, TestA-sub2, TestA-sub3. As a matter of fact, each sub-test is really considered a standalone test of a type of test (or a class of test in OO jargon) There are various instruments on different test racks. For instance, one rack may have all the instruments, whereas another may have some or no instruments. Some instruments can be from one or another manufacturer. For instance, the Spectrum Analyzer may be Agilent or Rhode & Schwarz or Anritsu. There are two traffic generators, with their own distinct configurations and set of commands. There are different RF attenuators, from a motorized vane to pin-diode. Communication to the modems can be done by telnet or serial port. Communication to the instruments can be done using GPIB, serial or Ethernet. In addition to the above, I would likely have a database class, a DynamicEvent class. I’m not sure about a serialNo class and a FileIO class.. Probably a FileIO class… And so on... I'm sure you're getting the idea. The goal is to make a universal test code which can support different infrastructure without having to have multiple code. I convinced them that LVOOP is the way to go with this.. I am going with the concept of a universal "test engine" that basically receives a list of instructions or states with parameters to accomplish the actual test. Where I am having difficulties is to create the appropriate LVclasses for this. I started by creating classes for Radios, Modems, Instruments, Tests, and Communication. I think I'm going in the right direction. For instance, in the Communications.lvclass, I have telnet.lvclass, which has IPaddress, telnetRef (will add telnetWrite & telnetRead). But for some strange reason, I sense I am missing something that I just can put my mind on it.. I think it is related to so many combinations. Especially dealing with the Redundant systems.. Or systems that have more than a pair of modems, such as the following scenario: Redundant/Mixed: (A)-A-R1-R1-low with DR3-DR3-high This means 1 modem attached to 2 radio on the low end and 2 modem/radio(combo) at the high end. And what happens if I want this to be flexible enough to have a new combination such as: A-R1-low with C-R2-high with DR3-low with B-R2-high (and possibly more, but unlikely) I want the architecture to be scalable to expect such an unexpected combination. I know the concept of superclass does not exist in LVOOP, but how would I handle that? Basically, I want to be able to run tests in parallel using the same engine. But I do not want to create an engine that has a fixed amount of UUTs that are run. As a matter of fact, I want the same engine to run the tests on the low side as well as the high side while not caring that it is high or low (other than the child that configures the frequencies appropriately based on how or high). Basically, I want to make sure I design the proper construct for such a solution using LVOOP. Thanks, R Quote Link to comment
Grampa_of_Oliva_n_Eden Posted May 26, 2011 Report Share Posted May 26, 2011 ... I want the architecture to be scalable to expect such an unexpected combination. I know the concept of superclass does not exist in LVOOP, but how would I handle that? Basically, I want to be able to run tests in parallel using the same engine. But I do not want to create an engine that has a fixed amount of UUTs that are run. As a matter of fact, I want the same engine to run the tests on the low side as well as the high side while not caring that it is high or low (other than the child that configures the frequencies appropriately based on how or high). Basically, I want to make sure I design the proper construct for such a solution using LVOOP. Thanks, R I'll throw out one idea to address the unknown number engines running. Tomi wrote about a Worker Pool here. http://lavag.org/topic/11362-worker-pool/page__p__68339__hl__worker__fromsearch__1#entry68339 I did my own version before reading how to do it better and used a control that I could write the target class (Child of generic "Do Something" class) to control its character. Handling various hardware interfaces in a "instantly infinately configurable" manner is a question above my pay-grade (free). Preventing conflicts between the various Workers accessing that I/O is something I'll sit-back and wait for others to advise. Ben I'll throw out one idea to address the unknown number engines running. Tomi wrote about a Worker Pool here. http://lavag.org/top...h__1#entry68339 I did my own version before reading how to do it better and used a control that I could write the target class (Child of generic "Do Something" class) to control its character. Handling various hardware interfaces in a "instantly infinately configurable" manner is a question above my pay-grade (free). Preventing conflicts between the various Workers accessing that I/O is something I'll sit-back and wait for others to advise. Ben Can we put restratints of any kind on the I/O demands or do we we have to allow for high throughput performance? WIll hardware be in the same area, room building city...? Ben 1 Quote Link to comment
Wire Warrior Posted May 26, 2011 Report Share Posted May 26, 2011 It sounds like you also have a good case for the use of a Hardware Abstraction Layer (HAL) as discussed in the 2011 Developer Day presentation here. This covers some concepts regarding removal/substitution/inclusion of instrumentation components using LVOOP techniques. I found it quite educational and informative. All of the example code slides and scripts are there for download. The situation you are coding for sounds like the conceptual "ideal" poster child for OOP techniques. The architecture you use needs to handle the variability of hardware, tested units, operators, etc. that occur from maintenance/growth of long time use. Jason 1 Quote Link to comment
RayR Posted May 26, 2011 Author Report Share Posted May 26, 2011 I'll throw out one idea to address the unknown number engines running. Tomi wrote about a Worker Pool here. http://lavag.org/top...h__1#entry68339 I did my own version before reading how to do it better and used a control that I could write the target class (Child of generic "Do Something" class) to control its character. Hey Ben! I had a feeling you'd reply Wow! This is exactly what I was looking for. I did a proof of concept without using the OOP approach and it is somewhat similar to what Tomi suggested. However, the limitation of my design is that it did not support multiple engines... Well... that's not entirely true, but not the same type of engine that I now need. I would have been limited to matching modems with an awkward parallelism. That's where LVOOP comes to the rescue.. I didn't read all of Tomi's blog and thread, but from what I saw I immediately see the fit. This gives me an extra energy boost to get this project into a successful path. Thanks bro! Can we put restratints of any kind on the I/O demands or do we we have to allow for high throughput performance? WIll hardware be in the same area, room building city...? I think we can put IO constraints. Whatever I develop will surely beat any performance that they have seen to date. So performance will not be an issue. Not boasting... just the fact that their existing code is not optimized.. The hardware will be in the same building / network.... well.... Hummm... Okay. For my mandate, the hardware will be in the same building / network as the test PC. However, they will likely (in the future) want to "borrow" this code and possibly use it for a remote system. However, it is not a design constraint at the moment. I should post (tomorrow) an image of the lvclass(es) that I proposed... I think what I have makes sense. Thanks Ben (how do you give kudos at this place?) It sounds like you also have a good case for the use of a Hardware Abstraction Layer (HAL) as discussed in the 2011 Developer Day presentation here. This covers some concepts regarding removal/substitution/inclusion of instrumentation components using LVOOP techniques. I found it quite educational and informative. All of the example code slides and scripts are there for download. Thanks Jason, I agree. I need to visit the link you provided and familiarize myself with HAL. The situation you are coding for sounds like the conceptual "ideal" poster child for OOP techniques. The architecture you use needs to handle the variability of hardware, tested units, operators, etc. that occur from maintenance/growth of long time use. This project will certainly push me into the LVOOP realm much deeper than I've ever been. That's where the fun is. Yes.. The architecture is tricky. That's why I decided to post this thread. Or am I over complicating it in my mind??? I think it is tricky.. Thanks guys! RayR Quote Link to comment
MikaelH Posted May 26, 2011 Report Share Posted May 26, 2011 Hi Ray To solve to problem with having tests running in parallel, I normally use Active Objects. I.e. I dynamically create a Referenced Based “Test” Object when needed, and when that object is created a back ground process starts. So for every Object that gets created a dedicated process VI in launched. http://goop.endevo.n.../DesignPatterns For the HAL layer, this is normally how my design looks like. Cheers, Mike Quote Link to comment
Grampa_of_Oliva_n_Eden Posted May 26, 2011 Report Share Posted May 26, 2011 Hi Ray To solve to problem with having tests running in parallel, I normally use Active Objects. I.e. I dynamically create a Referenced Based “Test” Object when needed, and when that object is created a back ground process starts. So for every Object that gets created a dedicated process VI in launched. http://goop.endevo.n.../DesignPatterns For the HAL layer, this is normally how my design looks like. Cheers, Mike Ray, OOP is al about "Patterns" and all I did was match your challenge with the posted solution. TO All, Any ideas on how to go about handling the "Who gets to use the multimeter now" question when multiple Active Objects are running independantly of each other? Ben Hi Ray To solve to problem with having tests running in parallel, I normally use Active Objects. I.e. I dynamically create a Referenced Based “Test” Object when needed, and when that object is created a back ground process starts. So for every Object that gets created a dedicated process VI in launched. http://goop.endevo.n.../DesignPatterns For the HAL layer, this is normally how my design looks like. Cheers, Mike Ray, OOP is al about "Patterns" and all I did was match your challenge with the posted solution. TO All, Any ideas on how to go about handling the "Who gets to use the multimeter now" question when multiple Active Objects are running independantly of each other? Ben Quote Link to comment
RayR Posted May 26, 2011 Author Report Share Posted May 26, 2011 I also have a question about the project and the organization of folders within the project. This is just the start of the project.. I'm refactoring code, so I hid that portion. Also anything that would identify this project has been hidden (erased from the image) to protect the innocent. The question on the project has to do with having the classes appear directly under "My Computer" within the Project Explorer. In one case, I placed the class inside a folder with the children classes. I do not usually put the lvclass inside a folder. However, I am also realizing that this is the first time that I have such relationships between classes.... For instance within the parent class "communications.lvclass", there are telnet, RS232, web-HTML and SNMP classes. How do they relate to the parent class within the Project Explorer, and inside the directory (folder) structure? Is there a recommended approach? Or rather a community accepted approach? I want to make sure the foundations are solid before I start building up this thing... Thanks guys! Quote Link to comment
Grampa_of_Oliva_n_Eden Posted May 26, 2011 Report Share Posted May 26, 2011 FOr agregate classes (classes that have in them other classes) I will generally use a library and put them all in the library. This helps on the VI hierachy screen since I can colapse libraries and focus only on the parts I am developing today. Ben Quote Link to comment
JoeLabVIEW Posted May 27, 2011 Report Share Posted May 27, 2011 (edited) Hi Ben, I decided to follow your idea of using lvlib for the aggregate classes. I'm at the point where I'm about to refactor the test engine.. Now my question is... Since the Engine must be spawned for each modem / radio combination being tested (minimum / usually 2), should it be a Dynamic Process? Or called from a Dynamic Process? Or should the engine core simply be re-entrant? Or should I create a Dynamic Dispatch vi? Or... should it be a Dynamic Dispatch set as re-entrant... and share clones between instances. I have difficulty wrapping my mind around the Dynamic Dispatch.. The glossary does not help...... "A VI that defines a method of a LabVIEW class. Dynamic dispatch member VIs are VIs with the same name that occur throughout the class hierarchy. Similar to polymorphic VIs, LabVIEW determines at run time which member VI to call. " The WIKI FAQ does not have a description for Dynamic Dispatch.. I think the way to go is to create a lvlib for the TestEngine and make it a Dynamic Process using a re-entrant VI... I may be wrong.. Suggestions anyone? (PS: yeah... it's my old nick... couldn't remember which email address I used for my other account) Edited May 27, 2011 by JoeLabVIEW Quote Link to comment
Grampa_of_Oliva_n_Eden Posted May 27, 2011 Report Share Posted May 27, 2011 Hi Ben, I decided to follow your idea of using lvlib for the aggregate classes. I'm at the point where I'm about to refactor the test engine.. Now my question is... Since the Engine must be spawned for each modem / radio combination being tested (minimum / usually 2), should it be a Dynamic Process? Or called from a Dynamic Process? Or should the engine core simply be re-entrant? Or should I create a Dynamic Dispatch vi? Or... should it be a Dynamic Dispatch set as re-entrant... And yes, I'm aware of the warning: "Reentrant VIs can only have dynamic dispatch terminals if they share clones between instances. This VI preallocates a clone for each instance. You must either change the terminal in the connector pane to not be dynamic or edit VI Properties to modify the reentrancy behavior." I have difficulty wrapping my mind around the Dynamic Dispatch.. The glossary does not help...... "A VI that defines a method of a LabVIEW class. Dynamic dispatch member VIs are VIs with the same name that occur throughout the class hierarchy. Similar to polymorphic VIs, LabVIEW determines at run time which member VI to call. " (PS: yeah... it's my old nick... couldn't remember which email address I used for my other account) The best I can do real fast is to show you the code. Go to my image gallery on the dark-side here. http://forums.ni.com/t5/media/gallerypage/user-id/9539/album-id/192 Starting with an image called something like "create new object" there is a series of images that show one method. there are are others but that is just what I have readily availabel to share. Dynamic dispatching in non-LVOOP terms. If you wanted to write this Vaporware we are talking about using non-LVOOP you would have maybe an enum that came along with all of your code that would select the proper falvor of code depending on the devices youare useing testing etc. This would be a lot of tedious work but you could do it. Dynamic dispatching moves that selection enum to the LV domain and LVOOP does the tracking and slection for you at run time without you doing anything other than describing the rules using the config options for the classes. have fun, Ben Quote Link to comment
JoeLabVIEW Posted May 27, 2011 Report Share Posted May 27, 2011 If you wanted to write this Vaporware we are talking about using non-LVOOP you would have maybe an enum that came along with all of your code that would select the proper falvor of code depending on the devices youare useing testing etc. This would be a lot of tedious work but you could do it. Dynamic dispatching moves that selection enum to the LV domain and LVOOP does the tracking and slection for you at run time without you doing anything other than describing the rules using the config options for the classes. Wait... wait... wait... This sounds a lot like what I already have.. To test the proof of concept, I created an array of enums and was headed to a QSM. The Engine is basically a state machine where the states are executed in sequence by picking the elements from the array of enums. I'm not going to go into why this is wrong. I know it's wrong, but it was for a Proof of concept. However, where it was wrong big time is that it handled the states sequentially by incrementing the index to the array. Now, in reality, it should have intelligence to figure out what the next state should be, basically the QSM idea where a new state would be inserted at the appropriate location within the Queue. Are you telling me that the Dynamic Dispatch is similar to what I described above? Am I on the right track? I will have a look at your gallery.. Thanks! I owe you some Kool Aid! Quote Link to comment
RayR Posted May 28, 2011 Author Report Share Posted May 28, 2011 I may have figured it out. I decided to create a lvlib for the Test Engine and within the library will be Dynamic Processes to which the TestEngine.vi will belong. I am creating a typeDef that contains all the objects from the Project Explorer so that I can access them from within the TestEngine.vi. I needed a project like this to fully wrap my mind around LVOOP. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.