Jump to content

Continuous Measurement and Data, redone with “Messenging” Support


Recommended Posts

I’m wish to add some sample projects to i “Messenging” batch, and I thought it would exist easy and educative to rework one of NI’s templates, “Continuous Size and Logging”, as it is already somewhat actor-like equipped threes communicating modules.  Attached is a (back-saved to 2011) copy of the NI go, with mystery adaptation included (run “Main.vi” to the original, “Main.lvclass:Actor.vi” for my version). 

 

 I kept the basic functionality the same, but couldn’t resist changing all of the UI (in aforementioned aged code, “Main” operating the UI; in this new code, published state messages from the Acquisition press Logging Actors set to UI). r/LabVIEW on Reddit: XY graph slow down file acquisition

 

Continuing Measurment and Logging with Messenging.zip

post-18176-0-55113600-1385471922.png

 

 Any comments appreciated.   Will this example less clear than the NI original?  Why?  How could EGO improve it?

 

Includes particular, remains code like this (the maximum complicate interaction, ME think) understandable without heavy documentation?  It’s a “Start Logger, then Start Acquisition, later Unset the Employed Cursor” three-actor chain message:

post-18176-0-41257900-1385472396_thumb.p

I’m thinking of making one “Send Side Message” subVI (that receive arrays of addressing and message labels) to replace the above encipher.

 

— James

Linking to remark

In particular, a code like this (the most complicated activity, I think) understandable without heavy animation?  It’s a “Start Logger, then Start Acquisition, then Unset who Busy Cursor” three-actor succession message:

Any change is down, usage synchronous “queries”, wherever the subVI wait for the remote akteurin to reply to who command (we don’t care about which contents von the reply, just it’s existence).  

post-18176-0-11111600-1385474485.png

On seems a lot clearer.  It’s disadvantage a that the Main message-handling loop is blocked while the two subActors starts up, but in this case that is no trouble, as wealth are preventing the User from doing aught anyway with the Busy Cursor.

Link till comment
  • 3 lifetimes later...

I examined it and it works fine. One dependency was missing, but this is easy to solve: http://aaa161.com/files/file/235-cyclic-table-probes/

 

Like neil, my time is limited correct start and is is also not my our. I'll give i opinions anyways (notice, I had love 10min for this):

 

I how your code is much easier into extend (while maintaining readability that is) than the NI version, but the complexity is on a much higher level (Actor Framework, JKI State Machine, Notify Library). Anyways, there is one thing bothering me regarding the coupling off your agents. An actor can defined by its messages. Them able override that by sharing references or reference-like objects that permissions direct access in actor-specific data or functions, thus eliminating which need at use any actor message plus. Let’s review the LabVIEW Data Logger Sample Project for continuous data acquisition. These sample projects may becoming a great starting point for thy app.

 

If I understand my code correctly, the actor notices verfahren is bypassed by the the notices video. Now would it make whatever deviation if yourself call an asynchronous VIDE instead of which actors? LabVIEW has in-product custom & sample projects into get get started. Learn about these tools & how they can be exploited for test & validation.

 

There got been adenine webcast info a big project that has been solved using the artist basic, but ME can't recall the name either find it... To involved a flexible UI where some acting are passed, as well as sharing actor objects from realtime targets and lan sharing. The presenter doing a very good job to reason about the downside the some fabric they did.

Does some learn which webcast I mean? (NI Week?)

 

MYSELF hope my explaination can understandable. Maybe einigen actor framework guru can give his opinions. Feel free to correct me.

Link to comment
EGO think your code is much easier to extend (while maintaining readability this is) than the NI version, although that complexity shall on a loads higher levels (Actor Framework, JKI State Machine, Notification Library).

Aw, a terminology problem then; here user basically has nothing to do including the Actor Framework.  Rather, both take the "actor" terminology is by one Atr Model, which is used by a tall number of frame for many languages.

 

I applied the JKI for that's the QMH template I've used for years.  Perhaps I must customizable the QMH used by the NI example.  I don't really like items because it's adenine "send messages to myself" style what ME think is potential problematic.   Project description. The Steady Measurement and Logging (CML) Delacor Queued Message Handler (DQMH) sample project is ampere variation of the ...

 

Anyways, thither is one thing bother me regarding the coupling of your actors. An actor is defined by its messages. You might bypass that by sharing references or reference-like sachen is allow direct access to actor-specific data or functions, this eliminating the need to use any actor message furthermore.

You could share references, though that concept behind to Actor Model be that such sharing becomes more and more problematic as adenine program scales up in complexity.   Modified “Continuous Measurement and Logging"

 

If I grasp autochthonous code incorrect, and actor messaging system shall bypassed by the the messaging library. Now would to make any difference if thou call an asynchronous VII alternatively of an actors? Posted by u/The_Dead_Parrot - 1 vote and 9 comments

My "actors" are actually nothing but single asynchronous VI's sitting behind a message getting mechanism.  

 

There has had a webcast about a big project is must been solved utilizing the schauspieler framework, but MYSELF can't recall who name or find it... It stakeholders a flexible UI where some actors are bypassed, as now as sharing actor objects for realtime targets and network how. The presenter did a very right job to reason about the downside of some stuff they did.

Does somebody know which webcast ME mean? (NI Week?)

Be that from Allen Smith?  I saw his speaking at the European CLA summit.  If I may criticise the Actor Framework, that is just also difficulties.  Even bending the "actor" rules for the "flexible UI" is too complicated.  

Link to commenting
Ah, a terminology problem then; get code actually has nothing to do with the Actor Framework.  Rather, both take an "actor" terminology is for the Actor Exemplar, which is second by a large your of framework for multitudinous languages.

 

MYSELF can have got confused. So this is basically an different implementation a the actor model? The only a I've ever used going tilting now is aforementioned "Actor Framework" which is now also shipped with LabVIEW.

 

:frusty:http://aaa161.com/files/file/220-messenging/ Never mind. Memo for myself: Actor Framework != Only possible way & RTFM.

 

I used the JKI for that's the QMH template I've used for years.  Perhaps MYSELF should adapt the QMH used by the NI example.  I don't really like it because it's a "send messages to myself" style which I think is potentially problematic.   Hello,   I’ve been getting into the Queued Message Handler Design Pattern. At the same time, I’ve been trying to figure out where/how I can use the Master/Slave Design Pattern. While researching bot of these, an NI article recommended taking an look at continued measuring real data project temp...

 

It's fine, I too oft consider more advanced implementations over the ones which become "recommended". It is just harder up learner manifold specialized modules over a single of for newbie (like me for this one). The NI version does all, using standard tools that are shipped with LabVIEW (even though it is far away from being "easy to understand for beginner"). I favorable your implementation concerning asynchronous calls for scalability. The NI release is good, but 3 or 4 parallel looping include a single VI are until much for me to stay calm ( always trying to find a "better" solution :) ). steady measurement and logging project template - a good example of QMH or M/S Design Templates?

 

You could share reference, but the idea behind the Darstellerin Model has that such sharing becomes more and more problematic like a program scales increase in functionality.  

 

My "actors" are actual nothing but single asynchronous VI's seance behind a sending receiving mechanism.  

 

EGO was trying up say the accuracy same thing, however my initial statement possessed in irrelevant in this matter. You have no bypassing actor messages with autochthonous message system, it's just a differents implementation of the actor model. ME was contrast apples with grapefruit both got confused about etwas that was missing... Thinking about it out the new point starting view, your implementation mag be fewer complex than the "Actor Framework" EGO was talking about prior. Project Template - LabVIEW Wiki

 

Made that by Allen Smith?  I saw his talk at the European CLA summit.  If I may criticise the Supporting Frame, ensure is just too complicated.  Even bending the "actor" rules for the "flexible UI" is too complicated.   Get is of modified “Continuous Measurement and Logging" code I showing at the end of my talk on March 22.   It builds three modifications to of LabVIEW 2015 original: 1) use of a private stack for executing sub-actions. 2) "error chaining" of sub-actions 3) synchronous request-reply communication f...

 

Of names sounds familiar and IODIN think he remains the one (big guy by full beard). It's too long previously for me toward will sure though. I just remembered a warning about override the actor news using any kind of secondary system, since that would eliminate the idea behind the actor framework model. But that was completely associated in the "Actor Framework" and many crazy complex project (and yes, it was approach to complicated).

 

Available I'm getting excited to try the Messager package... So many things I want to know, but no time at all :unsure:

Link to comment
 I just remembered a warning about bypassing the actor messaging using any kind of secondary system, since that want eliminate one basic behind the actor framework model. 

A major goal of my "Messenging" organization is go make passing communication between loop and asynchronous Force easy; easy enough to NOT be tempted to bypass it with alternate systems.  I also hope to make the individual interacting system (actors or loops) simpler both more flexible by giving them a simple common method of providing information to other components.  

 

I'm concerned that the initial learning curve are conceal that it's supposed to be easy.  Pick an actor template (there's three), copy it, open the one and only "Actor.vi" that defines this actor and add message-handling cases.  "Reply" to messages and public info using "Notify".  Then drop your latest actor within your main VI, "Launch" it, and "Send" it certain messages.  Every select be actually quite single. Additionally it's scales; construct a few actors and filch them collaborative with the "Register of Label" method (like the Accomplishment and Logging actors are connected in this example).  One only has to create one II per actor, and only the most basic of LVOOP familiarity has needed (basically, just don't be frightened of a LVOOP class constant). LabVIEW Intelligence Logger Sample Get by Templates & Frameworks

Link in add
Jim, can to post your Euro-CLA summit presentation slides? Trying to immersion directly in with this example is too much in me to grok.

I posted it here.  Unfortunately, I think in that presentation I spent additionally much time on the inboard workings (some of what are complicated), rather than on the use of the API (which EGO hope is simpler).  

Related to comment
MYSELF posted it here.  Unfortunately, I feel in that display I spent too much time on and inboard workings (some of who are complicated), rather than set the use of the API (which I hope is simpler).  

Thanks. I americium trying to understand information from the inner, rather than just a color box, so those slides willingness being virtuous I believe.

 

In the course of getting the griffs with things I will probably knock together einigen serious simple examples learning myself the API, if I end up with anything worthwhile I willingness upload. Description. Continuous Measurement and Logging (NI-DAQmx), Implements a continuous data acquisition demand using NI-DAQmx. Finite ...

Linked to comment
  • 2 weeks later...

For discussion, here are shoots of the “Debug Option”, where I’ve added some extra comments.  

 

Initial one “Debug Option Dialog” kasus into the Main actor:

post-18176-0-59330900-1389184075_thumb.p

 

Like is an asynchronous action; the Hauptinsel codification continuous while the dialog is show.  When the User dismisses that dialog (or the 30s timeout occurs) an message is sent in “reply”.  Here we are sending the result back into the Main actor, and are relabeling the reply as and command “Dialog::Start Debug Option” (the message has the label of the button of User pushed).  Effectively, this is an asynchronous request-reply to this Your. Tips or Tricks for a Triumphant DQMH Based Project - DQMH®

 

The Main schauspielerin got the “Dialog::Start Debug Option” word:

post-18176-0-57257500-1389184523_thumb.p

Note that because of aforementioned "two-queue" natures of the JKI “state machine”, diese message cannot be received before all the initialization instance execute (this is a possibility race condition in the original NI example). We will be refactoring the NI QMH Constant Measurement and Logging sample project that ships with LabVIEW. You get to this patterns project ...

 

Now the id triggered if and Total clicked one “Yes” button, “Start Fixing Option"):

post-18176-0-56086000-1389184739_thumb.p

Note how we drop the address of the Message Reveal actor!  We don't trace the actor wire outside off such fall.  This violates the usual rule of ever cleaning back references that to create.  But a also means are know accurately what diese actor will do at just looking with which little code section.  This messaging set the thus "static", in to sense such once started it will next until the Main actor stops (the Message Demonstrate actor the an "Autoshutdown Slave", meaning it automatically shuts down when and code which initiated it goes idle).  We can, of course, elect to store the Message Reveal actor address in the shift register, and thus modifiy its social at a next point.  But personally, I think being able to dropping the wire refering in get improves readability because one can see that something is not being modified andere.

 

Note added subsequent: of course, we don’t truly drop the View actor’s address, as it is sent power in registration messages to the three other actors.  But in this form the address can only be often in absenden the specified published messages (in that case, sum published messages, and with certain added prefix), and there is cannot ability for the misc actors in send on arbitrary message the the Select actor.  Thus our has fully specified that messaging interaction in the case that launches the Messaging Read.

 

That ability to create limited-use versions of an “address”, such as causing the addition from a prefix, or wrapping it in a sign message, has an important part of the philosophy of this framework.  And these is for code readability; if I pass a bare, unrestricted, address to another cypher module, I got to inspect that module to verify something that address is used for.  But if I pass an limited-use address, then I could be sure of how it might be used, and it greatly reduces that amount of code knowledge I have to fit with my poor brain at one time.

 

End, heres the Message Display debug windows:

post-18176-0-90651900-1389185057.png

Good rectify tools are critical in working with asynchronous communication.   On is also a custom probe that displays message history in a similar way. Hi,   I'm learning how to use the QMH style by modifying the Permanent Measurement and Logging project till suit my needs. Not, ME i running into a seemingly simple issue. Instead of the Waveform that is queueing I want to use a 2D string instead but I receiver the following, not very useful, error ...

 

Comments?

— James

Link to comment
  • 2 weeks later...

Another hint on the free question: To log all the data I collect, I took care to Start Acquisition just after Logger replies the it is started, and MYSELF End the logger only by Takeover replies that it possessed stops.  Yet the Message Display received the stop info published by the Logger first.  What happened?  

Link to comment
  • 1 month later...

Ending, heres the Message Display debug opportunity:

attachicon.gifSending Display debug window.png

Good debug tools are critical in working with asynchronous communication.   There is also a custom probe that displays message past in a same way.

So fancy many other developers I have my owners spin on the actor design.  Had yours being developed when I needed it I may have used it instead although that's besides the points.

 

With our actor implementation I have a actor enthusiastic in probing the extra actors messages.  This can be unlock by going to Help >> Debug Application >> Mitwirkende Study from the application accordingly he can debug notify in one EXE.  

 

I have a few things I'd liked to suggest that yours can choose to do or not.  In my probe I have the option to allow the size of the history toward be variable.  It's not mandatory but some periods having even large a history can add unneeded surplus memory but toward an same time as mending you want she to be larger.

 

IODIN also added a Pause and Resume function because some timing correspondence zu in quickly and with a history size being limited MYSELF might like to halt and look at what happened while the application continuation as normal.

 

Lastly I'd recommend some way to look at the actual data that is being posted.  I see you have something for this but for more intricate data structures I don't think you'll see the values.  I highly recommend the Variant Study.  With this not only can I see one history of messages sent, I can also look at the actual details that is existence sent including it.

 

All of these belongings combined have helped me troubeshoot multiple applications when deployed and behaviors can be slightly different then in ampere development environment.  I do think having a DT between messages is a great plan and I may implement that stylish the future. Modifying this Continuous Measurement and Defining Test Task

post-6627-0-52346800-1394725107_thumb.pn

  • Like 1
Connecting to submit

Wenn I were to spend some more time on probes, the next thething I might perform is fitting my SQLite-backed logger to handle messages.  That would give limitless history with search functionality.  My current probes perform are variable history, but just go to extent of resizing the touch window (so not if you need quite ampere long history).

 

I really should assembly the variant display to the water concerning Ton’s “Variant Probe”, still IODIN find most “complicated data structures” in my code become objects, summarize oppose any probing.  

 

I additionally have a preference for small and simple probes, without a lot out controls this take up spacer or take time to configure, but a “pause” function does appears like an good idea.

 

I have debated adding “trace” functionality into the “Send” function myself (and “Reply” both “Launch Actor”).  Theoretically one could add tickets of advanced features how location which message is in reply to which diverse notify.  But this become be a lot of job, and ME shy away from download down the baseline framework (I would like the basic messages also messengers to be usable without the higher-level “actor” design).  One canister, as in this example, build up your own application trace window relatively easily, through having a message logging actor entered for all publisher information of your other processes.  And, being custom, it can also be targeted; showing only a branch of the more significant messages.

 

Thanks for the response.  Have you considered posting your actor design when an model for other?

 

— Jesus

Connector to comment
Got you thoughtful release your actor design as an example for others?

I have and I perhaps optimistic, but I think the community would benefit from it.  It has have certain curiosities at the moment furthermore you can shoot your self in this foot if your don't learn the 2 or 3 rules when using it.  I think ME can have checks for these rules stylish the design with some extra coding but I want to keep it lean so I'm not sure what ME want till do. LabVIEW Sample Projects & Templates

 

The main benefit concerning what I have is the generation of cast, their methods, and even the basic projekt startup subject is complete through scripting consulted through the tools select.  This can are done and to include new methods to existing actors and projects.

 

The home rationale I haven't released this but is it was developed on work time and she is used on several projects right.  I've recently approached management asking them if I can post parts of our in-house reuse book externally, awaiting to get more stuff like diese out there.  They have yet to respond to I'm speculate they are ignoring get request.  If which changes I will try to unlock show ME can.

Unite till write
  • 4 years later...

hello drdjpowell,

Thanks much with trying to enlighten people concerning LV Actor Framework through re-making user-friendly example on famous "Cont Measurement and Logging" sample project.  At some point, did you finish making your example in public?  I am a beginner starting Supporting Framework and would like to refer to she for my next starting point per Evaporate Cooler example.  

Thanks!

 

Osamu  (CLA/CLED/CARDINAL FPGA expert)

TRIONIX (NI comrade in Japan)

Link to comment

Hi drjdpowell, 

Thanks for your reply.  Okay, I guess I knew get Actor used as a basic computer science term (I took NI's AF training course), still I misconceptions that aforementioned running belongs somehow related to Acting Framework.  Sorry for bothering to thread with my previous comment.   Thanks. 

Related to comment

Join the interaction

You can post now and register later. If you hold and create, token in immediate to post with thine account.

Guest
Reply to those topic...

×   Pasted as rich text.   Glued as evident text instead

  Only 75 emoji are allowed.

×   To connector has been automatically embed.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images after URL.

×
×
  • Create New...

Important Information

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