Scripts (connect a Terminal to a flat sequence Structure)

(script)

Is it possible to connect a terminal to a flat Structure of the sequence?  (in my case, with a single frame)

(with the "Connect Wire" method)

Ouadji wrote:

but the main question is... Why the flat sequence structure does not inherit from node?
Why the developers chose this?
What is the main idea of this choice?

Flat sequence Structure introduced in LabVIEW 7.0, provides a semantic schema object that no other object has. It is a structure of multi-frame (like a case structure or a stacked sequence), but it is the only structure where data can be wired between frames through normal tunnels. It is the only structure which may have tunnels in places other than its external borders. It is the only structure that can have subdiagrams of different sizes in different positions. It also introduces scenarios of strange wiring that you won't find elsewhere:

At the same time that the flat Structure of the sequence was introduced, there was enough of these bizarre scenarios with scripts (which was an internal feature NOR at the time), it was easier on the developer to make his own script class to try to find a way to support it under an existing class. We had no idea that script would become a public service someday, so the burden was relatively low and limited within the walls of NOR. Looking back, there have been enough problems with the FlatSequence class in the script than most of us agree that it would be better to have it in class Node (or more precisely, the class MultiFrameStructure) from the beginning.

Tags: NI Software

Similar Questions

  • Delay the time of flat sequence Structure?

    How to delay the moment of execution for flat sequence Structure?

    Your question is a little vague.

    You want to delay in a certain amount of time? Until something happens?

    You can add a primitive frame with a wait.

    It might be useful to you could reach a simplified example so that we can better see what you're doing.

  • Replace the flat sequence Structure?

    I read a bit in the forum and a lot of people discouraged to use the structures of the sequence. Here's the situation: I have a tick count at the beginning for the iteration (and another at the end). I want to force them to count before (and after) anything else. The code I'm working on leash all data through structures flat sequences that contain only tick counts. Is there a different way that you can do without the structures of the sequence?

    Thans

    The recommendation not to use structures of sequence applies to most of the cases where people use.  State machines are the preferred (and best) method.  However, this does not mean that there is never a good use for a sequence structure.  In your case, when you both want something, it is perfectly acceptable.  An example is shown in the first snippet below.

    There is an alternative however.  You can use a timed loop to time your code.  Someone posted here once an example.  I forgot who he was and who puts in.  It went something like the snippet of the second.

    I would like to know why there is a difference in speed between these two methods:

  • Scripting - reference control Replace inside the flat sequence

    Hello

    Just in the process of upgrading our software from 8.6 to 2011. A question that we have is references appear to be different to the old code. Example - if we create a new control reference, put it next to the old one, put a probe on the two, references do not match when we run the vi.

    This causes havoc with our very large amounts of code. We contacted OR that our support subscription and they required an example which we can really give.

    In any case...

    I thought that I would write a vi script to replace all old references of our code with new references.

    Problem is that I can't replace a control easily reference which is inside any kind of structure.

    I need a way to get a reference to a parent structure, I can then add to the structure.

    This will take place on large amounts of complex code, so there need to be versatile. Please see the attached Vi

    Thank you

    Joe

    I would like to make the following changes:

    • You'll want to use the 'Move' method, which allows you to specify an owner.  In this case, the owner is the schema that belongs to the original control reference.

    • You want to get the original order wire and get all its wells (i.e. not null index into the array of terminals), so that you know what to wire the new benchmark in control of.  That is why the Connect wire method is in a loop For... the original control reference may have wired to several objects.

    Let me know if you have any other questions.  As far as I know, all properties/methods that I am using the code above are available in LabVIEW 8.6.

  • How to create flat sequence structure and add Subvi with true or false on an another flat following?

    How can I create next. flat and add a colum with VI and true Sub VI falseSub?

    What should be the flowchart:

  • CONNECT OF PREREQUISITE for the flat table structure?

    I am familiar with data such as the following and extract a hierarchy using CONNECT BY PRIOR:

    For example:

    with tbl_data AS
    (
    SELECT 'PZPZZZZ' code, 'LEVEL1' code_level, 'Kingdom' code_label, NULL      parent_code FROM DUAL UNION ALL
    SELECT 'PZ2ZZ2Z' code, 'LEVEL2' code_level, 'Phylum ' code_label, 'PZPZZZZ' parent_code FROM DUAL UNION ALL
    SELECT 'PZ3ZPZZ' code, 'LEVEL3' code_level, 'Class '  code_label, 'PZ2ZZ2Z' parent_code FROM DUAL UNION ALL
    SELECT 'PZ433PZ' code, 'LEVEL4' code_level, 'Order '  code_label, 'PZ3ZPZZ' parent_code FROM DUAL UNION ALL
    SELECT 'PZ5535Z' code, 'LEVEL5' code_level, 'Family ' code_label, 'PZ433PZ' parent_code FROM DUAL UNION ALL
    SELECT 'AAZZZZ2' code, 'LEVEL6' code_level, 'Genus '  code_label, 'PZ5535Z' parent_code FROM DUAL
    )
    SELECT     LPAD(' ', (LEVEL - 1) * 10, ' ') || code
             , LEVEL
             , parent_code
             , code_label
          FROM tbl_data
    START WITH code = 'PZPZZZZ'
    CONNECT BY PRIOR code = parent_code;
    

    That generates data like this:

    HIER                                                        LEVEL   PARENT_CODE CODE_LABEL
    ----------------------------------------------------------- ------- ----------- ---------------
    PZPZZZZ                                                     1                   Kingdom
              PZ2ZZ2Z                                           2       PZPZZZZ     Phylum 
                        PZ3ZPZZ                                 3       PZ2ZZ2Z     Class 
                                  PZ433PZ                       4       PZ3ZPZZ     Order
                                            PZ5535Z             5       PZ433PZ     Family 
                                                      AAZZZZ2   6       PZ5535Z     Genus 
    

    We have some data stored in a table with this structure, finance so that instead of data as in the example above, the hierarchy is stored in a single line - for example

    with tbl_data AS
    (
    SELECT 'PZPZZZZ' level1, 'Kingdom' level1_desc,  'PZ2ZZ2Z' level2, 'Phylum' level2_desc, 'PZ3ZPZZ' level3, 'Class' level3_desc, 'PZ433PZ' level4, 'Order' level4_desc, 'PZ5535Z' level5, 'Family' level5_desc, 'AAZZZZ2' level6, 'Genus' level6_desc FROM DUAL 
    )
    SELECT level1
         , level1_desc
         , level2
         , level2_desc
         , level3
         , level3_desc
         , level4
         , level4_desc
         , level5
         , level5_desc
         , level6
         , level6_desc
      from tbl_data;
    

    Data:

    LEVEL1  LEVEL1_DESC LEVEL2  LEVEL2_DESC LEVEL3  LEVEL3_DESC LEVEL4  LEVEL4_DESC  LEVEL5  LEVEL5_DESC LEVEL6  LEVEL6_DESC
    ------- ----------- ------- ----------- ------- ----------- ------- -----------  ------- ----------- ------- -----------
    PZPZZZZ Kingdom     PZ2ZZ2Z Phylum      PZ3ZPZZ Class       PZ433PZ Order        PZ5535Z Family      AAZZZZ2 Genus      
    

    Given that the data is in this format, it is possible to generate a query of the hierarchy, assuming level5 is the parent of level6, level4 is the parent of level5 and so forth, to generate the same output as the example above?

    Is not a work at home on the interview question - just something I try to appear at work, for my own interest.

    Any advice would be much appreciated.

    Thank you

    with tbl_data AS

    (

    SELECT level1 "PZPZZZZ", "Realm" level1_desc, "PZ2ZZ2Z" level2 "Phylum" level2_desc, level3 'PZ3ZPZZ', 'Class' level3_desc, level4 'PZ433PZ', 'Order' level4_desc, level5 'PZ5535Z', 'Family' level5_desc, 'AAZZZZ2' level6, 'Like' level6_desc FROM DUAL

    )

    Select decode (x

    , 1, level 1

    , 2, lpad (' ', 10). Level2

    , 3, lpad (' ', 20). Level3

    , 4, lpad (' ', 30). Level4

    , 5, lpad (' ', 40). Level5

    , 6, lpad (' ', 50) | Level6

    ) yesterday

    x

    decode (x

    , 2, level 1

    , 3, level 2

    , 4, level3

    , 5, level4

    , 6, level5

    ) parent_code

    decode (x

    , 1, level1_desc

    , 2, level2_desc

    , 3, level3_desc

    , 4, level4_desc

    , 5, level5_desc

    , 6, level6_desc

    ) yesterday

    of tbl_data

    (select level x from dual connect by level<= 6="">

  • structure of flat sequence for benchmarking

    Hello

    Maybe this is very obvious, but I don't completely understand something with the sequence flat structures-FSS (I never use this structure by the way and I don't you not why they use it in this example).

    There's a doc OR online explaining some mistakes of rookie in LV:

    http://www.NI.com/newsletter/51735/en/

    The doc has described that the FSS is useful for benchmarking, the BD:

    My question: what if we put the number of cycles in a Subvi left and right and giving the exec. order with wires of the error? Or using a while loop that runs only once (with sons of error through)?

    These 3 different ways are the same?

    Yes, you can do all these things - I think that the only thing to keep in mind is that you do not want your benchmarking code to affect the speed of the code - otherwise, you'll get inaccurate results. If you use the while loop, you will need to do something to make sure your second number of cycles will run after your time loop - for example with FSS

    Flat sequence structure using is OK - it's overuse of it which is a common rookie mistake - trying to force things to run in a specific order (for example if from a text based on the sequential programming language) instead of understanding that this is done by data flow in LabVIEW.

    I think that the reason is simply because the number of cycles VI doesn't have an entry so you cannot apply data flow. It is common to have a Subvi, which encapsulates the number of cycles VI with error/output wire.

  • Sequence structure flat inside the timed loop and execution order

    I have some problems trying to implement a flat sequence structure when you use a loop timed on a target of cRio VI

    I tried with or without the while loop around the structure of sequence flat, and I also tried to replace the 'Non-deterministic loop' with a timed loop

    The problem is that the program seems to run only once, then get stuck somewhere

    I am writing a program that performs the following operations as soon as possible:
    1. read the Pos_MC of entry on the FPGA
    2 send the value of Pos_MC to the VI target (on cRio CPU)
    3. calculate a value of output based on Pos_MC with a PID block ("exit PID')
    4. send 'PID output' to the FPGA
    5 write "PID output" analog output "MOOG".

    In addition, I want the program to return the measured value "Pos_MC" to a host VI for the recording of data

    So that the output of PID is calculated and sent to the FPGA as quickly as possible, I placed a flat sequence structure to ensure that it happens before you send the output to the nondeterministic loop for recording data

    Also, I want the digital input 'Stop' to be able to stop the loop deterministic (the timed loop)

    I read much more entries than that and the help of several PID and exit, but I rewrote the code for a single entry and exit to make it easier to illustrate

    Screenshot of the code is shown in 'target code.png' and 'fpga code.png.

    The VI themselves are attached in the next post (cannot attach files of more than 3)

    Question 1:
    Any advice on how to get this race? Thank you!

    Question 2:
    Is also my correct understanding in that, using this structure, each 0.9ms (fpga loop time) comes the following:
    1. the input ("Pos_MOOG") is read on the fpga
    2. the production of PID is calculated on the cRio with some delay to computation (for example 0.1ms)
    3. the output of PID is then written for analog output "MOOG" in all about 0, 1 - 0.2ms
    4. the FPGA program then waits until 0.9ms spent and repeat the process

    As opposed to the next pass whenever performing a loop is started on the FPGA:

    1. the FPGA reads the input and written on the output (the output of the execution of the previous loop PID)

    2. then the entry is sent the cRio, PID output is calculated and sent to the FPGA

    3. the new release of PID is maintained until the next time through the loop

    Thank you!

    PHG wrote:

    Thanks for the input guys, any advice as to how I could get the feature in scenario 1?

    I still say that the best route is just putting all the logic of the control in the FPGA.

    Other alternatives include 1) the use of DMA FIFO sedn data back or 2) use interruptions so that the FPGA code can not read the output level until the RT.

    DMA FIFOs are usually very limited, and I would not use them in this situation since I belive said it this code to do for the many outputs.

  • In the case of flat sequence LED

    Hello

    I have 2 flat sequence event with 1 LED in each event. How can I turn on the LED when the start of the event and the OFF when the event ended before he will move to the next event.

    Help, please.

    Thank you

    Those who are not in the sequence of events. These are individual images. Events in LabVIEW are something completely different. Based on your question it seems that you are not completely understand dataflow. A function/VI will run when all data on the cables connected to it is present. Stream can be used to enforce the execution order, but executives of sequence can also be used.

    In your first picture if you wire a real constant for the Boolean value, you can control when the Boolean value is updated because there is no dependenct data between the numerical calculations and writing of the LED. So, if you want to turn on the front LED the first image, then you must add a frame before the first person where you set the indicator and the same thing at the end.

  • The speed of the flat sequence?

    Hello

    What I want to do: read a map OR 6 analog voltages and provide a few analog/digital outputs from another card of NEITHER.

    Here's what I do: I use the DAQ assistant to acquire 6 different analogue voltages on a simulated map of NI 9205. I tried to run at the same time all 6 data acquisition assistant acquires (which did not), but I read that since there is only a single clock on the map, so I can not use multiple acquires at the same time because of timing issues (right?). Then, I put my DAQ assistants in their own images in a flat sequence then they would be operated sequentially. This works fine, but each frame/acquire takes 1 second to complete. Which means that my program lasts 6 seconds to do everything acquires it, before my other code outside the plate sequence. Outside platform sequence are my trips (some digital and analog a bit on a slider). Because my flat sequence lasts 6 seconds to compete, my outputs are updated only once every the 6 seconds, where as before the flat sequence has been inserted that they have been updated little almost instantly.

    Here are the questions: can I do the flat sequence run faster? Or is there a way to simultaneously acquire several analog voltage using the DAQ assistant. I feel that I shouldn't need to the apartment of sequences, but do not know a better way to go about it.

    I hope that makes sense and I'm pretty new to labview so feel free to add many details.

    Thank you!

    PS: If you try my Vi, notice how slowly the 3 top entries in the page update, if I remove the huge flat sequence, they run very quickly and smoothly, which is what I would like.

    e g m e n i wrote:

    Here's what I do: I use the DAQ assistant to acquire 6 different analogue voltages on a simulated map of NI 9205. I tried to run at the same time all 6 data acquisition assistant acquires (which did not), but I read that since there is only a single clock on the map, so I can not use multiple acquires at the same time because of timing issues (right?).

    Instead of trying to run 6 assistants for the acquisition of data in parallel (or sequential), use one assistant DAQ who reads all channels simultaneously.

  • How to stop a flat sequence (or timed sequence) which is inside a loop for

    The problem is this, I have a loop that repeats 10 times and inside this loop, I have a flat sequence (or timed sequence) with four images, each of this chassis to evaluate a different condition of a vector that I introduce.

    What I woud like for example is:

    I'm a fifth County of the loop for and in the case that part 2 does not meet the condition, the sequence of dish (or timed sequence) stops and starts the loop again but this time for the number of number 6.

    I would appreciate your response.

    You can't stop a sequence structure.  This is how they are made.

    What you should consider to get rid fo structures sequence and to change a state machine architecture.  There are many examples in LabVIEW, as well as on the Forums.  The big advantage of the state machine is that at the end of each State, it examines the conditions and determines which State then run. And that is exactly the description of the problem you are experiencing.

    Lynn

  • Front Panel does not (exactly 2 even while in flat sequence loop)? LabVIEW BUG?

    Hello world

    I have two while loop with exactly the same code and a user in each loop event structure,

    They both make the same thing which is too run until IMAQ image control (one line) click on a recording.

    I used a flat sequence to manage the order of execution.

    The problem is when I use only one single loop (put another in a diagram to disable) the façade answer perfectly and the program does what it should, but when I activate the two loops stuck in case of timeout...

    I do not understand what is happening that I can't do any activity of façade that would be registered, enclosed is a copy of the VI (you need NIVision run the vi).

    Any idea? Is this a bug or did I do something wrong?

    Thank you very much

    Best regards

    This isn't a bug, but the expected behavior. You cannot sequence structures event like this, they both need to be ready to react. Use a single event structure and a state machine architecture. You have about 4 copies of basically the same code of event management. Try to combine everything in one!

    What happens in your case?

    Answer: The two structures event will begin immediately queues of events, but the second event structure cannot respond to them because it is inaccessible due to data flow. In addition, the second structure of the event is set to "lock the front panel until the end of the event. Given that the event cannot end as explained above, the façade is locked up forever.

  • Why a while loop does not start in a flat sequence if I have another loop running in a different sequence of flat?

    Hi all

    Basically, I'm in the order of many device and regulation for that pourpose, I created a sequence of plate to do. Also, at times I have start the potentiostat measures I use too, which follows a sequence and I created a second flat sequence to do this. In a part of my experience, I want to follow the voltage and current of high voltage power supply that is located in the flat main sequence and also read the results I'm getting with the potentiostat simultaneously.

    In the main sequence, there is a constant bollean which triggers the beginning of the secondary sequence. In the framework after it contant Boolean, I have a while loop in which I read 2 analog inputs of the power supply high voltage with my USB-6218 for awhile every 100 m, my problem is that the Boolean constant actually starts the subsequence flat but when it reaches a while loop in which I continue to read the results of the potentiostat , for a reason that the operation does not start until the while loop in the main loop is not finished.

    I communicate with the software of the potentiostat through a driver made by the manufacturer.

    Is it possible to read analog inputs with USB DAQ and simultaneously read the results of the potentiostat?

    Thank you very much

    Without being able to see the code, can only speculate. My guess is that you have probably some data flow to the second loop that depends on the first loop finish.

  • bike of a sequence structure

    Hello community,

    I posted there is a thermo-cycler program that was very tedious code wise and I restarted my encoding using sequence structures and local variables.  So far, I am satisfied with the results, except that I'm having a hard time a looping structure flat sequence properly.  Joined the vi that I practice, as you can see I'm allowing the user to select the number of times the second sequence is repeated.  The problem is that a single loop in the structure of the nested sequence repeat and not the two nested while loops.  It could all shoot me some advice or help I would be very happy.

    Thank you

    Daniel

    Daniel,

    Please try again.  Sequence structures and local variables cause a lot more problems that they solve, especially for beginners of programmers.

    Look at the architecture of State machine.  Grassroots level, it consists of a while loop containing a structure case and registers at offset.  With a state machine you can easily do what you try to do it without the need for local variables or the works of the sequence.  State machines are more scalable and more robust in the presence of errors or dynamic changes to the State of the system and easier to maintain than the way you are now trying to do things.

    Browse the LabVIEW tutorials to help you get started.

    Lynn

  • How to get out of a sequence structure

    Is there a way to get out of the structure of sequence?

    Lol that is one of the reasons why the sequence structures are often wrong. Much better to rewrite the code to be a state machine.

Maybe you are looking for

  • LabVIEW data Plugin SDK

    Is - this Labview Data Plugin SDKis always running on LV2009? I installed it but have no idea how to do to work with. I can not even find the mentioned help file LV_DataPlugin_SDK.pdf after installation. I wanted to use it to write a Plugin to G data

  • Windows Live Essentials 2012

    What are the system requirements for Windows Live Essentials 2012? Is it compatible with Windows XP SP3?

  • PROBLEM WITH XP MOVIE MAKER2 can't get work anymore

    Please see the error message constant of Movie Maker above - asking what I want to send the report, don't have followed to the letter the instructions of update of Microsoft/Repair etc. still no goodPROBLEM XP MovieMaker 2 version, since updated to S

  • Toolbar start button disappeared!

    I was right click on the mouse on the screen and nothing appears.  How to get the Start button tool and lower back of bar.  The computer has not been answered and asked if I wanted to shut something down, I did and I think that is now the root of my

  • Error loading specified c:\PROGRA~2\viwadefo\viwadefo.dll__The is not found module

    After McAfee has detected a virus I did a virus scan and got rid of the virus. I restarted my computer, and this error message came. How can I get rid of him? Thanks for the help!