by comparing timestamps using shift registers

Hello

I would like to compare two variables x & y in time real VI for three consecutive timestamps and turn on a Boolean value if it's true. Please note that the time stamp updates randomly.

I want to keep the number until the timestamp changes again and reset only if the values are the same after the recount of second or third. The problem I have is the delay time in the while loop resets the counter.

Attached the problem I have is the delay time in the while loop resets the counter. is what I've done so far.

Thank you for your help.


Tags: NI Software

Similar Questions

  • Using shift registers global verses

    I'm new to 2009.  Our last update was 7.1.  I'm upgrading our laboratory SW and using events.  EVENT 1: is used to display the data in a text file in a table "data set".  EVENT 2: using to option button and the table "Data set", the user selects the data column to use for the test that is displayed in a table «Points de Test»  EVENT 3: If the user changes the data in the table "set of data', 'Points of Test' test point table is the update.  I use local variables for 'Set data', 'Points of Test' and I was going to use other settings as well (radio button, etc.).  I also think about using a shift register to realize that the same information.  I used shift registers in the past and they can be annoying, but I also understand that you should stay away from variables.  Please pass along an Advisor on the use of local variables shift verse records.  THANKS in advance!

    I don't know what you defined as 'EVENT 1' to '3', but they seem to be quite the case.

    The use of shift registers sounds messy, but they are much better than local Variables If you parallel threads past in your code.

    Clean the threads between the shift registers is to use clusters.

    People of the country appear more clean, until they 'byte' you in the... code...

    EDIT: "they are much better than local Variables If you parallel threads going on in your code" I have to explain... If you have parallel code that uses Variables to local variables as this may lead to a race or conditions...

  • Simplify the VI that rate but currently uses too many shift registers

    I have a VI that was made by the Director of scary movie, so beware, this VI is a nightmare!... or at least for me, it is.

    Background:

    I have 20 pans and I have a water level sensor that generates a voltage of 0 to 5 Volts Output. By knowing the volume of the Pan, I calibrated the output to be in gallons. Real output I need is a volumetric flow, i.e. gallons per minute per square foot. We currently is key this by using a VI that a filed summer internship (see table). It works well, but it's so dirty and difficult to clean up and expand. The plan is to have 100 total pans and I don't want to copy paste this code 5 times more!

    Issues related to the:

    -How can I earn a rate differently? If you notice on the attachment Subvi calibration, the rate is calculated manually knowing how fast the loop going in the main VI. I don't know if this is the best way

    -Can I get rid of the shift registers some how?

    Is there a way for me to combine the subVIs in calibration so that I don't have a Subvi for each channel?

    Thanks in advance!


  • Sort of the length of the sample segment longer that the iterations of the loop w/o shift registers?

    Hi all

    My loop runs about every s 0.06 and now I was prompted to add to program a function that will enjoy the latest 3 data and return the max/min value for two of the signals.  I can imagine a clumsy way by program to do this with SHIFT registers - take the max/min for each iteration, save-repeat-compare until you have enough iterations to fill 3 s of time.  But I can't help thinking there must be a cleaner way (better?) to do.

    Any help?

    Thank you

    Hello

    Try looking in a circular buffer.

    http://zone.NI.com/DevZone/CDA/tut/p/ID/7188

    Once you have determined how many times you put entries in the buffer, you will know exactly what is the size of a table to enter and do the Min/Max on.

    Another option is to use a circular table.

    http://decibel.NI.com/content/docs/doc-3414

    I would be created to operate somewhat like a Global functional or motor of the Action.   The Subvi would then be used in your loop DAQ for new data "stack."   Then called in another loop or part of your code to read every three seconds.

  • How can I clear the shift registers of sub for loop for each iteration of a larger loop?

    Hello

    I write a program to concatenate multiple text files.  However, I need to treat each column individually before they are concatenated.  I use one for a loop at normalze 6 columns choice the largest loop of concatenation.  However, the shift registers store data from previous iterations of the larger loop.  How can I clear the shift registers of the void loop based on the iteration of the larger loop?

    Thanks in advance!

    OK, that's fine. are there headers?

    In all cases, all you need to do is to place all of the 2D array in the shift register of the inner loop, iterate over the columns relevant to be normaized (use 'index array' to get the column it normalize, put it to help to "replace the subset of table".) You probably want to initialize the outer loop shift register. Use then "building the table" added to the beginning or the data of each file sets.

  • Cluster vs multiple Shift Registers

    I had a question about good coding practices.

    Say you have several elements (numeric values, strings,... whatever) you need to iterate between the loops.

    Is it better to make a registry change for each item?
    Or cluster, and then move the cluster to a single shift register?

    It is faster than the other? Or better/worse for another reason?

    Cory,

    Yes.  and no.

    I usually create a large cluster of typedef I call indicators and flags (InF).  I put most of the things that need to be passed around with that.  The cluster of error, the State enum and large data tables are usually in separate shift registers.  Table L: shift registers and data are at the top of the loop and error and SRs of the State are at the bottom.  Most of the code goes between them.  Given the help of bundle/Unbundle documents name to which the data is used in a case.  The InF cluster is usually not displayed on the Panel before and may exist only in a Subvi to save space of block diagram.  The data are unbundled indicators as needed for display to the user.

    If you have a situation where speed is concerned, separate data that must be processed everything quickly and optimize for that.  Strings and arrays within the cluster probably cause some memory interesting distribution issues since they change size, that can be an argument in favour of that separates them.

    Lynn

  • Shift registers loop when the chain is connected to the registers

    Hello everyone! I just need to know how these shifts of registers. For example a photo added, I have a stacked sequence structure. Some time ago in a loop with inside case structures. As you can see, there is registry to offset looping with initial string and on the right side of passage registry there is string "entry". So my question is when we run the VI, to check the error case it is going to start from initial case and then transmit the information to the case of entry into the structure of the case. So basically, I need to know how the shift registers can be used with the structures of the case and while loop.

    http://www.NI.com/Tutorial/9330/en/

    With this you can post a photo that is executable code.  For us looking at your code is not better than watching a photo with text in Notepad.

    That being said here is some information on shift registers.

    http://www.NI.com/getting-started/LabVIEW-Basics/shift-registers

    https://zone.NI.com/reference/en-XX/help/371361H-01/lvconcepts/shift_registers_concepts/

    To simplify your code, I highly recommend getting rid of the outer sequence structure.  Stacked sequence structures serve generally to cause new problems to users, and sequence variables compound which.  If you want the code to run before the main States are called, you can have a status of initializing in your state machine and do be more manageable.

  • Uninitialized shift registers compiled in a DLL retain their values?

    Hello

    I'm using Labview 8.6 to create a DLL and then I create another Labview program that will call this DLL.  Within the DLL is a function called Untitled2 which is your basic uninitialized shift register.  It has a digital input which can be put in the shift register, and then I can read the number back.  After that I build it to the DLL and call it from another Labview program looks like registry of offset values are lost.  So, my question is whether Labview DLLs that contain uninitialized shift registers to the as registers of the SHIFT to retain their values?  I enclose a copy of Untitled2.vi so you can see my simple test vi.

    Does anyone know also - all good articles on the creation of DLLs in Labview?

    Thank you!

    Steve

    The short answer is the fastest is to call a VI a VI with a direct appeal. Any other way to do so is somehow above enveloping mechanism which means added. If you want to hear some details, you can read on.

    When a caller VI loads, it is "patched" with its subVIs. This means that he holds on a pointer in which he can use to call effectively than VI. The appellant also assigns a list of parameters for each call. When the call runs, the only thing the caller must do is to fill this list of parameters with the locations of their data and pass the pointer to this table in the code of the Subvi.

    When you call a VI that is embedded in a DLL, the call library node must all first set all parameters in the form provided by the convention call DLL. This is different from the approach of list for the parameter of LabVIEW and usually is to set each parameter on the processor stack. The function exported in the LabVIEW built DLL, must first obtain a connection to the VI to run. She accomplishes this by obtaining a reference VI of a cache of VI references created in the loaded DLL. Each VI reference has a list of parameters that should be filled in the settings for this call. It can then call the code. When the code is complete, there may be additional work to put the outputs in the form provided by the appellant. The VI reference must then be returned to the cache.

    So there will be several manipulation of the parameters in the call to a DLL and a couple of access to a cache may cause overhead and additional jitter include parallel calls. Even a call via a strict VI one reference would be faster. With whom you are in direct control of the VI reference so cache intervenes and the call puts the parameters directly from a list of parameters, the Subvi expected so there is less handling it.

    There are also several other limitations introduced by calling a VI in a DLL.

    1. If you are reporting to the DLL that contains the handles, then you must make sure that the DLL is called from never screw in the same version of LabVIEW. If you do not do this, then you will be allocated in a nursery memory to another instance handles and LabVIEW will stop.
    2. If you do not pass data containing the handles, then LabVIEW must make copies strings or arrays that are passed to the DLL, hindering more performance.
    3. Préallouée reentrancy is not available through dll. It's the kind of reentrancy, which allows the slot - VI maintain state specific to each caller. When it is called by a DLL, we have no idea where we are called to so we cannot give you a specific instance. Each VI reference in cache will be a specific instance of the VI but not sure which one you will get. Essentially, this makes it reentrant in dll screws act as shared reentrant. (Which could explain why it does not seem like your uninitialized register shift worked.)

    I hope this doesn't scare you use LabVIEW to create the dll. When you need to communicate to other software, this is the way to go and all of these steps are necessary to cross this limit. But if you're already in LabVIEW is not an ideal replacement to directly call a Subvi.

  • StateMachine in Subvi, restart shift registers

    Hello

    I'm having a problem with a reentrant Subvi, which implements a State Machine. The Subvi is called only once in the code, so problems with re-entrant execution concave/no is not the problem.

    The Subvi implements a State Machine whose output is a reference position for a drive motor. The state machine is implemented with while loop with shift registers. The Subvi is called once each control cycle (cycle being about milliseconds time), so that the State Machine while loop is executed once each cycle control (stop Terminal is connected to 'true'). And the shift registers are used to save data between executions.

    When I opened the main VI, it works perfectly. When I stop the VI and restart, the Subvi begins to use the last values of the previous main run of VI. I want that my position reference to start from 0. I guess my problem is that I should start the SubVIs shift registers.

    Is there a way to do this without adding any extra code? (Perhaps an invoke node functionality for the Subvi or something like that?)

    Thanks in advance for your help

    Best regards

    Pestana of Jesus

    Hi jespestana,

    I recommend adding a case of initialization.

    Mike

  • Shift registers 'for' loop can accomidate how

    Hello

    I would like to know how shift registers we can add in for or while loop.

    Thanks in advance,

    Krishna

    Thanks for your quick reply Jarrod.

    Kind regards

    Krishna

  • Need help with while loop and shift registers

    I have a broad set of data and required to read data at maybe 200 samples at a time to process these samples through my VI and have add and concatenate a file separate lvm.  The part where I am confused is the shift registers. How can I limit the number of samples read in an iteration? How do the while loop to stop when all data are read in?

    I have attached my diagram, there may be something wrong with my technique?

    This will give you an idea.  There are a lot of other (probably more effective) methods.  It is a basic solution, quick and dirty to help you grasp the overall concept.

  • The use of registers at offset in a while loop that never loop

    Here's a picture of 'syslog_Device function Engine.vi. This isn't really a question specifically about this vi, but rather a technique I see here.

    First thing I noticed, it was a while loop always outputs, never loops. And shift registers. This serves for the VI can retain values between calls, almost like what I consider a local variable which are persistent between function calls in another language? It is an interesting way to accomplish what I have not looked at.

    Please tell me if I'm missing what is happening here.

    It is a driving force.

    It's a code construct that allows you to encapsulate data and features that are available in multiple threads.

    The nugget I linked above explains their operation the theory behind them and follow-up discussions in discussion on how to exploit them.

    Good questin incidentally!

    Ben

  • Cannot select several XControls in PS using shift + select

    I can't select multiple XControls using shift + mouse click.

    Bug?

    (2011)

    Hey BA, have you considered an accounting separately for the different voices in your head?

  • I deleted the file from my desktop using Shift + Delete how to recover this file?

    Earlier I deleted my desktop using 'Shift + delete' important file how to recover this file?

    Please see the thread of the following responses:

    How can I recover the files deleted (with shift-delete)

    This solution provided by 101 pretty much says it all.

  • When I connect AS400 and use SHIFT + f9 screen to do at night.

    * Original title: shift + f9

    Hello

    I bought lenovo with window 8. I use the VPN client with AS 400 and to get the command-line on AS400, I had used on my key position previous computer + F9 which supposed to be F21. But when I connect AS400 and use SHIFT + f9 screen to make night and it does not matter, I use only F9 or shift + F9 screen to night and back but I can't control line. Help, please

    Hello

    Please contact Microsoft Community.

    Since you have a problem with the VPN connection, this question is better suited for Microsoft TechNet Forum so I suggest you to send this request in Microsoft TechNet Support Forum, follow the link below.

    https://social.technet.Microsoft.com/forums/en-us/home?Forum=w8itpronetworking&filter=AllTypes&sort=lastpostdesc

    Hope this information was helpful and let us know if you need more assistance. We will be happy to help.

     

Maybe you are looking for

  • HP Envy m6: need to update my ram on my hp Envy m6 (AMD A6), currently its 4gig I can he move to 8 GB.

    its becomes slow, I use to play games with the laptop, but now it's not as fast as it was, as it takes the usual time to load google chrome or open a page on chrome or any other browser, even with the internet at its maximum.

  • My iPhone 6 s suddenly sends messages text green instead of blue

    I got my iPhone 6 s two days ago and he was sending text messages normally. I recently received a strange call on my phone number (602) 734-1007, and right after that my SMS all turned to the green instead of blue. I am people texting with iPhones an

  • Eject external hard drive

    I have a brand new MacBook Air, I bought only a couple of days.  I've been sorting through photos using my external hard drive and I get messages saying "hard drive not ejected correctly" even if I have not disconnected it.  I had this drive hard for

  • Efficiency and design of front panel

    Hello I have developed an imaging program (Please find the attachment). I have any sense and works very well. How ever, I don't think that the design of the façade of my VI is very effective. Here's what concerns me: Definition constants and the use

  • How to make my old address book Outlook Express for Windows Vista Business email?

    Recently, I installed Vista Business on my computer. I forgot to save the old address book of outlook express. When the installation is complete, a window pop up told me that a windows.old has been created for the old files etc. I can find the progra