08/04/2007 Nugget Motors Community action



Tags: NI Software

Similar Questions

  • parallel proceedings with a motor of Action

    Hello world.

    I just wanted to see what kind of ideas, it would bring to this issue.

    I have an AE that holds all pointers (or Referances) than 20 cases of use of reentrantVI in parallel. The question is obviously the execution speed as all instances are waiting to read the AE (and probably a bunch of other questions I have not ecountered yet).

    I've placed an example of EI I use where I also shows HOW I use it on a bigger picture.

    Please DO NOT RUN the example, just open it and see the comics, that's where I tried to put all the information and it was the best way I can think of to explain the problem.

    Kas

    A few thoughts:

    -You can make copies of the segment every time you add or start treatment. If the segments are important, this could be a long time. As others have suggested, a queue, or an array of digital recorders could leave your hand the data without making a copy. Also, by storing the segments as a large table, is not necessarily effective. Are there how many segments? If you need to browse through a wide range to find the next available, which could also be slow.

    -How did you decide on 20 parallel case? This could be too - the computer can spend too much time swapping them, or if you think that, because they are blocked on the engine of the action only a few are all in fact both run.

    -Remember to reverse your model. Instead of having multiple parallel instances each application a data segment, have rather the engine action call parallel workers, each of them the next available data segment.

  • 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.

  • Producer-consumer mode, PDM and Acquisition journal continues

    I created a VI based on events to control the parameters of data acquisition. I created a queue of producer-consumer in TDMS file in the loop of the consumer.

    Question 1: Why should I get DAQmx TASK through each defined event? If I don't, I get error task DAQmx.

    Question 2: I need the QUEUE of each event? If I don't I get error in the file close TDMS (consumer loop)

    Question 3: When I look at the data file, I get manily in the near TDMS file loop of consumer-related. Since there is no element in the QUEUE why should - I get this error.

    Please advice.

    Thank you

    This is certainly not how I would like to start to create a Soft Front Panel for a task to HAVE.  Leave to file logging asside for now (appearing, it is actually very easy to add later.)

    As food for thought - and because that create a FPS really involves a slightly different thought where you started I whip a 'start' of a FPS.  It also shows how to create a simple API around a 'resource Module.   (Just a natural extension of a "motor action - if you haven read the nugget of community is always a good read.") http://forums.ni.com/t5/LabVIEW/Community-Nugget-4-08-2007-Action-Engines/m-p/503801)

    What I compressed is not complete - but you should get an idea of what to expand and where.  You could even have there more faster here than when you are now.

    An approach like that can really help when you go to unwind the problems as you mentioned in your code when you are unable to move around the information that the GUI can't really do use anyway and not IS NOT NECESSARY at this level.  the guys from 'Computer Science' will use terms such as 'Hide data', "Functional Abstraction" and "Encapsulation".

    The capture below is meant to tease the project so that others can get the idea of code - (sorry no LAVA TDC today! )

  • USB-6009 trigger reference by loops

    Hello

    I am a student studying for a Beng. As my final project, I want to create a default for electric motors recorder. The basic principle is that he sits and waits for a signal to trigger, how she recorded the analog waves of voltage and current for a pre-defined term before the trip.

    I chose the USB-6009 case like the acquisition of data, mainly based on prices. At the time I did not realize the importance of relaxation before (reference trigger) who works the 6009 did not support.

    I'm sure there must be a way to use the memory of the computer to create a buffer using a continuous loop that maintains a drop-off PDM rewriting, however I am really struggling to implement this code.

    I know that the ideal solution would be to use a device better suited, but having already bought the device and he said in my project specifications is not possible.

    If someone is able to offer all the tips of a possible implementation of this solution and a possible example of a similar program, I would be eternally grateful!

    1. make acquisition continues. Keep the data in a circular buffer large enough to store the amount of data pre triggers you want and all the data after release, which can be acquired before treatment is completed.

    2. when the trigger signal occurs, pull data from before release for stroage or store a marker that follows where the trigger before data starts.

    3. once the data post-triggers are acquired, write all relevant data in the file.  Unless you have blocks of data very long before or after triggering, PDM won't be necessary.  The USB-6009 case is slow enough so that you can keep a few minutes of in-memory data before running in memory management problems.  This should be much more that what you need for a motor fault recorder.

    Consider using a motor of Action (search for the nugget of Ben on the subject) for the buffer.

    Lynn

  • using daqmx device from different parts of a vi

    Hello

    I want to control four testsockets with a USB-6501 in a vi. Every shot has four digital output channels.

    If I run the vi with a single testsocket it work very well. When I use more then a parallel decision-making there is an error "device is in use.

    Y at - it a solution to make the wait until the legacy is free or something like that. The other way is to use four USB-6501, but it is

    Dear.

    Greetings

    Schwede

    Schwede,

    Ah, if this time around you do not use TestStand?

    OK, what I suggest is to use a functional overall, also known as motor of Action (read carefully the Bens nugget) in order to control the DAQ portion. This isn't a parallel loop but a whole VI.

    You can use a parallel loop as well, but he must take care of the good distribution of the signals if necessary.

    hope this helps,

    Norbert

  • Strange problem - Cluster of references

    Hello guys

    I had a strange problems using a cluster with references.

    How to reproduce the problem:

    -Open a white VI;

    -create two charts in the front panel;

    -in the block diagram, create references to two graphics;

    -connect these references to a package (not);

    -create an indicator across;

    -run the VI once;

    -Right-click on the beam indicator and change it to a control;

    -remove the references and bundle;

    -Select the control from the front panel, go to EDITION, CUSTOMIZE the CONTROL;

    -change the type strict def;

    -Save this order as Control1.ctl;

    -connect the control to a unbundle by name;

    -Right-click on the name unbundle and select one of the two graphs as an element (no matter that one select it);

    -Create a property node and feed its terminal of reference with the reference of the unbundle by name;

    -use of the 'Label.Text' property in the property node;

    -create a flag for the node of the property;

    -run the VI;

    -l' indicator will display the correct label for this chart.

    -perfect!

    If you save the VI and run again, fine.

    But... If you close it, open it again and run... you will get an error 1055 "object reference is not valid.

    Why it worked before closing?

    Find attached the VI and the control.

    Thank you

    Dan07

    Let see if I can answer before I start work.

    Do a quick experiment.

    Use Type casting to cast your Ref as a U32 and display this value on the public Service.

    Save the VI race she and the registration number on the FP.

    Mod the vi record close it open and run again. The number must have changed.

    That is the question facing you, ref number changes if you need one that is valid when you run.

    How do I;

    I use a motor of Action (see this nugget to learn what is a motor of Action) as servse as a GUI controller and allows me to get in refs where even I need them. The following is a case study.

    I first collect all th refs I need and combine them into a def type. I am pursuing a state machine to make the grouping if there are many.

    The clsuter group are passed to an Action controller GUI engine

    Inside Init, I check the referees to make sure that they are vlid. This has saved a lot of time wated no valid refs.

    If they were valid I cache the arbitrators.

    For major changes that require a lot of punching of GUI, I create Subvi to do the dirty work.

    Every time the ref to the GUI needs to other codes, I have a method that returns the arbitrators.

    The following is an example of an another VI using the MISTLETOE refs.

    I hope this helps,

    Ben

  • Access loop in Subvi pls help

    [Beginner] In my vi call there is a sub vi which is actually a while loop with a lot of loops and structures inside.

    I want to start and stop the sub vi of the calling VI only. But the while loop in the sub vi takes only the first value in the main control of vi.

    essentially the first picture is a model of the Sub vi (with all the structures inside it removed) and the appellant vi.

    the sub vi should begin only if the initial value of boolean is true.

    Help, please

    Have mentioned such reference, or transfer data via events (which case we go the event thread instead) or my favorite, a motor of Action (AE). In the latter case your main vi writes data to an AE and sub - vi reads from it.

    I think Ben has a great nugget on AEs.

    /Y

  • Global variable in the progress bar

    I have an existing labview code that consists of a main vi, which is the GUI user, and several (about 70) under vi. I am trying to add a progress bar on the screen before (user GUI) which will be immediately after it hits certain sections of code. I write this using a global variable to store the value of the status and any attempt in the main on-screen progress bar after each increment. Is there a way to link the main progress bar value to the global variable so that it updates as soon as the value is incremented? The problem that I am facing is that when I update the global variable in a Subvi, the progress bar takes the value of the Sub - VI is finished, all the numbers to jump between the two. I know it's because I do not correctly write to the progress bar, but I don't know how to do. If this isn't a good method, are there any suggestions?

    For example:

    SubVi2 SubVi1 Vi main

    (1-4)                (5-8)             (8-12)

    Progress bar: 1 2 3 4 8 12

    (I tried the Progress Bar Library OR offer, but I need a progress bar on the front panel, not a sound upward, so I can debug for code execution)

    Thank you - Adam

    I would go with a motor of Action update the progress bar VIA referance Server vi.  Here is an example of the use of a side effect I have to make this kind of progress bar.

    If you have not read Ben nugget of action engine, it should be mandatory, you can find here

    By building a "resource module" (a special AE that keeps a referance to the resource to act on) after initializint EI, you can call any 'method' on the resorce from anywhere in the instance of the application.  These babys really allow you to do interesting things to the GUI from around where the real action takes place.

  • global and DataSocket

    My problem is the following:
    I do readings of several machines. Reading is made through a serial (and that's why I use the VISA service). These readings are collected by an agent (in this example, Simul machines.vi) who is responsible for distributing, through DataSocket, playback of each machine for the corresponding agent (DS 1. vi and DS 2.vi).
    So far, it works perfectly.

    The problem arises when I want to show all variables in each of the readings (in this example, the 'status'):

    I created another agent (monitor.vi) that reads the table (global variable). This table contains the variable "status" in each of the agents on each machine.

    Why it does not work?

    I enclose a simple example. Run machines.vi Simul (socket requires data)

    Thank you

    _______________

    Vicen

    LV 7.1 / Win XP

    The image of the code you have posted

    is very similar to the example shown below

    The images above show a BAD construction and was published as part of my Action Engine Nugget to illustrate a critical race condition.

    Please see this nugget to see how a Motor of Action will avoid race conditions.

    Just trying to help,

    Ben

  • AEs/Single/data queues the value element references

    I'll have my CLD exam in December, and I'm just trying to 'inflate' as much as info that I can of course of the forum, alongside the preparation of the material...

    I also started to read "nuggets" pleasant and interesting too, and I hope I can get clarification for some of my issues that have emerged. (Sorry if I have a question is too noobish, trying to practice for the CLD beside my regular daily workload, and I am a little slow thinker in the night )

    I use often FGVs (and ActionEngines) in my applications, and for some "surfing and learning' on the discussion forum, OR I found this post:

    http://goo.GL/Cz1d0p

    People here recommended that the OP could use screws of wrapper which method has 2 benefits, explained here:

    "Wrap".

    http://goo.GL/J4vEIE

    My 1st question:

    I'm not really sure of what means a VI wrapper? Is this a Subvi, where the certain Subvi AE is called dynamically? I couldn't find examples showing how do (I read the entire post, but the subsequent discussion was more about OBJECT oriented programming...)

    2nd question:

    In the second post of nugget of community, there are a few closing notes, one of them: "AEs do not need a while loop." I thought AEs must also use a shift uninitialized register to store information (such as FGVs), and I need a while loop to have the shift register... Isn't it?

    question 3:

    I fall into the usual dangerous trap, jumping through different related posts, and try to understand everything at the same time but I wonder if there is a kind of basic example, which shows the three solutions (ActionEngines, SingleElementQueue, refs value data) for the same task?

    Thanks a lot for the explanation!

    PS: Sorry for using google URL shortened, but the forum of the site gives me error (Please enter a valid url) when I try to paste the normal URL...

    Martins wrote:

    question 3:

    I fall into the usual dangerous trap, jumping through different related posts, and try to understand everything at the same time but I wonder if there is a kind of basic example, which shows the three solutions (ActionEngines, SingleElementQueue, refs value data) for the same task?

    The single line of the element should not be used anymore.  Its purpose has been simplified with the value of data reference.  The concept between the two is exactly the same (reference to a single piece of memory that is locked when read until edited and rewritten in it).  The DVR uses only the Structure of the elements in Place to include the action-Edit-reading where the SEQ relied on the writer is smart enough to actually write data in the queue.

    I like the Action engines.  They are simple and keep everything in one place.  Read you from a register of offset (or feedback node), do whatever it takes with it and rewrite in the shift register (or feedback node).  The fact that it is inside a non-reentrant VI acts as your lock.

    I personally only used once a DVR in a real project and it is only to take care of some composition in my-oriented configuration object (several necessary items to refer to another shared object).  Otherwise, he has been driving Action all the way for me.

  • Why LabVIEW example projects using Global Variables?

    I'm puzzled.  I've been pretty good programmers LabVIEW talks (including some who work for the OR) and came away with the impression that Global Variables should, as a general rule, be avoided, with functional Global Variables (alias VI Globals) generally preferred for "local memory".

    I have studied some of the example distributed with LabVIEW, 2012 and 2013, in particular the proposed acquisition in real time and am struck by the use of Global Variables, where I'd be inclined to use instead a FGV.  For examples, to stop all the loops on the RT target, the overall "All the RT loop Stop" is defined; 'Constants' of configuration (such as timeouts, Streme network names, the names of the journal folder) are kept as Globals; Streme network endpoints are stored in Globals.

    [Note - there is a weird spelling of the second word of the network Streme, above - when I tried to post with the correct spelling, I got an error message saying this word is 'not allowed in this community".]  I apologize for the offense, but I must confess that I do not understand what the problem with the help of the spelling of this word...]

    Why use Globals in these cases, rather than write a bunch of VIGs to hold these data?  Note that almost all these Globals are 'Read' essentially (written once when a resource is acquired, for example) or "Read Only" (treated as if they were a constant).  Indeed, read-only variables can be written as a Subvi with only an output terminal, acting as a (visible, due to the icon) constant.

    I can see advantages to this approach.  On the one hand, VIGs can have error bounds who run the data flow (I just spotted a bug "data flow" in code, I am developing that is based on this model, to read configuration data to an XML file in a world and in the same VI, Global wiring to a "use - me" terminal, but with no guarantee that I'll read the overall after I write it).

    It is, I suppose, a matter of 'speed' - perhaps Global Variables are 'faster' than VIGs (especially if the VIG 'sits' on an error line).  My thought, however, is that this difference is likely to be trivial, especially as these VIGs (or Globals) tend to become "occasional" calls (with the exception of the indicator 'all the loop Stop' which is called once per line).

    Are there other arguments or considerations that make a Variable global to a better choice than a VIG?  Is there a reason that LabVIEW developers put in these start-up of projects LabVIEW?

    BS

    I have to ask, how do you use functional Global Variables?  Like just a Get and Set?  If so, you can use a global variable.

    Yes, globals are faster and use much less overhead.  At the summits of CLA in recent years, we talked about using globals.  The most common use is for Write-Once-Read Many and writing-never-Read Many with configuration data.  It's a good idea to use globals with the constants that can change on you.  It turns out that the world will have the same performance as a constant in this case.  This is done so that you don't have 1 place to edit the 'constant '.

    The rule on "Globals are evil" actually goes back several years when NEITHER had the huge "people of the country are bad" vendata.  But NEITHER explains well how to do things properly.  So I found people, instead of using local variables, using the value property node.  It's even worse because the property causes thread swaps and kills your performance.  It wasn't until I shouted to people to use wires and shift registers I have seen improvements in the way in which people wrote their code.  So people are always riffling in the use of globals and decided to use FGVs with the EEG and fixed rather cases.  But this does not solve the problem of the conditions of race with critical data and you cause an additional burden.

    So from my experience, I use globals all the time for configuration data.  Yes, you must be careful about the race conditions.  But as long as you understand that it is a common and useful practice.

    I would not use a global variable for data that are constantly changing (use registers to offset or Action motor) and/or processes that have critical sections of code (use a motor of Action).

    NOTE: I use the definition of Mercer to FGV (a Get/Set only) and motor Action (many cases which specifically affect the data).

  • Average implement properly sampling frequency

    I am writing a program for the acquisition of data that reads the voltage and data current with a 3 phase generator, IE. There are 3 channels of voltage and data 3 (also represented under tension) current data channels come in my USB-6009.

    The waveform is not yet known but probably roughly sinusoidal until about a power of say 1.5 kHz frequency. I need to work on the (reliable) frequency in real time I know the speed of the generator. I use the 'harmonic distortion Analyzer' VI do basically this deep down it's a FFT on the data. I suspect it's too much an overload of treatment because if I increase to more than 1000 Hz sampling frequency, I'm starting to have problems - and if the data max 1,5 KHz I need to sample and analyze at least 3 kHz, of course.

    Yes - the question is, how can I get the sample to say 3-5 kHz and work on the fundamental frequency of a channel in real time without causing any fall?

    All responses are greatly appreciated.

    Dave

    Dave,

    (1) I prefer to put all of the analyses (as TFF) in a separate loop.  The loop of the acquisition is acquisition.  He acquires the data and puts it into a queue or motor of action to be used elsewhere.  In this way the acquisition schedule is not dependent on the time required for analysis or display or save to file...

    (2) lines are built in features that allow the data to be passed to independent parties to the program efficiently and without risk of conditions of competition inherent in global or local variables.  They also have interesting features like the clusters of the error and wait times.  Motor action are the screws in the form of a while loop with a shift register uninitialized to retain this data.  They contain generally structure case to allow the selection of different actions, such as Initialize, writing and reading, or more complex things like subset of return or average accumulate data.  Research on the Forum for the nugget of Ben and many other messages on the subject.

    (3) convert the data type as a whole.  Obviously, you cannot acquire a fraction of a sample, by using a representation of data that supports the fractions is not necessary.  In this case, it is not a big deal, but constraint points can tell you that LV is doing additional work behind the scenes to change data types, maybe not the way you wanted changed them.

    (4) Yes and no.  The FFT should work even if the signal to noise ratio is reduced.  Think of the component continues as being the 'noise' in this calculation.  If you want zero crossings, so it is essential that the offset be withdrawn.  With the current shift zero crossings will be moved off the middle of the sine wave points or the signal may cross any zero if the oofset is greater than the peak of the periodic component value.

    (5) I suspected something like that.  Multiplying is a bit faster than dividing so it is best if the speed is important.  If it is more convenient for the user or the programmer to get dividers, let the programme calculate the reciprocal multipliers.  Do it once, outside the loop where it does not affect the time.

    (6) I missed that you move data between the loops.  Can't do it with the register shift.  See point 2) on the queues or the drivers of the Action.  Notifier could be used also for the stop.  My opinion: the only place where you need a local variable is if you need to write a value to a control, such that when you set a saved a file configuration.

    A lot to learn.

    Another question: in the original post you said that you needed the determination of the frequency in 'real time '.  It is a slippery term.  You use it for anything other than the number of samples to read?  How fast can change the frequency?  What are the consequences of a delay in obtaining the frequency?  How late can tolerate you before that consequences are unacceptable?

    Lynn

  • Start stop while loop with tab control

    I want to be able to start and stop a while loop by entering and leaving a tab.  I use a structure of the event to do so, but it seems not elegant or the right way to do it.  The only way I could get to the kind of work is by unchecking the lock front panel in case of structure.  I have attached a sample vi of what I have so far.

    The problem is that you can't even stop the program by pressing the stop button until you exit the tab, which is not a user friendly interface.

    The event should just manage basic user events.  Any given event does not take a lot of time to run.  While you are in the diagnostics tab, your code is stuck in this while loop.  Although the setting of the front panel of the lock allows you to do other things, the LabVIEW is just put on hold all these other events of the UI (like Stop button value change) and cannot handle them inside while the loop stops and allows outside while loop to go through again.

    You should have a parallel while loop to manage waveform graph.  You can use notifiers or queues or a motor of action FGV (see Ben Action Engine Nugget) to switch the starting or stopping of the update of the chart of waveform until the parallel of while loop.

  • Active stocks: Compatible with DROID BIONIC?

    That we will be able to use the application of active Actions on our Bionic? I have seen that the RAZR will be built and really like the battery-saving features.

    Moved to Smart community Actions.

    Dupicate thread. Please continue the discussion here.

    Mark
    Support Forums Manager

Maybe you are looking for