Community Nugget 4/08/2007 Action Engines

Action Engines, What are They?
“An action engine is Ben's term for a functional global which includes extra actions other than just holding the data.”
 (tst , 03-13-2007 01:18 PM)
In a nut shell tst has nailed it except for the “Ben’s term” part. I was originally exposed to the term "Action Engine"
by reading the book ""LabVIEW Applications Development A Course on Advanced LabVIEW Programming Techniques*”.  But
before I get into details of the Action Engine (AE), I will attempt to clarify some terminology.
Functional Globals
Functional Globals (FG) are VIs that are functionally equivalent to LabVIEW globals. Functional Globals store
information. You can read them or write them and that is it. No fancy stuff. Functional Globals are also referred to as
LV2 globals because LV2 did not have globals but it did support Un-initialized Shift Registers (USRs). The USR is the
entity that stores the information.
USR.jpg
USR’s
Shift Registers (SR) come in two varieties “Initialized” and “un-initialized”. The presence or absence of a wire
feeding the SR from outside the loop distinguishes how LabVIEW will implement the SR. If there is NO wire feeding a
shift register (A), then the SR is not initialized. This is called an “Un-Initialized Shift Register”. The USR variety
is implemented as static buffer that is re-used from call to call. The values written to the USR in and earlier call
persist for access (B) in latter calls**. A Functional Global exploits this behavior by implementing two methods of
interacting with the contents of the USR.
Functional Global.JPG
In the “Write” action (not shown) the value of “Numeric in” is placed in the USR. In the “Read” action the contents of
the USR are returned via Numeric out.
Action Engines
An Action Engine (AE) can be thought of as a machine (Engine) that performs some useful task (action) often on
something (typically but not limited to data in a USR). Functional Globals are very specific type of Action Engine.
They have two actions “Write” and “Read”. They operate on the data stored in the USR either by replacing or using the
contents of the USR. So AE’s are a superset of Functional Globals. In many documents the terms AE and FG are
interchangeable. A recent poll on LAVA has indicated that Functional Global is the most popular term. Since this Nugget
was prompted by answering the question “what is an AE?” in the remainder of this document you will find that I will
generally use the term AE.
Do What to What?
AE design revolves around the ways the shared resource must be accessed manipulated or monitored. In a Functional
Global, the actions “Write” and “Read” are appropriate. That is not necessarily the case for AEs. AEs can have entirely
different set of actions depending on the interaction requirements for the information stored in the USR. A short list
follows.
 A Configuration AE could allow for multiple processes to share a single copy of the system configuration (in a USR) by
providing actions like “Set Device ID”, Set Device ON-Line…
A hardware device can be realized as an AE that presents actions appropriate to the physical phenomenon being measured
or controlled.
A DO Port Controller AE could store a reference to the physical device in one SR and the port status in another SR and
have action like: Set Main Motor On”, “E-Stop”, …
An Instrument can be implemented to store the device name and settings with actions like “Set Input ON” “Auto-Scale Y”
and “Get Trace”,…
Screen Stacks can be implemented by using control references in one USR and maintain a screen view stack in another
then implementing actions like “Set Config Screen”, “Set Login Screen”, “Back”…
Users can be managed using an AE with action such as “Add New User” “Set Password”, “Disable User”…
The list goes on and is limited only by our imagination. Here is an example that shows how a running average can be
maintained.
Running_Average_Example.jpg
Running Average Example
The Running Average Example shown above shows how a running average can be maintained using an AE. The AE is
initialized before the While Loop executes. On each iteration of the loop the simulated measurement value (random
number) is used to update the history of all measurements (Add Number(s)) and the mean is calculated (Calc Mean).
Please note that although the buffer of all measurements is affected in every step of this example, the buffer (USR in
the sub-VI) contents are never part of this VI’s diagram. Since the history is stored in the sub-VI, the history can be
acted on from more than one thread as shown below.
Parallel_Loops.jpg
In the parallel Loops Example the history is initialized and then two loops run in parallel with one updating the
history and the other plotting the average. Since the History resides inside the USR of the sub-VI the two while loops
are effectively sharing the same block of memory, the block used to store the USR. The Sub-VI was implemented as shown
in the following sequence of images.
Init.jpg
As was the case with Functional Globals, the actions are implemented as a type def’d enum***** driven case structure.
Appropriate code is present in each case to realize the intended actions. In the “Init” case, contents of “Array in”
are used to initialize the history. In our example above we did not pass an initial array value. Therefore the “Init”
resets the history (cleared the array).
Add Num.JPG
The operation of the AE when the “Add Number(s)” action is called varies depending on its usage. If the caller passes a
non-empty array, it is appended to the array. Alternatively, passing a value via the Numeric in” control, and leaving
the “Array in” un-wired adds a single element to the history. We used the Numeric In input so we were continually
building our history one value at a time.
Calc_Mean.JPG
When the “Calc Mean” action is invoked, the average is calculated and returned.
This Nugget is continued in the next post
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction
Solved!
Go to Solution.

Nugget continued
The Traffic Cop Behind the Scenes
A detail I have not mentioned up until now is that AEs should be implemented as VIs that are not reentrant***. VIs that are not reentrant can only be executing in one context at a time. LabVIEW will ensure that if there is ever a situation were two contexts are attempting to act on the same AE at the same time, LabVIEW will schedule the first and the subsequent will wait until the first call completes. This is similar to a traffic cop preventing more than one vehicle from entering an intersection at the same time. The Traffic Cop is illustrated in the following timing diagram were we look at how the processing of two threads is affected by using a single AE.
Execution_Timeline.JPG
In the figure above the processing time of two processes “P1” and “P2” are illustrated by a red or blue solid arrow respectively. In the parallel loops example shown earlier, P1 could be the “Calc Mean” loop and P2 could be the “Add Number(s)” loop.
 t0 - t1
Both processes are executable and run their assigned tasks. Neither process is accessing the AE.
t1 – t2
P2 continues to run while P1 calls the AE. Since the AE is idle it is available to run so P1 continues execution running inside the AE until all work inside the AE completes. The dotted arrow shows that the thread for P1 is executing in the data space allocated for the AE.
t2 –t3
At t2 the AE terminates and both process run as in t0 – t1.
t3 – t4
This time segment is similar to t1 – t2 with P2 running in the AE.
t4 – t5
Similar to t2 – t3 the AE terminates and both process run.
t5 – t6
Similar to t1 – t2. P1 take control of the AE.
t6 - t7
At t6 P2 attempts to call the AE. Since the AE is not idle it is not available to run. P2 is placed in a resource wait state (it is NOT running) waiting for the resource to become available. The dotted horizontal arrow indicates the process is not executing.
t7 –t8
At t7 the call of the AE by P1 that started at t5 completes and P1 continues to execute outside of the AE. When the call by P1 completes the AE becomes available. The process P2 is marked as executable. The scheduler includes P2 in its executable threads and the AE is available. P2 then executes inside the AE until the call completes.
The Beauty of the AE
This behavior of a non-reentrant VI is a wonderful feature we can exploit to eliminate race conditions. Race conditions are the nemesis of many a developer. In hardware this was solved with clocked enabled logic. In LV we solve race conditions with Queues, Semaphores, Rendezvous, Occurrences, and Action Engines!AEs can eliminate race conditions when all operations involving updates of the data stored in the USR are done INSIDE the AE. A very simple illustration of how the encapsulation of USR manipulation is shown in the following set of examples.
Port_With_Global.jpg
This VI is intended to demonstrate how two bits of an eight-bit port can be used to control the running state of two pumps. To illustrate the control process, one pump will be set running at start-up and then every half second the state of both pumps will be toggled to simulate switching of the supply. This example uses globals and fails miserably.
Port_With_Global.jpg
In this example we start out by initializing a global variable so that bit “1” (zero based) is the only bit set in an array of eight bits. This turns on Pump 2 to start. Then the “Port Update” and a “State Change” loops run in parallel. In the “Port Update” loop the state of the port is read from the global and used to update the GUI.
In the “State Change” loop, the port status is read and the first Boolean is inverted before being written back to the global. Similarly for the second Boolean. Since the read of the globals both occur before the subsequent data processing, one of the threads will be processing old data.
Port_With_Action_Engine.jpg
The Action Engine version codes up the same way as the global version but now all of the data manipulation of the port states are encapsulated in the Action Engine  “Port Controller”. This encapsulation ensures all operations involving the data in the USR are forced to happen sequentially even though we did not have to implement any code to achieve this affect.
The key point to take away from this example is a shared resource (the port status in the case) when implemented as AEs come with resource contention resolution built in provided that all manipulation of the shared resource takes place inside the AE.
Action Engines to the rescue!
Action Engines are not a replacement for Queues, Rendezvous and the other synchronization techniques. They are typically called for when your design dictates that a single resource must be shared by more than one parallel process and none of the LabVIEW provided techniques are sufficient. They require a design of their own to ensure they work correctly. They also have to be developed and supported.
This Nugget is continued in the next post
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction

Similar Messages

  • Community Nugget 5-Mar-2007

    Type Definitions Let You See Your Application in a Different Way
    “THE ESSENCE OF TYPE DEFINITIONS IS THAT IF THE TYPE DEFINITION IS CHANGED ALL "MEMBERS" WILL CHANGE THE SAME WAY.” (Albert Geven LabVIEW Champion )
    Type definitions are a wonderful yet under utilized feature of LabVIEW. They allow you to manage the data types of your application in controlled manner.
    Type_Defs.png
     In large applications they can save you hours of work. I have had the opportunity to work on large applications developed without type definitions. These opportunities are seldom quick and easy to change. I have found it to be well worth the time and effort (both of which were considerable) to introduce type definitions as the first step in modifying an existing application. If your application has more than one sub-VI, your application will probably benefit from the use of type definitions.
    Type definitions (type def’s) are implemented in LabVIEW as custom controls. Type def’s allow you define the data types*** used by your application. Once a type def is defined and used on a front panel or block diagram, LabVIEW will ensure that all instances of that type def remain consistent with the definition. This means that if you edit a typed definition and save the changes, every place where that type def is used will be updated automatically. This is particularly useful in the case of enums when they are used to drive action engines**** or state machines.
    Through the use of clusters, you can establish a hierarchy for your data if appropriate. As shown in Hierarchy1.png the hierarchy screen offers a button to control the visibility of type definitions used by your application. By using Type definitions consistently throughout an application a developer can easily determine which VI’s will be affected by a change to one of them.
    Hierarchy1.png
    In the case of the Demo shown above, we can see that the top level VI “Demo” needs to know about changes to the action provided by the sub-VI “Caller”. We also see that changes to the “Chan Name” (Channel Name) data type affect the definition of the “Chan Info” (Channel Information) type definition as well as the “Caller” but they do not affect the top level VI “Demo”.
    We can determine all of the above without ever opening up the diagrams of any of the VI’s or type definitions. This is made more descriptive by editing the icons of the type definitions. The process is quick and easy.
    You start by opening the control editor
    Customize.PNG
    ... and choosing “type def” before saving the control as a unique name.
    You can then open the default icon and select most of the default icon’s image
    Select existing image.PNG
    And slide it down to the left.
    Slide down n left.PNG
    Which gives me plenty of room to add text.
    Structure Name.png
    Since the icons retain the native LabVIEW look it is clear which objects on the hierarchy screen are type definitions. I have for the largest applications taken the time to add graphic that represent the data defined by the type def. This becomes very helpful to pick out the data type you are after from hundreds of VI on the screen.
    View Data Hierarchy.png
    In the application hierarchy screen snippet above I have illustrated how type definitions are very helpful when investigating how a possible type definition change can affect an application. The VI hierarchy screen, when used with type def’s becomes a “data definition hierarchy screen”. Looking at all of the VI in a type def’s hierarchy tells you which high level functions could be affected by changes. The callers tell you the VI’s that need special attention and will adapt to changes in the typed definition. In the case above, we can see (well I can because I can do a little scrolling) that of the 700+ VI used by the application, there are only 10 that use the definition (I shudder at the thought of trying to do this same analysis without type def’s.  ).
    To get the hierarchy snippet I presented above I located** a top-level type def. By “top Level type def” I mean a type def that is not a member of any other type def. Once I located the icon for Equipment Group type def, I was able to right-click and choose Show VI Hierarchy
    Show VI Hierachy.PNG
    Followed by a right-click Highlight connections
    Highlight Connections.PNG
    Summary
    Type definitions allow data structures to be defined and maintained across an application. Enums and clusters use benefit from being used as type def’s. The VI Hierarchy screen includes the option to view or omit type definitons. Consistent icon usage for type def’s makes it easier to find them in large applications. The hierarchy of type def’s define data dependencies.
    Closing
    I hope the above observations on type definition creation, use, and their power to be useful. I’d also love to hear about
    1) How you have used type def’s to your advantage?
    2) How you go about organizing your data structures?
    3) What features of type def’s have I omitted?
    If you have a Nugget you would like to present please post here to reserve your week!
    A list of all Nuggets can be found here .
     Ben
    Notes
    * Warning: changes to application containing hundreds of VI and were not developed using type def’s should be left to professionals. This kind of work has lot in common trying to remodel a house of cards. Every move must be done with great care and you should be not surprised if the entire enterprise comes crashing to the floor. In short, do NOT try this trick at home.
    ** You will find that if you use type definition s in your applications they will end up decorating the bottom edges of your hierarchy.
    *** Type def’s define the data type and not the default values. You cannot use type def’s to establish default values. If you modify a type def that is used as constant on a diagram, all instances of that type def will be replaced with new instances. Default values that were saved in the block diagram will be lost when the constant is replaced with the new definition. This is by design. The method I suggest for establishing a default value is to use a sub-VI to explicitly define the value. In the case of clusters use a bundle by name node to set the fields as required. In the attached 7.1 example you will find
    Type_defd_Constants
    Where I have illustrate the use of sub-VI’s to establish default values. In the example, there are two sets of default values of the type definition “Chan Info” (Channel Information) denoted by the green and grayed-out icons.
    Documented_Constants
    The sub-VI documentation also helps future developers of the application pick-out the proper default settings.
    **** The attached example includes a simple example of an action engine. Stay tuned for a future Nugget where we may discuss action engines.
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Code.zip ‏109 KB

    My recent project involving TypeDefs and 'constant' VIs is about XML creation:
    Where the red 'dot' is a formatter constant with the following content:
    <%1$s>
    %2$s
    </%1$s>
    By using a enum for the XML-tag I can avoid mistypes since XML is case sensitive
    Using 1$s allows me to reuse the first input twice
    And if I need to change the tag-creation I can edit my constant VI.
    Ton
    Message Edited by TonP on 03-05-2007 09:13 AM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    ChartLocations.xctl_KML_Core.png ‏1 KB

  • Community Nugget 2-19-2007 "Stacked Sequence Exterminator"

    I am sure everyone with even casual familiarity of LabVIEW has run across older (or newer) code that is just peppered with ...
    Stacked Sequences from Hell.
    Stacked sequences (especially the one's containing sequence locals) are the hallmarks of confusing, unreadable and unmaintainable code. Data flows in all directions (mostly right-to-left), a large percentage of code is hidden at any given time, and it is almost impossible to debug and follow what going on. Often there is clear data dependency (or execution order does not matter), so the sequence serves no purpose. Better programmers don't use stacked sequences at all and even keep flat sequences at a minimum.
    Here is an example:
    Since the code seems to work "sort of", and trying to rewire things manually will probably lead to accidental errors, we have no choice than to leave things in place...
    ... or do we???
    If we try to right-click on the sequence, we can only remove individual frames, breaking everything in the process. No go! A dead end!  Sigh!
    But let's not give up just now.... We can easily convert the stacked sequence to a flat sequence, so lets do that as a first step:
    At this point, we can remove the flat sequence and all connections remain in place. Now we can just cleanup the elements and wires and everything look much better. Ahhh!!!
    In summary:
    An easy two-step procedure allows us to exterminate unnecessary stacked sequences without any danger of breaking the code. This method should lower the fear to remove these monstrosities. Try it today!
    This is a Community Nugget. If you want to contribute, please sign up here: http://forums.ni.com/ni/board/message?board.id=BreakPoint&message.id=3379#M3379
    Message Edited by altenbach on 02-18-2007 10:43 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    SeqToFlat.gif ‏15 KB
    SeqStackedA.gif ‏10 KB
    CannotRemove.gif ‏12 KB

    Tomi,
    Aren't you asking for a good reason to use a "bad" construct?
    Your suggested code construct would look like this.
    After wondering how to make it faster, you would concider this.
    But the revised version is not possible with a stacked seq. With a State Diagram you have a lot more flexibility, and you have it now.
    Now don't get me started because the next thing you know I will be talking about the SDE* and this thread is about exterminating Stacked Sequences..
    Wait, I think I just did.
    Ben
    * With a State Diagram you have a lot more flexibility, and you have it now. If you use the SDE the graphic documentaiton comes along for the ride.
    Message Edited by Ben on 02-19-2007 07:59 PM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Stacked Seq.JPG ‏20 KB
    Stacked Seq Rev1.JPG ‏23 KB

  • Community Nugget 02/25/2007

    The native LabVIEW controls were designed to be readable and easy to use, but they are also quite boring.
    There are many ways in which you can change the appearance of your application, ranging from changing the colors of your controls to using system colors and controls to customizing controls to look more interesting.
    Today I'm going to discuss another option which most people are not aware of - using external resources while customizing.
    Basically, every control is made up of several parts. Some of these pieces have limited options for customization, but the other pieces are usually just images which you can replace with anything you want.
    Let's start with Office. LV graphics are vector based graphics, so you can resize them and they will always look sharp. Office graphics are also vector based, so you can copy images created in Word or PowerPoint into LV and your controls will scale nicely. There are probably other programs which can do this, but Office is the one I have most readily available.
    An example might be in order. Continuing with the dials theme from my previous nugget, here are two dials where the housing part was replaced with two gradient filled circles created in PowerPoint. As you can see, this can make your front panel look different and much more appealing and should also resize nicely.
    Note - at least in LV versions in which I've tried this, the internal LV clipboard does not get the image when you copy it in Office. You need to paste it when you edit your control in customize mode and then right click it and select Copy to Clipboard.
    Here's another example, also inspired by something shown in the dials nugget.
    On the left you can see how you can create a classic looking clock by using an appropriate background image and replacing the housing of a dial with a square frame (taken from the decorations palette).
    In the middle you can see how this can be abused by placing a clown nose on a granite background. It is very important to NOT OVERUSE THIS. A user interface becomes extremely unusable if it is filled with distracting and conflicting colors.
    On the right you can see another nice thing - Office images support alpha channel transparency and this is transferred into LV. As you can see in both this picture and the next, this doesn't look too well on my computer, but maybe newer versions of Office\LV handle this better. Also, be careful - LV will usually be much slower when drawing overlapping controls, since it redraws them every single time instead of being smart and only drawing them when needed.
    On the same note, you can use transparent GIFs and PNGs to have images with irregular shapes.
    Another thing that this image shows (other than the partial transparency) is the reshaping of a numeric control by making the numeric text background transparent and replacing the frame with a shaped image
    Attached are three VIs:
    One shows the clocks with a couple of numeric controls with irregular shapes and partial transparency.
    The second shows using an image created in Office and copied into LV to create a Star-Trek like animation.
    The third shows a VI from the NI site which shows using animated GIFs inside custom controls.
    I would like to state this again - this should be used wisely. It is extremely easy to make a front panel too crowded. Remember that your users eventually need to use the program and that is the most important thing. These tricks should be used to make the user interface more usable or more appealing, but they should not come at the expense of usability.
    To learn the basics of control customization, see this page from the LabVIEW help.
    For a list of past nuggets, see here.
    If you want to write nuggets yourself, see here.
    Try to take over the world!
    Attachments:
    GIFAnimatedControls.vi ‏295 KB
    Clocks.vi ‏823 KB
    Flow 61.vi ‏39 KB

    Great nugget.
    For LabVIEW 8.20 users it might be worth mentioning that it now supports direct background images, similar to the windows desktop. You can easily expand the selection in the list by placing other images into "...\resource\backgrounds" of your LabVIEW folder (On windows: C:\Program Files\National Instruments\LabVIEW 8.2\resource\backgrounds).
    For example you could place the woodgrain background image from your clock display, then simply select to "tile, stretch, or center" the image in the pane background.
    Typically you would choose a small "atomic" image that nicely autorepeats a given pattern when tiled. The advantage is that the background will always fill the window, no matter how you size it.
    The following menu can be reached by right-clicking on the scroll-bar and selecting "properties" (LabVIEW 8.20 only!).
    Message Edited by altenbach on 02-26-2007 12:47 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    FP-Background.png ‏71 KB

  • Community Nugget, 05/27/2007

    Today, a useful tip:
    On occasion, it could be very useful to have a VI know whether one of its inputs was wired or not.
    For example:
    You could have a VI which will accept a path, or pop up a file selection dialog if you haven't wired the path input.
    You could have a LV2 style global which would execute its Write case automatically if you wired something into it.
    You could have a utility VI which will operate on the VI calling it unless a reference to another VI was given to it.
    The possibilities are endless.
    LabVIEW does not currently expose a way of letting us know whether an input was wired in the calling VI or not, but there is a workaround. When you don't wire a value into an input control, that control uses its default value. For many datatypes, you can determine as default a special value which would be considered invalid and then check if the control is equal to that value and assume that the input control was not wired if is equal to that value.
    Consider the following code, for instance:
    If a VI reference was wired, the VI will control the defer property for that VI. If no reference was wired, it will control the defer property for the caller, so to control the defer property in your VI, you just have to drop it in the block diagram of your VI.
    Common invalid values include -
    NaN for floating point values
    an empty (invalid) reference for references (VIs, controls, etc.)
    negative numbers for numbers which should only be positive
    a special invalid value for enums.
    Now go out and be creative.
    P.S. You should note that it is important to choose a correct invalid value.
    NaN, for instance, can be achieved through calculation (e.g. through dividing by zero).
    For a list of past nuggets, see here.
    If you want to write nuggets yourself, see here.
    Try to take over the world!
    Attachments:
    Defer Updates.png ‏7 KB
    Defer Updates.vi ‏37 KB

    Just a point I noticed about that (very quick) example - the Defer Updates input should probably be a required input and in any case should not be T by default, because that would make the FP get stuck.
    Attached is a simple example demonstrating its use. When the OK button is changed, the updates are defered for several iterations.
    Try to take over the world!
    Attachments:
    Defer Example.llb ‏52 KB

  • How can I establish an enum typedef for use with state machines and action engines?

    Hey all--
    I have an action engine with several instances.  Any time that I add a method to the engine, I have to modify all of the calling code to update the constant that determines the method being called.  There must be a smarter way to address this problem but my LV experience is insufficient to identify it.  Can any of you wiz-bangs tell me if it is possible to make a type def (I can do this) and use it with each instance of the action engine call so that changing any instance also updates the typedef?
    Thanks.

    Take your enumerator.  If it is not a control (ie constant), change it to a control.
    Under File Menu, select New > Custom Control.
    Move (or copy) your Enum Control to the Custom Control.  Change the Control to Strict Type Def (the selection to the right of the wrench).  Save it.
    (EDIT: ** OOps, the picture shows the wrong one.. sorry**)
    Copy that new Strict Type Def control to your code.
    See images below.
    OR.. If you're using LV8.x, and using a project, I would recomment that you do it from within your project explorer.  Simply insert a new "Control".  The rest of the steps are similar, except that you can insert it from your project. 
    R
    Message Edited by JoeLabView on 07-08-2008 06:47 PM
    Attachments:
    TypeDef.PNG ‏33 KB

  • Array of variable-length lists in Action Engine

    I'm starting work on a application that consists of multiple sub-panels which each present a specific subset of the hardware functionality.  The hardware appears to the host mostly as memory-mapped registers.  I'm considering implementing the hardware interface in an Action Engine (AE) so that LV will automatically arbitrate among the hardware access requests from the sub-panels and because it (seems to me) to make the data flow more clear than the current implementation that uses a veritable plethora of queues, notifiers, and rendezvous to send requests and results between the sub-panels and the hardware interface at the top-level.
    The challenge is this, though:  Certain hardware addresses need to be modeled in multiple sub-panels -- maybe data at a certain address changes the functionality of some other addresses, or maybe different bit-fields within an address are part of different functional groups.   
    So any of sub-panel can request a read or write to the hardware, but often several of them need to see the resulting data.
    In order to keep the design modular and expandable I don't want to hard-code anything in the hardware AE that is specific to the sub-panels.   Instead, I intend to have the sub-panels "register" with the hardware AE indicating for which addresses they need to receive updates when some hardware address is read or written to.  This means the AE will have to keep the "registration" data in an un-initialized shift-register (USR).  But I want the hardware accesses to run as fast as possible, so I would like to ask for some suggestions how to implement this as efficiently as possible (avoiding, for example, clusters of arrays...)
    I imagine the sub-panel registration info might consist of a user-defined event reference (created inside the sub-panel VI) and a list of hardware addresses that the sub-panel is modeling.   Then when the hardware AE gets a request to read or write at some address it will also generate events to broadcast the data to the sub-panels that have registered for that address.   This will probably include 20-25 subpanels registering for a collective total of about 700 hardware addresses.  
    I'm less concerned about memory than speed.
    So, a few possibilities come to mind for how to implement the registration data in the AE USR:
    A) Have one 2-D array where the array contains one row per hardware address (~320), and columns contain the event refs for all the sub-panels registered for that address.   The width of the array would depend on whichever address has the greatest number of sub-panels registered for it (maybe 4-5?), but that still means the array would be pretty large (about 6.5 kbytes if a reference is a 32-bit value?)
    On the other hand, indexing into this array to look up the sub-panel references for the current address would be relatively quick and easy since the hardware address is the row number.
    B) Have two arrays where the array size is the number of sub-panels:  One 1D array for the registered event refs and one 2-D array for the addresses.  But different sub-panels will have different quantity of addresses registered, so that means the "width" of the address array would be as big as the largest number of addresses registered by one sub-panel (maybe 20?).   This would use a total of only about 1.5 kbytes, but I would have to search through all 25 address arrays to see if the current address is registered.
    C) or, some other way that I have not though of.   
    Once the "registration" data is received from the sub-panels during program initialization it is never changed, only read.   So at first glance it would seem (A) would be the faster implementation.  But I don't know what, if any, performance hit there would be from having such a large array in a USR, which is why I'm asking here.
    Any thoughts or suggestions would be greatly appreciated.
    Thank you and Best Regards,
    -- J.

    JeffBuckles wrote:
    Any thoughts or suggestions would be greatly appreciated.
    Thank you and Best Regards,
    -- J.
    Quick thought (hardly!)...
    I have used a "Self-Addressed Stamped Envelope" architectrure for those type os apps.
    DAQ device has a queue it monitors for subscription requests (Think of a in-box for Marketing deparetment).
    When client is created it submits a request via the queue for the subscription request that included a ref to its update queue and a list of teh channels it wants to watch. The clients then wait for updates.
    The Marketing department pass the request for updates (in-box of marketing department) to the production department (I used an AE to pass the mailing list) who picks through the acquired data and passes updates as requested to all of teh subscribing clients.
    Just sharing ideas,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Action Engine indicators do not update?

    This action engine is part of a larger test. I call it every 15 minutes to test for temperature stabilization (four consecutive readings at 15 minute intervals within three degrees)
    It seems to work as far as detecting stabilization but I don't understand why it's numerical array indicators do not update.
    If you run this by it's self and fill numbers in the Temperatures array control all the indicators work.
    But when it is a sub-vi all the indicators remain grayed out or in their initialized state when I open it while it is running.
    I even have brought the Stab Array out with a terminal thinking it would be updated every time the sub-vi ran, but it is not.
    What is going on here?
    Solved!
    Go to Solution.
    Attachments:
    Check Stab.png ‏50 KB

    It seems to work OK for me.
    Here's what I did:
    Put snippet on block diagram
    Disconnected Function control from Type Def
    Wired controls and indicators to connector pane
    Then I placed the AE in a main program. Being lazy, the main uses a breakpoint to stop each execution of the loop so you can vary the Temperature inputs.
    steve
    Weinberg's Second Law: If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization.
    Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
    question. Give "Kudos" to replies that help.
    Attachments:
    main.vi ‏10 KB
    AE.vi ‏18 KB

  • The BCB/ICI veision about CRM 2007 J2EE engine

    Hi,everyone :
        I don't install the java WAS . So could anyone who installed the CRM 2007 J2EE engine tell me the BCB/ICI veision .Thanks .
        The url is like this :
    http://<server>:<port>/bcb/bcbadmStart.jsp
        click 'System Information'.
    Thanks very much.

    Hello
    Please, check [SAP Note 1268057|https://service.sap.com/sap/support/notes/1268057]
    Since CRM5.0, the ICI is implemented by non-java option (ABAP). Basically, non-java option means MCM/BCB/ICI code in CRM server is on ABAP (including how to configure the connection to the simulator via transaction CRMM_BCB_ADM).
    Other related application, such as CCSUI, is a java application but it has nothing to do with setting up the connection via the bcb setting when we run non-java.
    So, it means, IC Web client/CRM uses the ABAP stack to implement ICI features, so you don't need to care about BCB Admin for java.
    Another important feature is that as of ICI 3.02, the WSDL files are generated automatically, you don't have to generate them manually.
    I hope this info helps
    Joaquin

  • Blackberry Desktop Software freezes at message "Action Engine Loading Configurat​ion"

    I have Windows 7 Professional. My Outlook profile is saved on an Exchange server and my Blackberry had previously beeng syncing with Outlook in this setup for nearly a year without issue. 
    Recently, the desktop software freezes at "Action engine loading configuration" message and is unrecoverable. I have tried the following things to rectify the situation:
    1) Adjust the organizer settings not to sync anything except the date & time. Still happens
    2) Delete all data from the device using Desktop Software and try to resync. Same problem
    3) Uninstall and reinstall Blackberry Desktop Software and try to sync with both the original set of data and the empty, deleted data Blackberry. Same problem.
    4) Tried wiping the blackberry completely using JL Cmdr, reinstalling the OS. In this scenario I can sync Addresses but once I sync Calendar the problems happens again and I am unable to ever sync it again (Including thereafter when de-selecting the Calendar option. 
    At this point I have spent hours scouring Google for help and trying the above items. This has been disastrous for me as I rely on the sync'd data for work and have already starting missing things. 
    I don't believe there is anything wrong with the Blackberry, as it works fine and works perfectly well after re-loading a fresh, OS, etc. 
    I have tried playing with the support logs but because the software freezes before calendar can sync, nothing is in the log that states if there is a corrupt record in calender causing this. Nothing dramatically changes in my calendar between the day that syncing worked and the day it didnt.
    I've tried searching the Blackberry forums and have found some info but nothing helpful. RIM does not provide support telephone numbers and AT&T support has continuously demonstrated itself as worthless over my time with them. 
    Is there any resources left at all that I could try to get past this issue, not waste any more time, and be able to resolve the issue?
    Thank you for reading and for any input you are willing to offer.
    Solved!
    Go to Solution.

    I had a Dell PalmPilot type device in 2003 that sync'd contnously with my computer using ActiveSync. I didn't ever have to click Sync, I would make a change on either device and they would sync. 
    The fact that it is 2011 and we still work with Desktop Manager, the biggest piece of **bleep** software I still have to use, is simply pathetic. 

  • First foray in LVOOP mixed with Action Engine functionality, would appreciate comments

    Hello (LVOOP) experts!
    I am a big fan of Action Engines (AEs), and use them very regularly.
    Now, say I wanted to have a Logging module that writes text to a log file, I can create an Action Engine for this and all is well, i.e. I can drop this VI anywhere in my hierachy and it basically just works. I like to encapsulate AE in a lvlib.
    So, what if I wanted a second Logging module, doing exactly the same thing, but operating on a different file. Well, I could create a new copy of the Action Engine in the project, duplicating the code and giving the second AE a different name. This is of course a bit clumsy, as what if I wanted 100 of these!
    I suppose I could make the AE re-entrant (cloned) use VI server to obtain a second copy of the AE, but I have not tried this.
    So what I decided to do is make a LV Class, and just instantiate a second class as needed. I really really really like the ability of AEs to drop them anywhere without wiring all the way through the hierachy, so that was a design goal with my LVOOP implementation. As far as I can tell, one way to do this is using single element named queues (sort of a singleton design pattern).
    The attached code is my attempt, I would really appreciate comments, both positive and negative.
    nrp
    CLA
    Attachments:
    Logger LVOOP.zip ‏54 KB

    tst wrote:
    What you've basically built is a SEQ-based, by-ref class (although you pass a name, not a reference), which is certainly a valid construct. dqGOOP has been doing that for years and the singleton example also uses this, as you mentioned.
    Some comments:
    You really don't need the object as an input. It can be a constant on the diagram.
    You could make this a by-ref system and pass the object which holds the queue reference, similar to the singleton example. This has less chance of braking, IMO.
    Instead of acquiring the queue in each member VI, create an LV2 manager VI - when it gets a name it looks up its reference in an array. If it doesn't find it, it creates a new ref and returns it. If it does find it, it returns it. That simplifies some of the code you have to replicate for every member VI.
    The fact that you have to replicate code at all for member VIs is annoying. It would be great if LVOOP had by-ref support built-in or could at least create data access VIs from a template.
    1. Fixed. I copied this technique from Dr D's Xylophone project. I thought if you drop the class constant on the BD it actually creates a new object each time?
    2. Not sure I get you on this one, could you provide some more enlightenment please.
    3. Done. Probably not the most efficient implementation though...
    4. Agree it sure is annoying!
    New version with basic queue manager attached!
    nrp
    CLA
    Attachments:
    Logger LVOOP v2.zip ‏75 KB

  • FPGA in Action Engine

    I'm trying to control an FPGA vi from inside an action engine by holding the reference in an USR.  This is not working at all.  Everyting works fine when it is controlled directly on the main vi.  In fact, it appears to have corrupted the main vi, which now crashes LV when run with a "MechFactoryCWrap.cpp" error whenever it is run, even after the FPGA action engine code is deleted.  I'm using FPGA V8 and LV 8.0.1.
    TIA,
    Bill F

    Hi Bill,
    I just want to make sure that I am understanding this correctly. You have an FPGA VI that you are trying to control inside an Action Engine. If you don't control it inside the Action Engine, then the main VI works fine. However, if you do try to control it inside the Action Engine, then it causes LabVIEW to crash, producing the cpp error. Is this correct? Also, once that happens, the main VI does not seem to work correctly, right? Does this cpp error occur when you hit the run arrow or when you are editing the VI? Is there a possibility that you could post the VI on the forum or at least a screenshot of it? That might make things a bit clearer.
    National Instruments
    Applications Engineer

  • Community Nugget 05/27/2009

    On occasion, you may wish to measure the amount of time a certain piece of code takes to execute.
    What many people do is something like one of these options:
    But this annoying to rewrite every time. If you're good, you probably have a merge VI or use VIs such as the OpenG VIs shown here to save some time on writing this code.
    Well, there is a faster way:
    The timed sequence has an output terminal which tells you how long it takes to execute. You can simply drop one and select that terminal.
    Caveats:
    I believe they're only available on Windows and RT.
    They take too much space (but then, so does the alternative).
    If you're running your code in parallel with other code (which you should not be doing), they might get higher priority, thus skewing the results. I don't know enough about this to give a good answer.
    When you drop one, it has terminals on the inside. You have to select to hide them if you don't want them.
    For a list of past nuggets, see here.
    Try to take over the world!

    In the first pic (flat
    sequence), the inputs of the substract-prim needs to be swapped (as in
    the code using OpenG)
    Actually,
    in both cases the earlier time is correctly substracted from the later
    time. It's just arranged differently (and I agree it can be confusing.
    Another reason to do this, although personally I don't time my code very
    often, so I don't actually use this).
    Sequences always make me nervous...
    So I prefer negative times for two reasons:
    * Something odd is on my BD
    * Rewind the time ASAP before the moment I dropped the sequence
    Felix
    www.aescusoft.de
    My latest community nugget on producer/consumer design
    My current blog: A journey through uml

  • Action Engine Data Space associated with an executable

    I am thinking of using an AE (Action Engine) for my project. I have basically 3 top level VI which I use to display and control the machine behavior (they are essentially duplicates of each other). If I invoke the AE (same name), will the AE will be sharing the data with the 3 top level VI in a single executable?

    I have not tried that in LV 8.+ yet so I will speculate.
    Since NI is pretty good about making sure old stuff still works, I suspect you should be OK.
    If not, you will have to explicitly specify the applicaiton instance they run in.
    For all of these types a questions, I stongly urge you "Build early, build often" just to make sure you do not get blind-sided when the dead-line approaches.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Action engine/array question

    Im sure there is an easily corrected mistake I'm making. I am going to be making an action engine where I need elements added to an array, and after the array is full, toss away old data and add the new data. If someone can tell me why this array is continuing to be all zeros i'd appreciate it. Probably misuse or misunderstanding of one of the array functions. If someone could put a photo of the corrected VI rather than attach the actual VI it I'd appreciate it as I wont be on a computer with Labview until Monday. Thanks.
    CLA, LabVIEW Versions 2010-2013
    Solved!
    Go to Solution.
    Attachments:
    actionengine.vi ‏22 KB

    If you could just take a last look at this and make any more comments I'd appreciate it. I'm trying to learn how to do this stuff as efficiently as possible the first time so I don't have to backtrack/relearn. I'll take advice on anything, except tunnel and wiring as I think I can fix that myself. I'm more worried about the actual coding. And yes, I am aware my front panels aren't organized
    Message Edited by for(imstuck) on 01-22-2009 02:59 PM
    CLA, LabVIEW Versions 2010-2013
    Attachments:
    actionengine.vi ‏67 KB
    test_action_engine.vi ‏144 KB

Maybe you are looking for