Converting from case structure to arrays

I am working on a set up that write out 8 digit binary to a connector block. I had it set up with a case structure but there are over 40 different writes and it is becoming way too convoluted. I know it would be much easier to do this with arrays but I have no idea how to use them, please help.
Here is my current program:
Attachments:
42sampleWorkingCode.vi ‏974 KB

Here is a quick attempt to do everything with arrays. See if it makes sense to you. As you can see, the code is much simpler. (LabVIEW 8.0).
You should be able to adapt some of the ideas. Many additional simplifications are possible, for example you could calculate the port 0 values directly from the outputs of the upper Q&R function. Try it!
LabVIEW Champion . Do more with less code and in less time .
Attachments:
timedBackboneWithLEDnewlogoMOD.vi ‏384 KB

Similar Messages

  • How extract data from case structure

    Hi all, I would like to extract the data from case structure, it's circled in red in the attached file. How should I do it? Thanks for taking your time to look at my post. Your help is greatly appreciated.
    Attachments:
    bp.jpg ‏161 KB

    Thank you guys for your prompt reply.
    As u can see from the vi, there's an error, I need the values in the circled area to be passed on to the block ( Bundled by name)
    Thanks !
    Attachments:
    fyp_bp_only.vi ‏90 KB
    fyp_bp_only.vi ‏90 KB

  • Is there a known issue with emailing from case structures

    Hi,
    I am working on a quality control vi for data coming in as a text string. I need to be able to have the vi perform a check with the responce to the check (true or false) will cause different steps to then be performed. I was able to get the vi to perform 1 check and email out if the responce was false. When I tried to add a second check if the responce was true, the vi would run without any errors but would not email out or would only email out from the first check even if the first check passed and it was the second check that failed. This was all done without case structures. I then started using case structures with the true responce leading to other checks but the false responce leading to an email generation. For some reason even a simple one check with the email generation happening in the false case will not work. There are no errors or anything, it goes through the whole process correctly but will not send an email. Please help!!
    Tim Koles

    Hi,
    Here is the vi and the sample text file it calls for. You will of course have to change the path name. Feel free to call me if you have any other questions. Thanks
    Tim
    410-326-7259
    Attachments:
    SPLIT_WEATHER15.TXT ‏130 KB
    Weather QCexample.vi ‏63 KB

  • Feedback node from case structure

    checkLED.vi is my first rev of this. Then I realized I can incorporate the 345/348 selection into the case structure, which resulted in checkLED2.vi. However as soon as I did this, the feedback loop inserted itself. I don't understand why this happened and what it means. The string coming from the case structure is an INPUT to the two 34970 vis. There is no feedback going on here. If Labview sees this as feedback, why didn't it insert the feedback node in checkLED.vi?
    Attachments:
    checkLEDs.vi ‏23 KB
    checkLEDs2.vi ‏23 KB

    Look at the dataflow you have created by moving the strings into the case statement. The case statement requires data from the iteration terminal and from the VI in the sequence structure. The sequence structure requires data from the switch VI which in turn requires data from the case statement. This is a clear feedback situation that you did not have before.

  • Merging Signals From Case Structure

    Hello,
    I am making a scanning program which requires several cases to be evaluated within two for loops. I've hooked up both conditions in a while loop, and I know that because of the conditions only one of the wires will be executed. In two of them I modify a parameter and one I leave it alone, but I am unsure of how to connect the three to the module on the right. Any tips?
    Thanks for your help,
    gordonj005
    Solved!
    Go to Solution.

    When you drop a new case structure onto the block diagram, LabVIEW creates a structure with two cases by default.
    To add additional cases, right-click on the case structure and select "Add case".  You can either "Add case after" or "Add case before".
    You can learn a lot by experimenting, right-clicking on things and examining your options, and using the LabVIEW help.  Since it seems that you're pretty new at this (not knowing how to create additional cases was the clue-in), I'm trying to give you some tools for learning on your own.  I'm not trying to be mean. 

  • Converting from spreadshet string to array and then back to spreadsheet string

    My questions is; why is the Spreadsheet string to array function creating more data than the original string had when you change the array back into a spreadsheet string. Im trying to analyze a comma delimited file using array functions since my column and row size is constant, but my data varies. Thus my reason for not using string parsing functions which would get more involved and difficult. So, however, after i convert to a 2D array of data from the comma delimited file I read from, and then I convert back to string using the Array to Spreadsheet String, I get added columns to the file, which prevents another program from receiving these files. Also, the data which I am reading is not all contiguous, it has gaps in some places for empty data. Looking at the file compared to the original after it has gone from string to array and then back to string again, looks almost identical except for the file size which got larger by 400 bytes and where the original file has empty spaces, the new file has a lot of commas added. Any idea?
    Charles

    The result you get is normal when the spreadsheet string contains rows of uneven length. Since the array rows have the same number of elements, nil values are added during the coonversion. And of course, the back to string conversion keep those added values in the string, with the associated commas.
    example : 3 x 3 array
    1,2,3
    4
    5,6,7
    is converted into
    1 2 3
    4 0 0
    5 6 7
    then back to
    1,2,3
    4,0,0
    5,6,7
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Start event from case structure

    I'm running my main programm inside an event of an eventstructure.
    Beside this main event I additionally have 3 other events in this event structure.
    To save "screen space" I would like to start indirectly one of my other events from a case
    placed inside another event.
    Is this possible - would be glad if you have an example.

    You are still completely misunderstanding the purpose of the event structure (see also my answer the other thread).
    The main code of the program does NOT belong inside an event structure. What good is an event structure if it is tied up indefinitely inside one of the event cases???
    An event structure is most useful for dealing with interactions by the user and must be ready to handle those at any time. It is not a tool to "save screen space" (whatever that means). If you are running out of diagram space, consider wrapping your code segments into subVIs.
    LabVIEW Champion . Do more with less code and in less time .

  • Convert from Case-sensitive Journaled to Journaled without Format Possible?

    Hi.
    I am now trying to install Adobe CS3 but it will not install unless I have the OS system on the non-case-sensitive volume. I went to Adobe website and the only way to solve the problem is to install the software on the volume that has Mac OS Extended (Journaled) format.
    Currently, I am using Mac OS Extended (Case-sensitive, Journaled). I would like to ask whether there is anyway I can "convert" my current format into Mac OS Extended (Journaled) without having to format (i.e. erase the disk)? It will be a real pain to erase everything before doing so just to install Adobe CS3.
    Thank you in advance!

    I never use case-sensitive. You're going to have to go back and erase your hard drive so that it's formatted as "Mac OS Extended (Journaled)" with a single GUID partition if the case-sensitive part is giving you fits. I don't know what OS you're running but, as far as I know, not even AutoCAD 2013 for Mac will run under Mountain Lion (that's the last I heard, anyway).
    Clinton

  • Case structure with arrays

    why don't the array values are not shown in array 0 and array 1 in the enclosed attchment array0.vi.
    thanks
    Attachments:
    array0.vi ‏14 KB

    Then default value then NOT wired is an empty array. So using array 0, as an example. It will be filled with data on iteration 0. But this data will be overwritten with an empty array. In the next iterations.
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • How do i output multiple arrays from a case structure to create one larger array

    I currently have a vi that has one hardware input that i needed to take a measurement then be moved and take a similar measurement at a different point.  To accomplish this i used a while loop inside a case structure.  The while loop takes the measurement  and finds the numbers i need while the case structure is changed per the new measurement location.  I want to take the data points i have created in each case and output them into a single table.  I assumed to do this the best way would be to get the data from each case into its own built array and build a larger array but I cant get the information out of the case structure so that it all inputs at different places.
    thanks for your help
    Attachments:
    Array.vi ‏30 KB

    Hi Ross,
    attached you will find a solution for your table building problem.
    I would suggest thinking about program design - having the same case content in several cases doesn't make sense. I also would not want my user to press several stop buttons depending on choosen measurement...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    Array.vi ‏45 KB

  • In the attached VI I dont understand why data from the inner case structures are not being transmitted to the array.

    In the attached VI I don't understand why data from the inner case structures are not being transmitted to the array.
    Thank you.
    Solved!
    Go to Solution.
    Attachments:
    TEMP.vi ‏25 KB

    It took me some time to figure what you are trying to do but I think I have it now.
    The SR is still required.
    What is happening is your "Bundle By Name" is replacing all of the fields of the cluster, not just the value coming out of the case structure. So to maintain the cluster stuff you do in earlier iterations you can either...
    1) Put the "Index array, Bundle by name, and Replace array" inside the case structure and ONLY bundle the value you are setting in that iteration. (as you will see Tim post shortly)
    OR
    2) Move the Index array before the Case, unbundle all of the fields and feed teh case structure and run them across the case so that ALL of your output tunnels come from the coresponding input tunnel EXCEPT for the filed you are trying to set.
    Ben
    Message Edited by Ben on 05-05-2010 01:31 PM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Trying to clear an array inside a case structure

    Good morning all.  I am trying (unsuccessfully, obviously) to clear an array inside a case structure.  (See case structure at right side of vi, I colored it green to make it easy to find).  Here's (briefly) what I'm trying to do.  I have 6 test probes in the process.  All six probes are connected to the Alcatel Detector through a 6-solenoid manifold.  As I run the test, I want to sample 1/second, for let's say 3 minutes.  For the first 30 seconds, I want to pull a sample from from probe 1, so I turn on solenoid one and leave it open for 30 seconds.  Now all 30 values are tagged as having come from Probe 1, and they're stored in array 1.  I can now compute an average value for probe 1. Then I close solenoid 1 and open solenoid 2, saving the next 30 values to array 2.  (and so-on, until I have measured all 6 probes for 30 seconds each).  Then I wait a pre-determined amount of time and repeat the process.  Here's my problem.  I want to clear out each array as I begin the second iteration, so that I can easily compute the average of the last 30 values.  If I initialize the array by connecting a constant 0 to the shift register on the for loop insid ethe case structure, it does not work, nor does it work to place the 0 outide the overall for loop (the next for loop going out, NOT the OVERALL for loop).  I know my programming skills are still crude, but I'm putting everything into this.  Anyone have any suggestions? 
    Attachments:
    HCMF rev 1 25 Apr.vi ‏485 KB

    Altenbach, I definately understand your approach, and I like it much better than my own.  But I still have no luck making it work.   I get the same result as before (my original attempt).  Value 0 of the array simply changes each iteration, with nothing "saved".  Each new value simply overwrites the last value.  Can you take a look at my new vi, with changes, and see if you can find the error of my ways.  I am but a rookie Jedi in the vast reaches of LabVIEW Space, and you are no doubt a Jedi MASTER
    Attachments:
    HCMF rev 1 25 Apr pm.vi ‏374 KB

  • How to implement index array inside case structure for searching a 3D array?

    Well I have a 3D array and I want to index certain elements from that array. And I have thought of one way of doing this is to have multiple index array functions on the block diagram to search the array simultaneously, but that would be messy. Or I could setup some kind of case structure and place each index array function into individual cases. I've tried the latter, but when I connect the 3D array to the case structure at the"?" it doesn't give me permission because it says I'm hooking up two different types of data. Case Structure is for T or F and 3D array is not a boolean.
    So how can I setup the Case Structure to work for a 3D array?

    A case structure's selection tunnel cannot accept an array.  What exactly are your search criteria?  It sounds like a few FOR loops will be needed.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Switching from case to event structure

    I once down converted some LV 7.0 code to 6.0 and it (automatically) converted an event structure to a case structure.  When trying to upgrade some code to change a case structure to an event structure, I didn't see any means for doing that (a flat sequence, yes... event structure, no).
    Is there a way to convert a case to an event structure -- if not, why not?
       ...Dan

    No, the question is very valid!
    The resulting code does not need to make sense immediately, but I have desired this functionality (=convert case structure to event structure) at several occasions. I have many legacy programs that were made before the introduction of the event structure. Some contain big case structures with many cases, one is the "idle" case which only contains a small wait statement, while others are executed if certain controls change their value. (Sort of a poor man's event structure emulation ). Upgrading this old code would require a simple replacement of the case structure with an event structure so each event case contains the code of one of the original cases, followed by a quick manual cleanup (assignment of the event triggers, etc.).
    Without such a conversion tool, my code upgrade is major work, especially if there are many cases and dozens of shift registers crossing the case structure. Basically, I need to rebuild things from scratch.
    Summary: It would be useful to be able to easily convert between event structure and case structure and vice versa using a "replace" command. I even remember asking for this functionality.  I would use it!
    LabVIEW Champion . Do more with less code and in less time .

  • Converting from LDA_DEF to SvcCtx structure

    Does anybody know how to convert from an LDA_DEF structure (OCI 7) to a service context (OCI 8). We tried to use OCISvcCtxtoLda function but it doesn't work.
    Can someone help, please?
    thanx
    Claudio

    Here are the best advice for moving catalogs :
    http://www.johnrellis.com/psedbtool/photoshop-elements-faq.htm#_Move_your_photos_1
    and :
    http://www.johnrellis.com/psedbtool/photoshop-elements-faq.htm#_Move_your_photos
    The principle is quite straightforward : you do a full backup of your catalog from PSE5 organizer on an external disk and you use PSE9 to restore it. PSE9 should prompt you to convert the catalog : you do. It will then create a copy of the catalog folder (the one containing the database) in its own format.
    My suggestion is not to choose the same location for restore, due to differences in the Windows versions folder structure. Rather create a new top photo folder, for instance 'My pictures new' and check the option to keep the folder structure as also advised in the links above. The resulting structure may look a bit strange, but you won't have to reconnect missing files due to Windows variations in folder naming and structure.
    If you start with a clean catalog, after a search for missing files, checking for errors and optimizing, everything should go well.
    Remember though that you will get back your catalog and pictures, but you'll perhaps have to reinstall actions and plugins you may have in PSE5. This can be done on a case by case method.

Maybe you are looking for