Jump to content

Mark Balla

Moderators
  • Posts

    607
  • Joined

  • Last visited

  • Days Won

    41

Posts posted by Mark Balla

  1. I just learned about this little guy at NI-Week this year,

    post-5958-0-02633600-1314798251_thumb.pn

    I have only tested it briefly so far, but I believe you get us resolution with this as well.

    /J

    I wouldn't rely on it too much.

    There is a reason it is not in the pallet

    I remember this issue being discussed previously.

    From this simple test vi I built you can see that it is very inconsistent compared to the other methods.

    post-584-0-43053900-1314881021_thumb.png

    I am curious to know what NI Week session discussed this vi.

    My guess is that is is designed for RT targets.

    Mark

  2. I did take videos off every session that I went to with my new hd camcorder that I recently purchased. the problem is that a 1 hour session in about 5.5 gigabytes worth of data. This makes it difficult to post or stream.

    Michael also has copies of all the videos I took. we are trying to figure out the best way to get the videos to the community. Either throug VI shots or Lava.

    Also it's very likely that the most popular NI presentations will be respun into webinars in the future.

    • Like 1
  3. Question: what if I wanted two or more of the same module. Say, I wanted to make your "Waveform Module" reentrant and use it in two different ways in my application, with the "UI Module" interacting with Waveform Module A, and, let's say, "Simulated Temperature Readings" (STR) Module interacting with Waveform Module B. Is there a way to direct the messages to only the correct module (UI to/from A and STR to/from B)?

    If not, I would not be able to operate A and B independently, as they both act on start/stop messages from either of the other two modules.

    I see two possible ways to approach this issue.

    The first would be to create two separate Msgs for each, Start A and Start B.

    When the reentrant waveform Module goes active It figures out which type of module it is A or B and then registers to receive only those Msgs.

    The second would be to design one Start Msg with an enum that indicates the start type.

    The waveform module would have to figure out it's correct start enum setting.

    When the UI sends the start Msg it sets the enum to the correct type.

    Both reentrant waveform module A and B receive the Msg but if the enum is not the correct type for that module it is ignored.

    Both methods require that the module have some way of discovering what Msgs it cares about or what specific waveform module it is.

    This will create some additional coding to make the module more intelligent.

    The benefit IMHO is you have a very loosely coupled, more reusable, debug able, testable module.

    Aside from the framework parent class dependencies, Each module is stand alone and totally independent of its caller or callees.

    It's up to the module developer to figure out how to register, react and send the correct Msgs.

    Hope this helps

    Thanks for reviewing the framework

    Mark

  4. Hello Everyone

     

    I've been following this thread intently and comparing the comments to a framework that Rob Humfeld, and his team at JET and I have been working on since the CLA summit. Rob presented an idea that he and his team were working on called the JAMA framework. I was able to video record the presentation and the next week when I got the code from Rob I dove in and began working with it. Since then we have made many refinements and used classes to make the framework more powerful.

     

    Since this thread has discussed many of the issues that we have tried to design into the framework I thought this would be a good time to introduce it in its current version. At the CLA summit someone said that this framework was akin to an observer pattern. Since I wouldn’t know an observer pattern from a quilt pattern I will leave it up to others to decide what it is. I currently call it the Msg_Routing framework the fully tested version will come  from JET sometime later this year.

     

    The framework has 4 major components Modules, Msgs, Couriers and Routers. There is a 5th component called Module Router but it is not necessary to use the framework

     

    1. Modules are any vi that needs to sent and/or receive Msgs. To work within the framework the Module will need to create and manage a Courier and a Router for each Msg</li><li><font face="Calibri">2.      </font>Msgs is a defined data set that is transferred from one Module to another.   All child Msg class will inherit from the parent Msg class.</li><li><font face="Calibri">3.      </font>Couriers: An abstract class which is the Msg transfer mechanism by which the Module will receive messages. A Module will create a courier child class and register the class to receive Msgs. Child classes Queue_Couriers,Event_Couriers, and Notify_Couriers  are already a part of the framework</li><li><font face="Calibri">4.      </font>Routers: These hold the information that tell a shipping Module how to get it’s Msg to other Modules. A Router is created for each Msg and they share the same name. A Router is a named single element queue so all Modules can access the same routing data. The Router’s data is an array of Couriers.</li></ul><br><br>Framework features<br><br>Modules are totally autonomous and can connect and disconnect from the framework at run time without affecting other Modules. The Module is responsible for connecting and disconnecting to and from the framework and is not dependent on its caller for anything. Modules have no knowledge of each other only the Msgs they deal with.<br><br>Modules are responsible for creating and destroying their own Msg transfer mechanism called Couriers. One of the attributes that I have use from the Actor framework is that a Module is responsible for creating and destroying its Msg Courier. Callers no longer have to create a reference and pass it to the callee. <br><br>Msgs are Global in scope and are usable by all Modules. Any Module is allowed to ship or receive a defined Msg. Msgs and Routers are the only two things that connect Modules to each other making this framework very loosely coupled. <br><br>The Msg transfer mechanism or Couriers is abstracted. This allows one modules to use "Events" to receive Msgs and another to use "Queues". The decision to use Queues, Events, Notifies, or any other is made on a Module by Module decision and does not have to be a system wide constraint. <br><br>A Module must register for every message that it wishes to receive. To receive a Msg a Module must find the Router and place it’s Courier in the routers shipping array. <br><br>To send a Msg a Module gets the Routers shipping array for the target Msg and ships the Msg to each Module via its Courier. Data consistencyis maintained because Msgs are copied and sent to Modules not stored. <br><br>Here are some diagrams to help visualize the framework. They correspond to the demos in the attached code.<br><br> post-584-0-31639700-1310965017_thumb.png<br><br>post-584-0-03780300-1310965016_thumb.png<br><br><br>post-584-0-55132500-1310965013_thumb.png<br><br><br>post-584-0-88885900-1310965020_thumb.png<br><br><br>Developers<br><br>Module Developers only need to care about few things to work within the framework. What messages to receive, how those messages will be received and what messages to send. Developers can choose which method of Msg transfer works best for the module requirements by using a Courier child class that implements a specific mechanism. Only the Msg format is defined by the frame work how those Msgs are sent is up to the developer.<br><br> <br><br>Major Points<br><br>Msg transfer is completed without any kind of mediator loop.The Msg Router provides the information on how to send the Msg and the Module Shipping the Msg does the actual work.<br><br>Because it is the shipping Module that does the shipping and not another mediator loop, there is little loss in performance. <br><br>Modules are only coupled by Msgs and not the way in which they are transferred.<br><br>The full framework is attached complete with code, demos and images. It is written in LV 2010. <br><br>To start using the framework load the project and open the [Module Tree].vi all of the instructions are in the block diagram.The diagrams and instructions are inside the cases of the case structure.<br><br>Please let me know what you think of the framework good, bad or otherwise.<br><br> MSG_ROUTING.zip<br><br>Mark

    • Like 2
  5. Below I have posted a link to a set of DAQmx tools that allow you to integrate the NI MAX Assistants directly into your code! The attached .llb includes all of the files you need to try out these VI’s which will let you call assistants to create or edit DAQmx channels, tasks, and scales! (Obviously you will need to have MAX installed to use these, and they support LabVIEW versions 8 and up.)

    You didn't mention this so I will for others benefit.

    The VIs in the DAQmx tool kit are locked meaning the code is not able to be seen.

    Would you be willing to share the code with us?

    I'm sure many members would be interested to see how this is done.

    Mark

  6. I'm teaching an introductory programming course using LabVIEW to 30 college freshmen, as part of a comparison study of text based vs. graphical programming. To match curricula, I need to include two days of object oriented programming. There are lots of great examples of how to do this, but I need to find a compelling example that shows why it is used. Is there some simple application that involves solving a real world problem, that becomes much easier, or much more obvious when OO concepts are applied to the solution? I'm drawing a blank, and have posed the question to several colleagues, and have them puzzled as well.

    Stuart

    The project I am currently working on processes and displays data in specified ways.

    The User determines what and how data is calculated as well as what will be displayed.

    Initially the "User" was a person. There for several dialog vis were created to extract the needed information before the application could continue.

    The project has expanded and the user is not always available to enter in the information.

    In one case the program will extract the needed information form a file.

    In another case the information will be queried from a PLC.

    Extracting data from each of the different sources requires very different methods

    User: Ask user using dialog vis

    File: Find Open and read data.

    PLC: Setup connection read tags

    To solve this problem I created a parent "Data Source" Class

    and 3 children User, File, PLC,

    Later if another data source is requested I simple add another child

    The "Get Data" method is overwritten by each child using dynamic dispatch.

    Hope this helps spark and idea for you

    Mark

×
×
  • Create New...

Important Information

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