Get in a LV tree ctrl a sequence structure

Hi, I am doing an editor for customizing some sequence parameters (for example "run mode). I'd like to import into a LV tree control all the test sequence maintaining the same structure of the original one. I mean, each step is an item of the tree (Test A, Test C..), while each subsequence call is a node of the tree (Test B, Test B_3), the parent of some children. Using TS API, I can go thru the Main sequence and all the subsequence but I cannot find the link between the subsequence and its call. I can find that Test B is a sequence call but not what subsequence is calling.
If help, I can post part of the code.
Thanks a lot.
Solved!
Go to Solution.
Attachments:
2.jpg ‏9 KB

logatto,
In order to get the information about the sequence call step that you want, you'll need to use the TestStand Adapter API.  You should get the Step.Module object from the sequence call step, and then cast it to a SequenceCallModule object.  You can then get the properties you want. 
You can see how the TestStand classes fit together here:  http://zone.ni.com/reference/en-XX/help/370052H-01/tsapiref/infotopics/using_teststand_api_objects/
There are also several helpful KBs out there, if you search for some combination of TestStand/LabVIEW/Adapter API/Module/etc.  Here's one I found: http://digital.ni.com/public.nsf/allkb/ADC6909C20E27D4886256E94005424E3
Hope this helps!
P.S. To 'cast' in LabVIEW, use the "Variant To Data" node.  Be sure to close all references!
Josh W.
Certified TestStand Architect
Formerly blue

Similar Messages

  • How to get each node in tree?

    how to get each node in tree?
    Message was edited by:
    NikisinProblem

    how to get each node in tree?
    Since (as far as I know) treeNode is an interface, the real question to me is how are you implementing your treeNodes? Are you overriding the toString() method?

  • How should I set up my VI so that I can use the linear fit coefficient data analysis program, when my values are coming from while loops within a sequence structure?

    I'm attempting to create a calibration program, using the printer port, and a Vernier Serial Box by modifying a calibration program designed for the serial box.
    There are six calibration points, and to collect them, I have it controlled by while loops so that the numbers are taken when a button is pushed, and this is inside a sequence structure so that I can get the six different points. I feed these numbers into two different arrays (for x and y values) and then try to use the linear coefficient analysis on these points, but the values for the slope and intercepts it returns are not correc
    t.
    If I cut out the array and coefficient analysis, and feed the same numbers in directly without the while loop and sequence structures, it produces the proper values... I don't know why the numbers it is producing are different, and I'd really like to know.
    Thanks,
    Karinne.

    I would use a data manager sub-vi that would be called by each from of the sequence structure that produced a data point. The data manager sub-vi could auto append new items or could place items in a specific entry of an array. Later on when you want to calculate the linear fit, call the sub-vi to return the array of values.
    Stu

  • Show two trees with same context structure

    Hi,
    I'm having problems showing two trees using the same context structure but different data simultaneously.
    Here is my context structure:
    tree (value node)
    - expanded (boolean)
    - label (string)
    - leaf (boolean)
    - recursion (recursion node with ref on tree)
    I fill the first two layers of this tree in wdDoInit, the rest is loaded dynamically triggered by the onLoadChildren event.
    This setting works fine for one tree. But I have the requirement to set up a second tree using the context structure of the first tree with different data. The problem is both should be shown simultaneously.
    What I expected to work is:
    1. to wrap the above mentioned structure into a container
    2. make the tree a prototype (singleton=false) and
    3. instantiate two tree nodes
    4. fill both nodes with data
    5. bind each with its corresponding ui elements manually
    So the "shared" context structure would be:
    treeContainer (value node)
    - tree (value node, singleton=false)
    -- expanded (boolean)
    -- label (string)
    -- leaf (boolean)
    -- recursion (recursion node with ref on tree)
    My data mapping code begins with these lines
    ITreeContainerElement treeContainerElement =
    treeContainerNode.createTreeContainerElement();
    treeContainerNode.addElement(treeContainerElement);
    ITreeNode treeFactory = wdContext.nodeTree();
    which is then called one time for each tree. What happens is that both trees show the aggregated data, so each tree shows the data for both trees. When I use the factory of the element instead
    ITreeContainerElement treeContainerElement =
    treeContainerNode.createTreeContainerElement();
    treeContainerNode.addElement(treeContainerElement);
    ITreeNode treeFactory = treeContainerElement.nodeTree();
    both trees show the data for the first tree.
    I am aware that when I copy the context tree to a different location and rename every value node, e.h. tree2, recursion2 that this will work. But the problem is that the two trees will interact together, e.g. copy branches, and I want to use the typed API since the tree will get quite complex and they have absolutely the same structure.
    I guess I'm getting sth. terribly wrong here with my understanding of the context, so any help is appreciated.
    Best regards,
    Fabian

    Hi,
    It seems to be that my understanding of the context was terribly wrong. After I traced the behaviour in the debugger I realized that I made one important fault. The datasource of the UI elements should have been bound to the first and second instance of the recursion node container. Therefore the parent node should not be singleton since I access two instances simultaneously.
    However, I now separated both trees in the context for the sake of maintainability. I work now with the generic API In order to reuse the functionality.
    To determine the correct container I introduced the convention that the tree value node should only contain the recursion node. Then I use the following code to determine the right container:
         private IWDNode getContainer(IWDNodeElement parentElement) {
              IWDNode parentContainer = parentElement.node();
              IWDNodeInfo parentContainerInfo = parentContainer.getNodeInfo();
              boolean isRecursive = parentContainerInfo.isRecursive();
              String childName = null;
              if (isRecursive)
                   childName = parentContainerInfo.getName();
              else {
                   IWDNodeInfo recursiveNodeInfo =
                        (IWDNodeInfo) parentContainer
                             .getNodeInfo()
                             .iterateChildren()
                             .next();
                   childName = recursiveNodeInfo.getName();
              return parentContainer.getChildNode(childName, parentElement.index());
    I'm sorry if my question was somehow imprecise and lead into the wrong direction. With the code now working I reckon the question as answered and give you both points for good answers!
    Best regards,
    Fabian

  • Elapse vi in sequence structure

    Hi Guys
    I know there a thousand way to implement a time elapse funciton, but i am curious the reason it does not work
    I set first elapse vi tartget time 5 seconds, second 2 seconds and third 3 seconds in a for loop
    It works in first and second iteraion. after a few iteration, the second and third elapse vi do not count time any more( I seems that the elapsed time is overwritten by first one. If you probe the three time elapsed output, it  is always 5. 
    Attachments:
    sequence timer.vi ‏104 KB

    Well, if there are a thousand ways to do it, there are probably about 995 better ways to do it. 
    That being said, I believe you have to put a condition for each elapsed time that resets the timer on the first iteration of the while loop.  And get rid of the elapsed times with nothing happenning.  And learn how to use dataflow instead of sequence structures.
    One FYI, too.  Leave everything at the defaults except for the stuff you are changing - i.e., the reset and the time target.  BIG HINT: i can = 0 only once.
    Dataflow basics here.
    Another BIG HINT:
    Error in and Error out are inputs and outputs that could be used to enforce dataflow.
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Control references and sequence structures

    My supervisor and I were discussing one of his programs, and he asked
    me if I knew why he kept getting "Object reference is invalid" on a
    property node that was using a reference.  I couldn't figure it
    out either, and eventually I said to try moving the actual control
    itself (on the block diagram), into the first pane of the sequence
    structure, and just feed the wire through.
    This solved all of our problems...  however both of us were
    stumped with why what I suggested actually made it work.  Anyone
    know why this is?
    Oops...  I just realized that I made this on the breakpoint board
    instead of the LabVIEW board...sorry.  Although I suppose that the
    people who frequent this might be the best to answer this...
    Message Edited by Novatron on 07-14-2005 05:24 PM

    There should be no difference between the two code versions IF you adhere to proper dataflow.
    (Of course it is conceivable that the program is a mess and there is a race condition, e.g. if the reference is initially invalid and you set it elsewhere in the code via e.g. a local variable of the reference. In this case, a subtle change (e.g. the sequence structure) can rearrange the execution order for it to suddenly work by accident.)
    I would be very curious to see a working example that demonstrates your described behavior.
    LabVIEW Champion . Do more with less code and in less time .

  • Question about stacked sequence structure

    Hi,
    I made a numeric control outside a stacked sequence structure, and connect the control both to frame 1 and frame 2. In frame 2 there is a while loop structure. And now I start the labview program with the control A. Then, after frame 1 finished, frame 2 started, now I want to change the control to B and deliver B into frame 2. But the indicator in frame 2 shows that the control is still A. So I wonder how can I change the control and deliver it to the frame after the frame has started? Thank you!
    NI Software :  LabVIEW  version 7.1
    OS :  Windows XP
    Regards,
    jackauden

    Dataflow dictates what you are seeing. The control does not get read once the sequence starts. This is as expected.
    Some possible solutions:
    Just don't use stacked sequence! I don't and never feel limited by this choice.
    Create local variable of the control and read from it inside frame 2.
    Do you REALLY need a stacked sequence? Why???
    LabVIEW Champion . Do more with less code and in less time .

  • Making sequence structures a state machine

    Hey I would like some help I need to work on changing my code and get rid of the flat sequence structure and replace with a state machine I have attached my code at an earlier state but would like some input on changing it over to a state machine in the sequence at the bottom of the code this program is used to cycle a valve and the sequences need to be done in order .any input would be great.
    Attachments:
    valve Cycles with temp.vi ‏132 KB

    Right click on the Flat Sequence and pick Replace with Stacked Sequence  (never would have thought I'd say that.)
    Right click on the Stacked Sequence and Replace with Case Structure.
    Now a lot of wires will wind up broken.  So you'll need to hunt them down and fix them.  Those wires will probably need to go to shift registers so there values are maintained for the next loop iteration.  Keep a copy of your original VI so you have something to refer back to.
    Create a Typedef Enum and define what your states will be.
    Start wiring the Enum into a shift register at the left of the loop, then into the selector of the Case Structure.  Rename all the cases to what their respective state should be.
    Wire enum constants in each case to direct what the next case should be.  It will run out of the case structure to the right hand shift register.
    Keep working and cleaning still everything is fixed.
    Try running your VI to see if it behaves like it originally did.
    Now you are safe to start making modifications to make it behave like you really want it to.

  • Question about the sequence structure

    Hi,
    If we want to get best performance when programming a sequence of functions or calculations, we should choose 'Stacked sequence structure' or 'Flat sequence structure'? or they have the same performance?
    Thanks.

    To the best of my knowlege there is no performance hit, the "Flat sequence structure" was a fairly recent addition to try and overcome one (of many) complaints about sequence structures in general, that stacked sequences obscure what is happening in the code. If the various sections of your calculation or functions have data dependency, i.e. the output of a calculation is fed into the subsequent calculation or function, then a sequence structure is probably not needed as, with data flow, the calculation that is "dependent" won't executed until all its inputs requirements are satified. If the "functions" are in the form of sub-vi's the method that is more "proper" is to inforce a dependency between subsequent vi's. This can be as simple as adding error in and out controls to the sub-vi's, even if they are only passed through the vi without actually performing an error function. This allows you to wire them together in the execution order that is required. Doing this on some of the early "built-in" functions that have remained in LabVIEW (the original timer functions) sometime requires putting a wrapper around them to make them sub-vi's with error passing, but in the latest versions of LabVIEW the compiler seems to do a good job of minimizing any performance hits this might appear to cause.
    Putnam Monroe
    LabVIEW Evangelist since 1992
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Feature Film Editing in Premiere CC - Sequence Structure

    I am looking to set up my sequence structure so that each scene has it's own sequence and then next each scene into a Master Sequence.  My question is this:
    Is there a way for Premiere to update the Master Sequence if the length of the Scene Sequence changes.  As of now, I am not having much luck.
    I know there will be small tweaks to the scene once I get feedback (Delete a line of dialogue, etc.) and would hope I wouldn't have to touch the Master Sequence for the continues outputs until the picture is locked.
    And while we are at it, can some of you suggest how you set up your sequence structure for narrative features.  Perhaps I am not approaching it in the best manner.

    Perhaps you are not understanding the role of an editor. It is our job to create the sequence of material that tells a story. (Please excuse my snarky attitude)
    As a scene lengthens or shortens, simply ripple edit the in or out points as necessary. The best method is the checker or a variation to the checker method; I often assign scenes with similar characteristics to a particular track, for example, all scenes that take place in the garden will live on track 3, all the kitchen scenes live on track 4. Or for story line 'A' you can designate tracks 1-3, then you can put the supportive / alternate story 'B' on tracks 4-6 also using the checker method.  Again, excuse my attitude: don't be lazy.

  • Incrementing sequence structures

    I am sure there is an easy way to do this, but I can't quite get it to work properly. Any help would be appreciated:
    I have a while loop that runs for 40 seconds. When those 40 seconds are up, it triggers a dialog box to pop up. That dialog box is in a sequence loop that contains 30 different frames. Each frame has a different dialog box message. This entire portion is surrounded by a for loop.
    What I am trying to do is have:
    1. the while loop run for 40 seconds
    2. the first frame of the sequence with dialog box #1 to pop up
    3. the original while loop to run again for another 40 seconds
    4. the second frame of the sequence with dialog box #2 to pop up
    5. the original while loop to run again for ano
    ther 40 seconds
    6. the third frame of the sequence with dialog box #3 to pop up
    and so on....
    I have a for loop around the entire thing so that it can repeat the same while loop structure multiple times. I have a 30 wired into the N input of the for loop so that it will run the entire portion 30 times (corresponding to the 30 different dialog box messages that have to pop up).
    How can I get one and only one frame of the sequence structure to pop up after the while loop finishes its 40 second period of running?
    I would gladly email you this portion of the code for you to take a look at if it will help. Just let me know where to send it.
    Thanks.

    This does seem to be a good application for a case statement. If you do
    need to keep the sequence format for some reason, could you put the while
    loop in vi that you can drop into each of the sequence frames?
    Dan.
    "Koen" wrote in message
    news:[email protected]..
    > It seems to me that it would be much easier to use a case instead of a
    > sequence and wire the increment (i) of the while loop to the selector
    > of the case. In this way loop 0 will execute case 0 ,1 executes 1 and
    > so on each after the 40 sec wait.
    > Is there any particular reason for using the sequence?

  • Plotting data from sequence structures.

    Hi all,
    I have a program that contains two pages in a sequence structure. On each page, I am generating data and I would like to plot this data in real-time on an XY graph. I understand that once I've executed Page 0 in the sequence structure, I cannot go back to this page. As such, once this page has finished executed I would need to pass the data to the next page. However, I would like to plot both datasets on *one* XY graph. Is this possible? I've tried putting the graph outside the sequence structure, but the data is not allowed to pass to graph until the page is executed (so it is not real-time plotting). I've included the VI I've been working on.
    Attachments:
    appendgraphs.vi ‏30 KB

    Hi,
    if you really want to use sequence, you can use a local variable of the graph to add points on the second frame, see modified.vi.
    Anyway you can get the same functionality without sequence, see optimized.vi.
    Good luck,
    Alberto
    Attachments:
    modified.vi ‏33 KB
    optimized.vi ‏27 KB

  • Sequence structure and Latch action

    Dear Sir or Madam,
    I have a sequence with commands in each frame. Is there a way to have a
    LATCH ACTION, between frames??.
    Thanks in advance for your any help.
    Sincerely,
    Luis Diaz
    [email protected]

    I would recomend that you get rid of the sequence structures and use a state
    machine. A State machine will give you a much more powerful and flexible
    program. Browse the example programs available at the Resource Library of
    NI's Developer Zone zone.ni.com). There is even an example called Pause/Resume
    & State Machine.
    "Kevin B. Kent" wrote:
    >Luis Diaz wrote>> Dear Sir or Madam,>>>> I have a sequence with commands
    in each frame. Is there a way to have a>> LATCH ACTION, between frames??.>>>>
    Thanks in advance for your any help.>>>> Sincerely,>>>> Luis Diaz>> [email protected]>>Not
    quite sure what you mean here.>You can pause between each frame, there are
    2 ways to do this.>Add a frame AFTER the frame to pau
    se>1) put in a timer
    (Wait MS) you can hardcode this wait or have>a value that the user can enter.>2)
    put in a while loop and have a button to proceed, or use some sort of>logic.>>All
    this will do is send the commands and then wait for the timer to expire>or
    the loop to end.>>A more elegant approach is to use a state machine. This
    is a combination of>a case structure inside of a while loop. You have much
    more control over the>>sequence of events and it is much easier to read and
    debug.>>Again all this will do is wait between cases (if setup that way)>>Using
    the state machine you can have a case return to itself which>is esentially
    a LATCH.>>There are samples of the state machine at various locations.>>Let
    me know if you need more help> Kevin Kent>

  • Help with cycling sequence structure, I may need a state machine?

    Hi All,
    So I have this VI that needs to control two solenoid valves by opening and closing them through the digital outputs.
    I want the program to have a function like this
    Phase 1: Valve 1 open, Valve 2 closed (Amount of time for this defined by user)
    Phase 2: Both valves closed (for .1 seconds)
    Phase 3: Valve 1 closed, Valve 2 open (Again, this amount of time is defined by user)
    and I want it to cycle through phase 1-3 100,000 times. However, every 10,000 cycles of phase 1-3 I want it to change the condition on Phase 2 so that both valves are closed for an hour instead of .1 seconds, then after this hour loop I want it to return back to the original cycling conditions (.1 sec instead of 1 hour) until it does another 10,000 cycles.
    I was thinking that a sequence loop would be fine because I would wire it up with timing and a counter, and every time it goes to the last sequence it would increase the counter so that when its at the phase 2 timing I can use a case structure (if counter > 10,000 hold 1 hour, if counter <10,000 hold .1 sec) and then in the last sequence reset the counter to 1 if it is >10,000.
    I thought a sequence structure would be good for this but I'm fairly new to labview and if theres a better way to do this I'm open to suggestions .
    Attached is my code so far, except that I have not finished wiring the ports for valve B
    Attachments:
    Adhesive Pressure Cycling.vi ‏100 KB

    First, you should avoid the use of a sequence structure. Don't even consider it to be an option. At least not at this stage of your learning. Learn how to use data flow. Also, avoid the use of local/global variables. They tend to lead to race conditions which in turn result in some difficult bugs to find and fix. Think of the wires as your variables.
    As for the time delay in your state machine, your actual state should delay for a short time like 100 ms. Use the current time of day to determine when you have reached your desired timeout. If you use a single delay of an hour your program will be unresponsive for that hour. Users tend to get very annoyed if they try to stop the program and they have to wait a long time for it to actually stop.
    Here is a basic example that shows the concept in a state machine.
    When naming states for your state machine give them a meanigful name. Use a typedefed ENUM for your state variable. For simplicity sake the example attached does not use a typedef. But naming things like State 1, State 2 and so on makes the code difficult to read and understand. Your Open/Close valves states can be written in such a way that they are generic and take the valve data as input. At a minimum I would create a subVI to do this so you only have one piece of code to manage. You could have explcit states though such as Open Valve A and Open Valve B that call your generic Open Vavle subVI with the appropriate input data.
    One last comment, the express VIs tend to be very inefficient. They are OK for learning how things are done but I would implement their functionality directly. For example, the express VIs tend to open, initialize, do something, close the instrument. You really don't have to do all of that every time. Open and Initialize once in the begining (hint, this could be a state), put the stuff that does the work in appropriate states/subVIs (other states) and then close at the end of your application (the exit state for example).
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot
    Attachments:
    Simple Delay in State Machine.vi ‏15 KB

  • Can you move back to a previous frame in a sequence structure?

    I have a VI that contains a sequence structure with seven frames. I would like to add a button on the front panel to allow the user to move back to the previous frame. Is this possible?
    Thanks

    I don't think that's possible. Try replacing the sequence structure with a
    state machine.
    A state machine is a case statement embedded in a while loop. Each case
    outputs at least an integer to indicate the next case to be executed and a
    boolean to indicate if the while loop should continue. The integer is wired
    to a shift register. The input side of the shift register is wired inside
    the while loop to the conditional terminal of the case statement. Outside
    of the while loop, the input side of the shift register would be wired to a
    constant indicating the first case to be executed.
    To mimic a sequence structure, each case would take the incoming integer and
    increment it by one. To move back to the previous frame, the integer would
    be decremented instead.
    "Jeff - PP
    L" wrote in message
    news:[email protected]..
    > I have a VI that contains a sequence structure with seven frames. I
    > would like to add a button on the front panel to allow the user to
    > move back to the previous frame. Is this possible?
    >
    > Thanks

Maybe you are looking for