Is there and alternativ​e to shift registers for saving data across iterations in a subVI operating inside a loop?

I am creating a subVI state machine (case structure) which will run inside a while loop which will be executing every 250ms. The reason I wanted to make the state machine case structure into a subVI is because I want to execute 64 of the machines within the same loop. The goal is to monitor certain types of voltage changes on 64 I/O channels on a FP2200 RT module and report periodic details about state changes to a database. My thinking was that by executing each independent machine in the same loop structure, I will only worry about one thread. It seems that the alternative of having one state machine thread per I/O channel is probably more than the RT module can handle. Please correct me if I am wrong on that.
The issue I'm now having is as I'm creating the state machine, I am finding that I need to keep track of some pieces of data from one loop iteration to the next. This is easy enough to do with shift registers but in order to use them, I have to create additional input nodes to my SubVI as well as output nodes. For example, I want to use a queue to buffer some I/O data but as of now, I have to create this queue outside the loop, pull it into the loop across a shift register, feed it to the subVI, and output it to the out Shift register. It would be better if I didn't have to output this queue because there's no reason for anything to have access to it outside the subVI. It just creates an extra set of wires to look at and makes me worry a bit about maintainability. 
Is there a better way to approach this problem? 

You could place a while loop inside your sub vi that has a true constant wired to the stop condition. Then add unitialized shift registers to that while loop to keep data between iterations.
or you could use a feedback node inside the sub vi

Similar Messages

  • Phone went through wash and everthing is now working except for the data.  Phone keeps searching...

    My phone went throught the wash and everything is now working except for the data.  It keeps searching...

    You can try getting a new microSIM for it. How long did you let it dry?

  • Customer Exit or BADI for PP61 (Shift Planning) for Saving action

    I have a requirement to enhance PP61 (shift planning). First of all this program accepts any update of attendance for values before than current date, i think it should not happen by default.  Thus we have to disable editing or display an error message when any user updates values for previous dates than today. I tried HRBAS00INFTY Badi but didn't get solution. Please give any Customer Exit or BADI name for this purpose.

    i have tried BADI - HRPAD00INFTY but it does not have sufficient parameters for this requirement. And i don't understand EXIT_SAPFP50M_001 or 002 use...can you expalin me how it will help out my problem?

  • How can I make triple partition for OSX, Windows 8, and for saving Data

    I read many articles on googles yet I still can't figure out how to.
    The point that I get is when you're installing Windows using bootcamp, before it actually try to install windows, i have to go back to OSX, choose disk utility and create the 3rd partition.
    But after I continue the installation, the windows boot camp partition can't be formatted and worse I can't use the drive to install windows 8.
    Other I read about deleting the recovery partition in order to make it works?
    I don't know .... I tried and I failed many times *sigh*

    1. Boot Camp doesn't support Windows 8, so wait until Apple releases new Boot Camp drivers.
    2. Boot Camp requires only one volume on the hard drive, so you can't create a volume to store data

  • Want to learn more about shift registers and formula nodes

    I am new to Labview and have looked at the example files and help files regarding shift registers and formula nodes. I was hoping that someone has a simple and detailed VI expaining how each of them(shift registers and formula nodes) works.

    Formula nodes are not one of the first things you will need to be looking at. look at the help files (press ctrl-H) for some syntax examples. Shift registers are easy: they carry the value from the end of the loop back into the start of the loop. The great power of shift registers is to use them without initializing. In that case they will retain their last value as long as the vi is in memory. This is a little more advanced topic, though.
    I included a simple example that illustrates what a shift register does. Requires Labview 7.1
    Good luck,
    aartjan
    Attachments:
    shift (LV7.1).vi ‏19 KB

  • How to generate pseudo random noise(PRN) binary sequence using shift registers?

    what is the block diagram to generate pseudo random noise (PRN) binary sequence of 1's and 0's using shift registers
    please help
     i need 2 submit this project in this week

    This is a fairly simple homework problem. My hints (on the LabVIEW side):
    1- look at while loops
    2- look at shift registers on while loops with multiple input elements
    3-look at the logic components, AND, OR XOR
    Look at this wiki article: http://en.wikipedia.org/wiki/Linear_feedback_shift_register
    Do the work, you won't learn if someone shows you how it is done! The palette that the previous post points to are of PRN and other "noise generators" but I suspect that is not what you are after.
    Know that creating a PRN with a reasonable number of shift register taps produces very pseudo results, as the "random" pattern begins to repeat pretty quickly, thereby making it not a truly random number. 
    When you have an attempt that is sort of working and want additional suggestions, post the code here. We won't do your work, we will help you try to do it, and learn it, yourself.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • For adding about 70 shift registers to my VI , will it affect the performance of the project or it depends on my PC ??

    I have 70 shift registers to accumulate date from 70 channels to plot it every channel individually , will these shift registers affect the performance of the project or it depends on my PC ??

    Osama90 wrote:
    I have 70 shift registers to accumulate date from 70 channels to plot it every channel individually , will these shift registers affect the performance of the project or it depends on my PC ??
    It will certainly affect your performance and ability to handle/change your code. Change it to an array of plots, either as a 2D array (if using the same sampling rate), or an array of clusters with the channels (1D array?) as data. From a machine perspective 70 SRs should work, but not from a person perspective.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • ITunes deleted all apps and all saved data lost...

    I connected my ipod touch to my computer and it started to sync. I was watching the info at the top when it started deleting all my applications. I clicked on the applications tab, and almost all my apps were unselected. I let it finish, and when it was done, I only had about 10 apps left. I reconnected it to the computer and selected one more app to put on my ipod, and it didn't bring all the saved data with it. I have now lost a years worth of stuff. I tried restoring from backup, but the latest backup was from after it deleted all apps. Anyone know how I can get all my saved data back to my ipod? Also, why would it get rid of all those apps. I know I didn't deselect them.
    Thanks for your help.

    I connected my ipod touch to my computer and it started to sync. I was watching the info at the top when it started deleting all my applications. I clicked on the applications tab, and almost all my apps were unselected. I let it finish, and when it was done, I only had about 10 apps left. I reconnected it to the computer and selected one more app to put on my ipod, and it didn't bring all the saved data with it. I have now lost a years worth of stuff. I tried restoring from backup, but the latest backup was from after it deleted all apps. Anyone know how I can get all my saved data back to my ipod? Also, why would it get rid of all those apps. I know I didn't deselect them.
    Thanks for your help.

  • Calculate maximum value of subarray while creating it using a case structure and shift registers

    I have two 1D arrays that contain cyclical information (kind of like a sine wave).  One that contains information on position in degrees and another that contains torque.  I would like to calculate the maximum torque value each time the position is within a certain range (e.g. from 30-80 degrees).  The ranges are repeated - that's why it is cyclical.   I use the "in range" function, a case structure and shift registers to build a new array with values that fall within the range I specify - this was the easy part (see VI attached).  I'm struggling with a way to calculate a maximum value for each subarray formed when values are "in range".   Your help is much appreciated.
    Solved!
    Go to Solution.
    Attachments:
    Simple Calculate between anatomical position range.vi ‏16 KB

    It's not really noise - it's more inconsistency.  So a position output can run: 20, 30, 40, 50, 60 etc.  OR, it could run: 21, 24, 32, 41, 44, 51, 59 etc. But, it is always cyclical. 
    Attached you will find a .csv file with the data arrays - I'm using POS (ANAT) degrees column (column D if you open in excel).  There you also see torque in ft-lbs along with some other information.
    Attachments:
    025C.csv ‏224 KB

  • Need help with while loop and shift registers

    I have a large data set and need to read in the data at maybe 200 samples at a time, process these samples through my VI, and have it append and concatenate a separate lvm file.  The part where I am confused is the shift registers. How do I limit the number of samples read in an iteration? How do I get the while loop to stop when all the data are read in?
    I've attached my diagram, maybe there is something wrong with my technique?
    Solved!
    Go to Solution.
    Attachments:
    shiftreg.JPG ‏56 KB

    This will give you an idea.  There are plenty of other (probably more efficient) methods.  This is a basic, quick and dirty solution to help you grasp the overall concept.
    Using LabVIEW: 7.1.1, 8.5.1 & 2013
    Attachments:
    ShiftRegLoop.JPG ‏54 KB

  • LV 8.21: strange behavior with DAQ tasks, parallel running VI's and shift registers

    Hello,
    I have made a VI using DAQmx vi's. The VI uses shift registers to store DAQ tasks and other (internal) information. I have implemented  several modes of operation (enum control with a case structure) like 'init', 'read AD', 'config AD' etc. If I use this multi mode VI in a single main VI everything work as expected. I have attached a jpg that shows one example where the DAQ VI is called from 2 parallel running while loops. One loop aquires the data (LOOP 1) while the other loop configures the aquisition task (LOOP 2). If I implement the same thing by putting LOOP2 in a different VI that runs seperately from the first VI I get an error message (200428):
    Possible reason(s):
    Measurements: Value passed to the Task/Channels In control is invalid.
    The value must refer to a valid task or valid virtual channels.
    Task Name: EasyDAQ_AD
    Of course, the second VI is started manually after the 1. VI has passed the initialization part. The error message is triggered from the 1. VI that executes the DAQ task. From my understanding of the LV execution system this seems like a bug to me. Does anyone have an idea what could go wrong here?
    klaus
    Attachments:
    problem.jpg ‏30 KB

    1. In general, this kind of technique is something I've been using successfully for years.  (Ben recently wrote up a very nice treatment of these "Action Engines" as a "Community Nugget.")  So I don't start by expecting this to be a bug in the LV execution system.
    2. Your description of the problem sounds almost backwards.  You say you manually start the 2nd vi ("Config AD") *after* running the 1st vi ("Read AD").  Seems like you'd need to do the Config 1st and then do the Read, right?   I kinda suspect you actually did it in the right order, but described it wrong.
    3. The next likely scenario is that the Config failed, but you didn't trap the error and were unaware of it.  Then it makes sense that the Read would also fail.
    4. A couple issues I regularly deal with in these DAQ Action Engines is internal error handling.  I often keep a shift register inside to store errors generated inside the Action Engine.  But it can get a little tricky doing sensible things with both the internal error and any other error being wired in as input.
    I said all that so I can say this: if you have complex nested case statements, or lots of different action cases to handle, double check that the task wire makes it from all the way from left shift register to right.  Sometimes they get lost if they go through a case statement, the output tunnel is set to "use default if unwired", and 1 or more of the cases don't wire the output.
    -Kevin P.

  • I just purchased NFS Shift 2 for my iPad 2 and there is no audio!  Any help?

    I just purchased NFS Shift 2 for my iPad 2 and there is no audio!  Any help?

    I have previously used a recovery app to get back my lost contacts and photos. I just checked the app on my mac and found out it provides recovery option for calendar so it may help in your case.
    Step by step tutorial available here. Select recover from iOS at start up and only check calendar option in your case.

  • Multiple shift registers in For loop

    I'm using multiple shift registers to find the number of different string in a string array. However, the shift register got refreshed every time it finds a different string and returns back to 0. How can I have the register remember its previous value after it encounters a new string value?
    Solved!
    Go to Solution.
    Attachments:
    count.vi ‏19 KB

    You should think about making your code scalable. At the moment, you need to re-architect the VI from scratch whenever the sensor names or their number changes. If you suddenly have 1000 sensor names, the code would be unmamangeable because the sheer number of cases and shift registers!
    Attached is an simple alternative. As you can see, the code remains the same, even if the number of sensors or their names changes in the future. See if it makes sense. (You can easily modify it to also count unrecognized names, for example).
    Modify as needed.
    Some other possible bugs in your VI:
    You should initialize the shift register with zero, not one. Right now the results are one too high.
    Case "B" is actually "B." and the count is only accidentally correct because it is also the default case and there are no other sensor names (e.g. F) in the input array.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    CountMOD.png ‏19 KB
    countMOD.vi ‏19 KB

  • Any way to sample segment length longer than loop iterations w/o shift registers?

    Hi all,
    My loop iterates approx every 0.06s and now i've been asked to add to the program a function which will sample the most recent 3s of data and return the max/min value for two of the signals.  I can think of a programmatically clumsy way to do this with shift registers- take the max/min for each iteration, save-repeat-compare until you have enough iterations to fill 3s of time.  But I can't help but think there has to be a cleaner(better?) way to do this. 
    Any help?
    Thanks
    Solved!
    Go to Solution.

    Hi there,
    Try looking into a circular buffer.  
    http://zone.ni.com/devzone/cda/tut/p/id/7188
    Once you've determined how often you're putting entries into the buffer, you'll know exactly how big of an array to grab and do the Min/Max on.  
    Another option is to use a circular array.  
    http://decibel.ni.com/content/docs/DOC-3414
    I would set this up to function a little like a Functional Global or an Action Engine.   The subVI would then be used in your DAQ loop to "stack" new data.   And then called in another loop or part of your code to be read every three seconds.  
    Patrick Allen

  • Better method than using a large number of shift registers?

    I'm trying to work with example code provided free by stanford research systems (http://www.srsys.com/downloads/soft.htm).
    Their example software alows the user to run an analog scan across 100 masses (the x axis) which progressively produces a graph of all the data. It repeats scanning (and updating the graph)until the user hits stop.
    My goal is to find a way to make the program display the graph of the last scan while it is displaying the current scan (this way it is possible to compare the graphs and see how they change). But as best I can tell the data is generated and plotted in a while loop piece by piece so the best thing my labview inept mind has managed so far is using a large nu
    mber of shift registers and graphing the points as they generated along with points that were generated 10 cycles ago in a different color.
    So I hope to either find a good way to use shift registers to get values from over 100 cycles ago (which doesn't really seem to work unless i just make space for over 100 little arrows in my loop) or to find a better approach to the whole mess.
    The example does not seem to use XY plot and to tell the truth I don't know exactly what its using to plot.
    Can anyone offer any guidance or at least understand my question enough to point me in the right direction.
    I'm including the stock example and my adaptation to it but if you need to use the included sub vi's the package is on that SRS webpage I listed above (look under RGA).
    I suppose this may all be too much to ask but I can dream can't I?
    Attachments:
    original.vi ‏87 KB
    changed.vi ‏92 KB

    I certainly agree that the DAQ programming is the part leaving me most confused. I'll attach the package that I am trying to modify, the trouble is there are so many sub vis involved in actually acquiring the data that I am not entirely sure what format the data comes out in.
    Perhaps to someone more skilled than I am with lab view the inner workings of this package would be clearer. If you are up for it then look at SRSRGAa simple analog.vi in SRSRGA61.lib and you can see what I'm working with.
    I'll also attach my attempt to modify the code to make it work like altenbachs example... however somehow it would seem my timing/synchronization is off. Hope some of this makes sense, I'll see what luck I can have with get w
    aveform components, I suppose I have been approaching this so far as if my DAQ was just giving me data points as opposed to a waveform.
    Attachments:
    rga_lv_61.zip ‏2132 KB
    graph_app.1.vi ‏101 KB

Maybe you are looking for

  • QuickTime Error Message: "QuickTime Player quit unexpectedly"

    Error Message:  "QuickTime Player quit unexpectedly" From the error report (sent to Apple):           QuickTime 10.2 (603.6)           Operation:  Launch           Application Specific Information:  [565] stack overflow Hardware and software configur

  • Skype getting off

    I have a sony bravia ex65 Led tv with skype ready tv. I bought cmu-br100 Camera and used skype. After 2 Months the skype after connet it is disconnecting saying camera is disconneted. Kindly help me in solving this problem. My email is *removed for p

  • HT5655 This doesn't work for me

    I follow this, but I just keep getting to the same place again.  It's just a cyclical error.  I click on the Blocked plug-in then follow the steps, then get the blocked plug-in again.  Any other help out there?

  • Putting a outside file into unix through OAF

    Hi all, is it possible to put a file (an excel file ) from windows into unix in one particular path in unix through OAF. Actually we have a requirement that we need to upload excel file every month into unix to run a concurrent program. So client won

  • Illustrator CC 2014 occasionally unresponsive to the command "Open" file on Yosemite

    Illustrator on Mac OS 10.10, often disregarded the command "open", both by accessing the "File" menu or by keyboard shortcut. Someone with the same problem? Hello Adobe! Some perspective to repair this problem?