Action engine noob

I am learning how use "engines of the action" (or functional globals, or...) and I noticed that most is used for a variable.  I have various inputs from a motorized pump.  I initialize these entries in the beginning and use them throughout the program.  Rather than create a driving force for each task of entry, it would be beneficial to include all tasks in the engine of an action?  I also thought of putting them in a table, but I like them out individually, so I don't have to remember what order they were in.

Thank you for your comments.

Of course, you could store multiple values either using several shift registers, or better yet, combine them in a cluster.  You would have 2 enums, one to Get and Set, the other action of the elements defining the cluster you want to work with.  If you are dealing with several types of data in the cluster, you may need to have the input and output for data in the connector pane be a Variant.

Tags: NI Software

Similar Questions

  • Improve the Action engine

    I'm new to the use of action engine in my code and hope to learn and improve my use of engines of the action. The first one I created is to control a set of relays that will open and close the pneumatic valves using the NI 9474. I was hoping I could get some general comments on the back and DONTs with this action engine and it will help me with the future creation of AEs for my code. What should I do differently from a point of view of efficiency, etc.?

    Thank you.

    I have attached the VI.

    Bob,

    I am not making 2 AEs, especially since you should be calling not 'set' of the material of the main VI case.  And you duplicate efforts by having both hold the DIO State (and the AE Valve might have some 'old' data if the HW AE has been called).  So what's the problem with just having all the features in a single AE?  This makes it MUCH simpler API.  So the States that I see are:

    • Initialization: the task of installation material and turn off all valves
    • Set Valve: open a designated single valve
    • Claire valve: turn off a designated single valve
    • Set all: turn on all valves
    • Clear all: close all valves
    • Closed: turn off all valves and stop/clear the task

  • BlackBerry Smartphones Action Engine loading Configuration

    Whenever I try to sync my Blackberry it freezes at "Action Engine loading Configuration" forever. To kill the process to restart Desktop Manager. Tried to reload OS Blackberry, sync, everything and cannot understand this. Not sure yet what is offending the synchronization as the app completely freezes so I can't access all the newspapers.

    Everyone is out there experience this sort of thing?

    Although no one helped me with this I could help I put the steps that I followed down here so that if someone comes on this page of our friend Google, they will be able to try the same thing:

    I ran 'Fix' on the memory card in the Blackberry

    Ran CCleaner on my PC to clean the registry

    Reset synchronization in the Desktop Manager settings

    Finally finally I'm the synchronization again.

  • Action engine DAQ sample

    A picture of an example DAQMX is attached.  If I created an action action (AE) engine and put the first two nodes (create the task start and channel) into action 'initialize' of EI and save the reference in a function of globel (FG), I could lose the reference if I use the Action to write DAQMX later with the reference stored in the FG? I'm afriend that LV will clearn reference when I'm not using it.

    Do you anticipate a problem with an engine of the action with this example?  First two nodes (initialization), 3rd node (writing) and last node (close).  Thank you!

    Shouldn't be a problem at all - I do the same sort of thing all the time.  Just a little tip - I wouldn't bother making a FG for the refnum of the task.  I would be only on his own USR (uninitialized shift register) in the engine of the action itself.

    -Kevin P

  • BlackBerry Smartphones Blackberry Desktop Software freezes with the message "Action Engine loading Configuration.

    I have Windows 7 Professional. My Outlook profile is stored on an Exchange Server and my Blackberry had previously beeng synchronization with Outlook in this configuration for nearly a year without problem.

    Recently, the software freezes the message 'Engine Action loading configuration' and is unrecoverable. I tried the following things to remedy the situation:

    (1) adjust the settings Organizer not to synchronize anything except the date & time. Still happens

    (2) remove all data from the device using Desktop software and try to resynchronize. Same problem

    (3) uninstall and reinstall Blackberry Desktop Software and try to sync with all of the original data and the empty deleted data Blackberry. The same problem.

    (4) tried to wipe off the full blackberry using Cmdr of JL, reinstalling the operating system. In this scenario, I can synchronize addresses, but once I sync calendar problems from ever happening and I can't ever sync it again (including later by deselecting the option of calendar.

    At that time I spent hours scouring Google for help and try the above items. This was a disaster for me because I rely on synchronization had given for work and have already from lack of things.

    I do not think there is something wrong with the Blackberry, because it works very well and works perfectly well after re - charging a fee, OS, etc.

    I tried to play with the balls of support, but because the software freezes before can synchronize calendar, there is nothing in the log that indicates if there is a file corrupted in the event calendar. Nothing won't change significantly in my calendar between synchronization worked and the day that he didn't.

    I tried searching the Blackberry forums and have found some info, but nothing useful. RIM does not provide phone numbers and support AT & T has continually demonstrated himself as worthless during my time with them.

    Are there resources left at all that I could try to move beyond this issue, don't waste any more time and be able to solve the problem?

    Thanks for reading and for any input that you are willing to offer.

    Although no one helped me with this I could help I put the steps that I followed down here so that if someone comes on this page of our friend Google, they will be able to try the same thing:

    I ran 'Fix' on the memory card in the Blackberry
    Ran CCleaner on my PC to clean the registry
    Reset synchronization in the Desktop Manager settings

    Finally finally I'm the synchronization again.

  • Action engine config fails (always worked before?)

    I used a driving force to write and read many applications config files.  For some reason, now my config refnum is bad when I switch to a new action.  The refnum goes wrong after going through the shift register.  I probe it and the number seems fine, but Not A Config data Refnum.vi reports it's wrong and when I try to write in the opened file I get error #1.  I even tried older code that works well in the old test systems, but it fails now in my dev system.  The VI is not reentrant.  I'm puzzled.

    I created a simplified version that illustrates the problem (attached).  Any ideas what could wrong?

    Win7 64 bit

    32-bit LabVIEW 2013 professional development

    EDIT: My config file is C:\ConfigTester.ini

    NIquist wrote:

    Then select 'check' and run it again.

    Well, it's a question.  If you simply run the AE, then the reference kind of will close its doors due to EI and all its callers (which are not here) have stopped running.  Therefore, the reference is invalid.  Make an another VI which calls the AE and runs these tests sequencially and see what happens.

  • New case in the action engine has a radical effect on execution speed. Even after it is deleted.

    I use a motor of Action to collect, analyze, and write data queued in for use elsewhere in my program. Data packets are 67 bytes long and arrive at 1 kHz, so the speed of execution is important enough.

    In its original form EI was an average of 80-90 uS by running and had no problem keeping up. Adding a box empty to the structure immediately slowed down execution of EI to 440 uS by iteration, even when the empty case is never called. Embarrassing question is that after the empty case is removed and control the enum back to its original state, the runtime remains to be 440 us instead of 80.

    The four original cases were intact. All the world run into this kind of behavior before? I know that LabVIEW much changing helpful code in the background - change the representations of data, moving around the benefits of memory buffer... - but I can't understand what could happen in this case.

    If you want to play 'spot the difference', I enclose my AE for channel 1 (duration of execution 440 uS) and channel 2 (running time 80 uS).

    Comparing them side by side with buffer highlighted benefits I can't find those 260 uS.

    (I know it's a lot of queues. I can't be helped; the project requires data signals 11 1 kHz to draw at the same time, for each of the two channels.)

    Hi, Alex.

    As I understand, you are dealing with different sizes of table stored in the shift register. Check your section Initialize - in a VI you initialized with 1000 elemenths and table in an another VI with 5000 elemenths. That makes the difference:

    See attached VI.

    Andrey.

    PS

    Moreover, it is a good idea to post fully functional example, without SubVIs missing, etc.

  • Help engine action

    Hi, I'm going to need to transfer data from table between two parallel loops. Which I did in my example attached, but I need to figure out if one of the loops that I use has a faster pace of the loop it will keep reading action engine a status/action? or will he allow the loop slower to read its State/action? or it will behave as the queue behavior?

    Remove waiting inside the AE and change the default value for reading.

    AE makes no difference for the function, if you have time different loop, you could read 10 times faster you write or vice versa in a loop. EI prevents you to read and write at the same time (so waiting in the AE is a bad idea because it will block the other loop) and removes the redundant use of 'controls' variable, otherwise it is identical to a local variable.

    /Y

  • motor action accessed in an unknown part of my code

    I've been to this LV thing for quite awhile and I don't think that I was never this confused on something that could very well be a really stupid question on my part. But that's...

    I have an AE action engine that I use to store and set target values and read state of a motor controller.

    My bug: when my code is running in a State of rest to action "writing engine controller" should not be written on but aims to get in a certain part of the code. I can't seem to find when and where it is written.

    Is there a way that I can know exactly when and in what vi specific action in my AE is written? I use a strongly modified producer/consumer model. I have listed all of the appellants of this vi and everything is where it should be. I put a breakpoint on the part "writing engine controller" code and he gets constantly accessible so that my code is idle, but do not because I can only read data from AE when I'm idling.

    I am really puzzled.


  • issue of engine/table of measures

    I do I'm sure that there is a mistake that is easily corrected. I'll make a motor of action where I need to add to a table of the elements and after that the table is full, throw away old data and add new data. If someone can tell me why this table continues to be all zeros, I would be happy. Probably a misuse or misunderstanding of one of the array functions. If someone could put a picture of the VI corrected rather than tie the real VI it I would appreciate it that I won't be on a computer with Labview until Monday. Thank you.

    One problem, it's that you insert in a position that keeps incrementing with each round trip.  So, you have a table of 15 items, but eventually insert in position 16, 17, 18...  These are positions that are not defined.  If you do something where you insert the new element at the top of the table, then you must always insert in position 0.  If you are still wanting to put at the end, you add at the end of the table and take a subset of the table of index 1 for the length of 15.

    The real problem, that we never see anything other than zeros, it is that the wire goes into the shift register to the right is the same one that comes out of the left.  Changes that you make by inserting into the table and taking the subset disappear with each iteration of the action engine and never reach the table indicator

  • Passing a reference to queue as a sequence with LabVIew API parameter

    Hello

    I'm running a sequence of Labview with the entryPoint.Run method.

    Now, I want to pass a reference to queue to TS for use as the parameter for a stage of the action (the action must information sent through this queue). I tried to move the queue as a parameter for the valVariant parameter of the object of Subproperty seuqence.

    LabVIEW throughs 1 error when I try to setValVariant.

    The reason why I want to do it is because I want to integrate the execution of the sequence in my draft framework for an actor.

    Is it better to move the refs to the queue as a reference to be able to send data to an application running?

    Thanks in advance

    Michael

    Hi Michael,

    It is not possible to use references of LabVIEW in TestStand queue, since they do not share the same instance of the application. You can pass a reference to queue as an integer (U32 or I32), but you can not use in TestStand.

    I found 2 ways for you to use:

    You can use the Action engines in LabVIEW to encapsulate the queue. There is some information about this option in this thread:

    Solved: queues of LabVIEW and TestStand - Forums of Discussion - National Instruments
    http://forums.NI.com/T5/LabVIEW/LabVIEW-queues-and-TestStand/TD-p/2554231

    However, with this option, you must make sure that the motor Action shift register leaves no memory

    .

    The recommended practice is to create the queue in TestStand using Synchronization Manager and then open this queue in LabVIEW. An example is available for this option:

    Using queues in LabVIEW - National Instruments TestStand
    http://www.NI.com/example/30108/en/

    I hope this information is useful for you!

    Alex

  • Several producers response queue

    In my application, I'm working on an API that is the queue of conduit. Several different parts of the code can send a 'command' and wait for a response.  Obviously if two separate sections of code send a different command roughly at the same time, we have a race condition for the response queue.

    I have many ideas on how to solve this problem (action engine response, get an overview of the queue and search data appropriate, semaphores), but I wonder if there is a ' standard method / best practices "to do.  I have not run into this problem before.  So far, I'm leaning towards semaphores - it seems the simplest solution.  Here's a mockup I did as a proof of concept.

    BowenM wrote:

    Certainly, there is nothing to say that the response must be a queue. I could use a variable overall, functional overall, etc.  The queue was just for the convention, and I freely admit that it is a 'bad' use of a queue. The problem is always the same: how to make data from a producer for many consumers without having a convoluted solution heavy.

    Well, if you do not want to incorporate the queue back into the message and then use a non-reentrant VI is the only access to send commands to your consumers.  This VI would send the command and wait for an answer.  Since the VI is not reentrant, it blocks the other loops until the answer is back.  It's much cleaner and probably faster, than the use of the semaphore.

  • DAQmx Read simultaneous calls on the same digital line

    Hi all

    I use v10.0 LV 32-bit on Windows 7.

    I use DAQmx Read (in a task) to check the value of a digital line. Is it OK to do this in two different locations in a program at the same time for the same digital line? Or I have to put a wrapper around reading to force operations to be sequential?

    Thank you
    Zola

    When you need to expose the capabilities of resources to multiple areas within a project (expand the scope of a resource) it is common to wrap the resource in an Action engine to encapsulate the resource functions. See here for an example of a 'Module on resources' material and a discussion animated about how this code help development construction and avoid resource conflicts.  If you have not read famous nugget again – he of Ben is a link in my tag "Required_Reading".

    Or more directly.  Yes, you should encapsulate these readings DAQ to avoid suspended

  • global variable functional to read and write data from and to the parallel loops

    Hello!

    Here is the following situation: I have 3 parallel while loops. I have the fire at the same time. The first loop reads the data from GPIB instruments. Second readers PID powered analog output card (software waveform static timed, cc. Update 3 seconds interval) with DAQmx features. The third argument stores the data in the case of certain conditions to the PDM file.

    I create a functional global variable (FGV) with write and read options containing the measured data (30 double CC in cluster). So when I get a new reading of the GPIB loop, I put the new values in the FGV.

    In parallel loops, I read the FGV when necessary. I know that, I just create a race condition, because when one of the loops reads or writes data in the FGV, no other loops can access, while they hold their race until the loop of winner completed his reading or writing on it.

    In my case, it is not a problem of losing data measured, and also a few short drapes in some loops are okey. (data measured, including the temperature values, used in the loop of PID and the loop to save file, the system also has constants for a significant period, is not a problem if the PID loop reads sometimes on values previous to the FGV in case if he won the race)

    What is a "barbarian way" to make such a code? (later, I want to give a good GUI to my code, so probably I would have to use some sort of event management,...)

    If you recommend something more elegant, please give me some links where I can learn more.

    I started to read and learn to try to expand my little knowledge in LabView, but to me, it seems I can find examples really pro and documents (http://expressionflow.com/2007/10/01/labview-queued-state-machine-architecture/ , http://forums.ni.com/t5/LabVIEW/Community-Nugget-2009-03-13-An-Event-based-messageing-framework/m-p/... ) and really simple, but not in the "middle range". This forum and other sources of NEITHER are really good, but I want to swim in a huge "info-ocean", without guidance...

    I'm after course 1 Core and Core 2, do you know that some free educational material that is based on these? (to say something 'intermediary'...)

    Thank you very much!

    I would use queues instead of a FGV in this particular case.

    A driving force that would provide a signal saying that the data is ready, you can change your FGV readme...  And maybe have an array of clusters to hold values more waiting to be read, etc...  Things get complicated...

    A queue however will do nicely.  You may have an understanding of producer/consumer.  You will need to do maybe not this 3rd loop.  If install you a state machine, which has (among other States): wait for the data (that is where the queue is read), writing to a file, disk PID.

    Your state of inactivity would be the "waiting for data".

    The PID is dependent on the data?  Otherwise it must operate its own, and Yes, you may have a loop for it.  Should run at a different rate from the loop reading data, you may have a different queue or other means for transmitting data to this loop.

    Another tip would be to define the State of PID as the default state and check for new data at regular intervals, thus reducing to 2 loops (producer / consumer).  The new data would be shared on the wires using a shift register.

    There are many tricks.  However, I would not recommend using a basic FGV as your solution.  An Action Engine, would be okay if it includes a mechanism to flag what data has been read (ie index, etc) or once the data has been read, it is deleted from the AE. 

    There are many ways to implement a solution, you just have to pick the right one that will avoid loosing data.

  • State machine with acquisition different modes/loops

    Hi all

    I did a machine design to State (as described here) to organize three (mutually exclusive) process / States: idle, measurement of calibration and continuous measurement. Calibration must be performed before measurement, because the result of the calibration is used for measurement. The data entry is a camera that should run continuously, also in rest mode.

    The problem however is that this state of calibration and continuous measurement (should) have another method of data acquisition. The measure is continuous and the images are processed in real time. To calibrate a number N of images should be accumulated and treated (simply create a background image).

    In the state machine as I have now (see attached image), I have the acquisition of vision outside the state machine in order to have a live view at any time. The problem now is that the inner loop in the State of calibration (the loop that must accumulate the framework) accumulates of course that the first framework N times, it is not question for all new managers during this State.

    Of course, I could fix this with an if/else statement in the first calibration mode accumulate images (if I< n,="" accumulate="" frame="" in="" buffer="" and="" continue),="" but="" i="" am="" not="" convinced="" that="" having="" a="" lot="" of nested="" loops="" is="" the most="" elegant="" way="" to="" do="">

    This also got me thinking, is the state machine, as I built it here all the best way to manage these two processes/acquisition modes? Or are there better ways to do this?

    Contributions and comments are very much appreciated!

    Note: I know that loop as scheduled now in State calibration is wrong with shift registers. It was a test before I realized that the fault was in the interweaving of the state machine altogether.

    Please do not attach pictures, but rather post executable code, screws (easier) or as extracts from LabVIEW (which became the screw when you drag in a block diagram).  If you have more than three attachments, compress the folder and attach the ZIP file.

    I was once describing a system similar to yours, and one of my students, who was a computer science major, said "it's not a State Machine."  I had a similar situation to yours, where I had a procurement process which took time and a 'Stateful' routine that does different things with data (in your case, use it for calibration, waiting to 'Go', absorbent, etc.).

    I understood that it was correct.  I ' D 'opposite' model, with the Acquisition, always running and "driving", the calendar and make 'Appropriate Action' on each set of data, where the Action could (and did) vary according to other conditions.  So I renamed my state machine 'Action engine', and everyone was happy.

    So I won't bother looking at your code (a quick glance showed me that I have only would be frustrated by the limited view), but will give you a suggestion for an alternative architecture.

    You want to (ideally) two parallel loops.  A single loop simply acquires the data (images) at some rate.  For each Image, it signals the loop else it's time to 'Action' on the acquired data (to do this, use a queue or the notifier).  You want that engine of the Action to perform independently the Acquisition loop, just in case a particular Action takes, say, 1.2 times sample to complete - you don't want 'Miss' samples!.

    The loop of the engine of the Action is a unique, appropriate Action at the time, on the newly acquired data.  If you are in the 'State' calibration, the Action will be "add to the calibration.  When you have accumulated enough data to do calibration, set the following Action to (for example) 'wait to start the Signal.  When you receive the Signal to begin, take Action to "acquire, process and save data.  And so on.

    As it happens, I did my code exactly in this way, but it was the idea General - Acquisition was the 'King', he ran the clock and led the ' Machine/Action State engine' to 'do the right thing, appropriate to the time' with the data.  See if this type of model is appropriate in your situation.

    Bob Schor

Maybe you are looking for