Jump to content

drjdpowell

Members
  • Posts

    1,986
  • Joined

  • Last visited

  • Days Won

    183

Posts posted by drjdpowell

  1. Let’s try a different tack.

    There is an important difference between situations where one loop can affect another loop operating in parallel (a side effect), and where it cannot.  Globals, Locals, DVRs, Queues, Notifiers, FGVs, Action Engines, or the new "Channels” are all means where one can “reach in” and affect a loop while it is running.  Data on a wire is not. 

    An interesting talk related to this by AQ: Why Dataflow Works: The Potato and Candy Explanation

  2. 2 minutes ago, ShaunR said:

    Any class is a number of [atomic] methods acting on a protected storage container and this is what AEs attempt to do without the language support. 

    Ah, you mean the encapsulated data.   Your right, but you talked about a “shared resource” that might need “mutexes”, which is about accessing things from processes running in parallel.  By-value objects are not sharable and have no use for mutexes.  

  3. 23 hours ago, Neil Pate said:

    I am a bit torn on this one... I want to use ByVal as I think it makes debugging and scope easier to understand, but that means the class has to live somewhere, ok fine I have a "main controller" actor/process, so it can go there. However any time I want to interact with it I then have to create messages that the main controller can process. And then there is the issue of getting data out of it and usable by the rest of the application.

    I suppose for your example I would have the ForceCalibration object as a ByVal class in the process that is actually going to use it.

    I’m surprised there’s not more love for Action Engines.  I’ve never really used them, but instead have focused on making “actors/processes” easy to make and communicate with, and on having by-value classes live wherever it’s natural for them to live.   If they naturally need to live in an independent process, then it is easier for me to make it an actor than an Action Engine.  I’m not really negative on Action Engines, but they don’t give me capability that I can’t get with an actor, and as hooovahh said, I can do active, periodic stuff with an actor.

    I only very rarely use actual by-ref objects (usually using a DVR).  “ForceCalibration” would most likely by a by-value object for me, too.

    As a general programming principle, I believe one should standardize on a set of complimentary techniques (and get very good at those techniques), rather than mix multiple alternate ways of doing similar things.  Action Engines, “actors”, and by-ref objects are different ways of doing the same thing, so one should pick the one you think is best and run with it.

  4. Forgot to add that a goal is to make adding functionality to controls easy, ideally a single subVI that can be called multiple times with different graph references.  Customization is via references to simple subVIs used to generate the text.  Below is the code of the first example.

    Code for Twin Cursor Example.png

     

  5. 8 hours ago, JKSH said:

    This creates an undesirable coupling between the caller and the JSON library.

    JSON is an interchange format.  Reducing coupling between components is what it’s meant for, so it’s sad that we worry about unwanted dependancies.  The “variants that contain only strings and numerics as basic datatypes” that you are asking for are a much less flexible substitute to JSON text.  I would not be happy if I had to do lots of manual type conversion on everything that isn’t a simple string; that’s an undesirable dependency to me.

    Really, the best solution would be for NI to realize the value of a JSON-like datatype and build that into LabVIEW, replacing this library entirely with a much faster solution that can be widely used in interfaces between modules without worrying about unwanted dependancies.

    As an alternative, have you considered using the JSON text itself as the thing to pass on, rather than a variant?  Try this: replace your “data” Variant with a string labeled “<JSON>data”.  That tag indicates to the library that you want your “data” subitem as JSON text.  Pass that string across your subVI boundary.  If you are just using strings and numerics, then your Caller can use the inbuilt JSON primitives to convert very quickly into data, so it isn’t dependent on this JSON library.

    Personally, I solved this issue by deciding to make this JSON Library a standard component always used in all cases where complex structured data is passed between modules.  But then I did write the library.

  6. The attached VIPM contains an extension of Messenger Library that is intended to add extended functionality to controls/indicators, via a background process that is launched and which registers for the events of the control (the background process is a Messenger-Library “actor”).  This is meant to be an alternative to XControls.   Included are two “Augments”, both with examples.  See <examples>/drjdpowell/UI Augments/Examples/EXAMPLE Twin Cursor Graph Augment.  This takes any graph with two cursors and draws a line between the two and displays summary info of the data between the two cursors:

    Example Augment, Twin Cursor.png

    There is also a cross-section plotting for a 2D intensity chart:

    Augment, Crossection plot.png

     

    This package is in LabVIEW 2015, and requires Messenger Library (latest, in the LAVA-CR) and JSON LabVIEW and Shortcut menu from Cluster (both in the LAVA-CR).

    drjdpowell_messenger_ui_augments-1.0.0.8.vip

    • Like 2
  7. 2 hours ago, kull3rk3ks said:

     

    
    { 
    	"serverConfig": {  
    		"read": {   
    			"address": "164.3.157.40",
    			   "port": 5010,
    			   "bytesToRead": 130,
    			   "connectionMode": "Server",
    			   "connectionTimeout": 5000,
    			   "readTimeout": 2000
    		}
    	}
    }

    throws error 1 (Parser error)

    I quickly tried this string and I didn’t get any error.

  8. 15 hours ago, smithd said:

    My other question is, if you want these N actions to be taken synchronously without interruption, why not subVIs?

    I tend to use subVIs one layer lower down from the loop actions, as explained in this post.  One can have subVIs that represent actions of the loop itself (as the AF does, for example), but I usually find that to have (minor) disadvantages.

    • Like 1
  9. 21 hours ago, smithd said:

    My problem isn't with the enqueue semantics but with the idea that an external person should ever have to queue up multiple actions. I'd prefer separating the external interface (which in this case yes would be the macros) from the internal (which might take multiple actions based on the request/event which occurred.

    I agree, but the JKI “state queue” is not an external interface.  It cannot be accessed from outside the loop (it’s by-value, not by-ref).   Requests from external sources enter via the Event structure, which is only consulted when the “state queue” is empty.  “Macros” are multiple actions based on a single request/event. 

    Added later: my talk at the 2016 eCLA Summit was on how to handle actions like a subVI, though I forgot to mention that the JKI “state queue” can be used that way.

     

  10. I tested back-saving a significant feature that I want to add the Messenger Library, the "Graph Augment" UI stuff mention above.  Going to 2011 gave a long list of problems due to missing features (such as "Get Control Values by index"), but going to 2013 gave no error.

  11. I have stuff developed for a client in 2015, that I'd like to incorporate into this package, but I'm using the conditional and concatenating options on loop output tunnels (that came in after 2011).  So supporting 2011 requires a rewrite (and a more complex and lower performance solution).

  12. 2 hours ago, Thoric said:

    What's the reason for the upgrade, there a particular feature you want to adopt that's not available in 2011? Or are you simply abandoning older LV installs on your dev machine ;-)

    Bit of both.  My work code is 2015 (except for one 2013 client that I'll soon upgrade), and when I think I want to incorporate some of it into Messenger Library I am inconvenienced by the lack of some features I have used (such as the Concatenating-tunnel indexing option, or the "VI Deactivation" Event).  Spending time recoding to support LabVIEW versions that I don't intend to use doesn't make much business sense.  I don't think there is anything that 2015 has over 2013 that matters much, so I'll probably go to 2013.

     

    BTW, did you finish your big comparison of frameworks?  If so, care to give Messenger Library a review on LVTools?

  13. 12 minutes ago, ShaunR said:

    Basically. If you try and use events in "Event Driven" languages, the same way you use them in LabVIEW for 1:1. Everything falls over because the assumptions about the underlying mechanisms are incorrect. I think architectures should be language agnostic.

    How do they manage not to (implicitly, at least) queue up "events" that affect a serial-access resource?  Real-world events do have time-ordering (pick up the ball, throw the ball, catch the ball) so I'd be surprised if it would be useful to be agnostic about this.  Other LabVIEW features, like parallel calls on non-reentrant subVIs or DVRs, are all implicitly queued.

  14. On August 6, 2016 at 2:33 AM, smithd said:

    Seeing the command Macro::DoSomething makes me :( on the inside

    JKI State Machine “states” are actions that are executed internally by the loop.  Unless one deliberately calls the “idle” state, “macros” of states execute in an atomic and isolated manner.  That is not the same as sending a set of messages to another process, where you have no control over what other messages are executed intermixed with yours.  

×
×
  • Create New...

Important Information

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