Community Nugget 2-19-2007 "Stacked Sequence Exterminator"

I am sure everyone with even casual familiarity of LabVIEW has run across older (or newer) code that is just peppered with ...
Stacked Sequences from Hell.
Stacked sequences (especially the one's containing sequence locals) are the hallmarks of confusing, unreadable and unmaintainable code. Data flows in all directions (mostly right-to-left), a large percentage of code is hidden at any given time, and it is almost impossible to debug and follow what going on. Often there is clear data dependency (or execution order does not matter), so the sequence serves no purpose. Better programmers don't use stacked sequences at all and even keep flat sequences at a minimum.
Here is an example:
Since the code seems to work "sort of", and trying to rewire things manually will probably lead to accidental errors, we have no choice than to leave things in place...
... or do we???
If we try to right-click on the sequence, we can only remove individual frames, breaking everything in the process. No go! A dead end!  Sigh!
But let's not give up just now.... We can easily convert the stacked sequence to a flat sequence, so lets do that as a first step:
At this point, we can remove the flat sequence and all connections remain in place. Now we can just cleanup the elements and wires and everything look much better. Ahhh!!!
In summary:
An easy two-step procedure allows us to exterminate unnecessary stacked sequences without any danger of breaking the code. This method should lower the fear to remove these monstrosities. Try it today!
This is a Community Nugget. If you want to contribute, please sign up here: http://forums.ni.com/ni/board/message?board.id=BreakPoint&message.id=3379#M3379
Message Edited by altenbach on 02-18-2007 10:43 PM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
SeqToFlat.gif ‏15 KB
SeqStackedA.gif ‏10 KB
CannotRemove.gif ‏12 KB

Tomi,
Aren't you asking for a good reason to use a "bad" construct?
Your suggested code construct would look like this.
After wondering how to make it faster, you would concider this.
But the revised version is not possible with a stacked seq. With a State Diagram you have a lot more flexibility, and you have it now.
Now don't get me started because the next thing you know I will be talking about the SDE* and this thread is about exterminating Stacked Sequences..
Wait, I think I just did.
Ben
* With a State Diagram you have a lot more flexibility, and you have it now. If you use the SDE the graphic documentaiton comes along for the ride.
Message Edited by Ben on 02-19-2007 07:59 PM
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction
Attachments:
Stacked Seq.JPG ‏20 KB
Stacked Seq Rev1.JPG ‏23 KB

Similar Messages

  • Community Nugget 4/08/2007 Action Engines

    Action Engines, What are They?
    “An action engine is Ben's term for a functional global which includes extra actions other than just holding the data.”
     (tst , 03-13-2007 01:18 PM)
    In a nut shell tst has nailed it except for the “Ben’s term” part. I was originally exposed to the term "Action Engine"
    by reading the book ""LabVIEW Applications Development A Course on Advanced LabVIEW Programming Techniques*”.  But
    before I get into details of the Action Engine (AE), I will attempt to clarify some terminology.
    Functional Globals
    Functional Globals (FG) are VIs that are functionally equivalent to LabVIEW globals. Functional Globals store
    information. You can read them or write them and that is it. No fancy stuff. Functional Globals are also referred to as
    LV2 globals because LV2 did not have globals but it did support Un-initialized Shift Registers (USRs). The USR is the
    entity that stores the information.
    USR.jpg
    USR’s
    Shift Registers (SR) come in two varieties “Initialized” and “un-initialized”. The presence or absence of a wire
    feeding the SR from outside the loop distinguishes how LabVIEW will implement the SR. If there is NO wire feeding a
    shift register (A), then the SR is not initialized. This is called an “Un-Initialized Shift Register”. The USR variety
    is implemented as static buffer that is re-used from call to call. The values written to the USR in and earlier call
    persist for access (B) in latter calls**. A Functional Global exploits this behavior by implementing two methods of
    interacting with the contents of the USR.
    Functional Global.JPG
    In the “Write” action (not shown) the value of “Numeric in” is placed in the USR. In the “Read” action the contents of
    the USR are returned via Numeric out.
    Action Engines
    An Action Engine (AE) can be thought of as a machine (Engine) that performs some useful task (action) often on
    something (typically but not limited to data in a USR). Functional Globals are very specific type of Action Engine.
    They have two actions “Write” and “Read”. They operate on the data stored in the USR either by replacing or using the
    contents of the USR. So AE’s are a superset of Functional Globals. In many documents the terms AE and FG are
    interchangeable. A recent poll on LAVA has indicated that Functional Global is the most popular term. Since this Nugget
    was prompted by answering the question “what is an AE?” in the remainder of this document you will find that I will
    generally use the term AE.
    Do What to What?
    AE design revolves around the ways the shared resource must be accessed manipulated or monitored. In a Functional
    Global, the actions “Write” and “Read” are appropriate. That is not necessarily the case for AEs. AEs can have entirely
    different set of actions depending on the interaction requirements for the information stored in the USR. A short list
    follows.
     A Configuration AE could allow for multiple processes to share a single copy of the system configuration (in a USR) by
    providing actions like “Set Device ID”, Set Device ON-Line…
    A hardware device can be realized as an AE that presents actions appropriate to the physical phenomenon being measured
    or controlled.
    A DO Port Controller AE could store a reference to the physical device in one SR and the port status in another SR and
    have action like: Set Main Motor On”, “E-Stop”, …
    An Instrument can be implemented to store the device name and settings with actions like “Set Input ON” “Auto-Scale Y”
    and “Get Trace”,…
    Screen Stacks can be implemented by using control references in one USR and maintain a screen view stack in another
    then implementing actions like “Set Config Screen”, “Set Login Screen”, “Back”…
    Users can be managed using an AE with action such as “Add New User” “Set Password”, “Disable User”…
    The list goes on and is limited only by our imagination. Here is an example that shows how a running average can be
    maintained.
    Running_Average_Example.jpg
    Running Average Example
    The Running Average Example shown above shows how a running average can be maintained using an AE. The AE is
    initialized before the While Loop executes. On each iteration of the loop the simulated measurement value (random
    number) is used to update the history of all measurements (Add Number(s)) and the mean is calculated (Calc Mean).
    Please note that although the buffer of all measurements is affected in every step of this example, the buffer (USR in
    the sub-VI) contents are never part of this VI’s diagram. Since the history is stored in the sub-VI, the history can be
    acted on from more than one thread as shown below.
    Parallel_Loops.jpg
    In the parallel Loops Example the history is initialized and then two loops run in parallel with one updating the
    history and the other plotting the average. Since the History resides inside the USR of the sub-VI the two while loops
    are effectively sharing the same block of memory, the block used to store the USR. The Sub-VI was implemented as shown
    in the following sequence of images.
    Init.jpg
    As was the case with Functional Globals, the actions are implemented as a type def’d enum***** driven case structure.
    Appropriate code is present in each case to realize the intended actions. In the “Init” case, contents of “Array in”
    are used to initialize the history. In our example above we did not pass an initial array value. Therefore the “Init”
    resets the history (cleared the array).
    Add Num.JPG
    The operation of the AE when the “Add Number(s)” action is called varies depending on its usage. If the caller passes a
    non-empty array, it is appended to the array. Alternatively, passing a value via the Numeric in” control, and leaving
    the “Array in” un-wired adds a single element to the history. We used the Numeric In input so we were continually
    building our history one value at a time.
    Calc_Mean.JPG
    When the “Calc Mean” action is invoked, the average is calculated and returned.
    This Nugget is continued in the next post
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Solved!
    Go to Solution.

    Nugget continued
    The Traffic Cop Behind the Scenes
    A detail I have not mentioned up until now is that AEs should be implemented as VIs that are not reentrant***. VIs that are not reentrant can only be executing in one context at a time. LabVIEW will ensure that if there is ever a situation were two contexts are attempting to act on the same AE at the same time, LabVIEW will schedule the first and the subsequent will wait until the first call completes. This is similar to a traffic cop preventing more than one vehicle from entering an intersection at the same time. The Traffic Cop is illustrated in the following timing diagram were we look at how the processing of two threads is affected by using a single AE.
    Execution_Timeline.JPG
    In the figure above the processing time of two processes “P1” and “P2” are illustrated by a red or blue solid arrow respectively. In the parallel loops example shown earlier, P1 could be the “Calc Mean” loop and P2 could be the “Add Number(s)” loop.
     t0 - t1
    Both processes are executable and run their assigned tasks. Neither process is accessing the AE.
    t1 – t2
    P2 continues to run while P1 calls the AE. Since the AE is idle it is available to run so P1 continues execution running inside the AE until all work inside the AE completes. The dotted arrow shows that the thread for P1 is executing in the data space allocated for the AE.
    t2 –t3
    At t2 the AE terminates and both process run as in t0 – t1.
    t3 – t4
    This time segment is similar to t1 – t2 with P2 running in the AE.
    t4 – t5
    Similar to t2 – t3 the AE terminates and both process run.
    t5 – t6
    Similar to t1 – t2. P1 take control of the AE.
    t6 - t7
    At t6 P2 attempts to call the AE. Since the AE is not idle it is not available to run. P2 is placed in a resource wait state (it is NOT running) waiting for the resource to become available. The dotted horizontal arrow indicates the process is not executing.
    t7 –t8
    At t7 the call of the AE by P1 that started at t5 completes and P1 continues to execute outside of the AE. When the call by P1 completes the AE becomes available. The process P2 is marked as executable. The scheduler includes P2 in its executable threads and the AE is available. P2 then executes inside the AE until the call completes.
    The Beauty of the AE
    This behavior of a non-reentrant VI is a wonderful feature we can exploit to eliminate race conditions. Race conditions are the nemesis of many a developer. In hardware this was solved with clocked enabled logic. In LV we solve race conditions with Queues, Semaphores, Rendezvous, Occurrences, and Action Engines!AEs can eliminate race conditions when all operations involving updates of the data stored in the USR are done INSIDE the AE. A very simple illustration of how the encapsulation of USR manipulation is shown in the following set of examples.
    Port_With_Global.jpg
    This VI is intended to demonstrate how two bits of an eight-bit port can be used to control the running state of two pumps. To illustrate the control process, one pump will be set running at start-up and then every half second the state of both pumps will be toggled to simulate switching of the supply. This example uses globals and fails miserably.
    Port_With_Global.jpg
    In this example we start out by initializing a global variable so that bit “1” (zero based) is the only bit set in an array of eight bits. This turns on Pump 2 to start. Then the “Port Update” and a “State Change” loops run in parallel. In the “Port Update” loop the state of the port is read from the global and used to update the GUI.
    In the “State Change” loop, the port status is read and the first Boolean is inverted before being written back to the global. Similarly for the second Boolean. Since the read of the globals both occur before the subsequent data processing, one of the threads will be processing old data.
    Port_With_Action_Engine.jpg
    The Action Engine version codes up the same way as the global version but now all of the data manipulation of the port states are encapsulated in the Action Engine  “Port Controller”. This encapsulation ensures all operations involving the data in the USR are forced to happen sequentially even though we did not have to implement any code to achieve this affect.
    The key point to take away from this example is a shared resource (the port status in the case) when implemented as AEs come with resource contention resolution built in provided that all manipulation of the shared resource takes place inside the AE.
    Action Engines to the rescue!
    Action Engines are not a replacement for Queues, Rendezvous and the other synchronization techniques. They are typically called for when your design dictates that a single resource must be shared by more than one parallel process and none of the LabVIEW provided techniques are sufficient. They require a design of their own to ensure they work correctly. They also have to be developed and supported.
    This Nugget is continued in the next post
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Community Nugget 5-Mar-2007

    Type Definitions Let You See Your Application in a Different Way
    “THE ESSENCE OF TYPE DEFINITIONS IS THAT IF THE TYPE DEFINITION IS CHANGED ALL "MEMBERS" WILL CHANGE THE SAME WAY.” (Albert Geven LabVIEW Champion )
    Type definitions are a wonderful yet under utilized feature of LabVIEW. They allow you to manage the data types of your application in controlled manner.
    Type_Defs.png
     In large applications they can save you hours of work. I have had the opportunity to work on large applications developed without type definitions. These opportunities are seldom quick and easy to change. I have found it to be well worth the time and effort (both of which were considerable) to introduce type definitions as the first step in modifying an existing application. If your application has more than one sub-VI, your application will probably benefit from the use of type definitions.
    Type definitions (type def’s) are implemented in LabVIEW as custom controls. Type def’s allow you define the data types*** used by your application. Once a type def is defined and used on a front panel or block diagram, LabVIEW will ensure that all instances of that type def remain consistent with the definition. This means that if you edit a typed definition and save the changes, every place where that type def is used will be updated automatically. This is particularly useful in the case of enums when they are used to drive action engines**** or state machines.
    Through the use of clusters, you can establish a hierarchy for your data if appropriate. As shown in Hierarchy1.png the hierarchy screen offers a button to control the visibility of type definitions used by your application. By using Type definitions consistently throughout an application a developer can easily determine which VI’s will be affected by a change to one of them.
    Hierarchy1.png
    In the case of the Demo shown above, we can see that the top level VI “Demo” needs to know about changes to the action provided by the sub-VI “Caller”. We also see that changes to the “Chan Name” (Channel Name) data type affect the definition of the “Chan Info” (Channel Information) type definition as well as the “Caller” but they do not affect the top level VI “Demo”.
    We can determine all of the above without ever opening up the diagrams of any of the VI’s or type definitions. This is made more descriptive by editing the icons of the type definitions. The process is quick and easy.
    You start by opening the control editor
    Customize.PNG
    ... and choosing “type def” before saving the control as a unique name.
    You can then open the default icon and select most of the default icon’s image
    Select existing image.PNG
    And slide it down to the left.
    Slide down n left.PNG
    Which gives me plenty of room to add text.
    Structure Name.png
    Since the icons retain the native LabVIEW look it is clear which objects on the hierarchy screen are type definitions. I have for the largest applications taken the time to add graphic that represent the data defined by the type def. This becomes very helpful to pick out the data type you are after from hundreds of VI on the screen.
    View Data Hierarchy.png
    In the application hierarchy screen snippet above I have illustrated how type definitions are very helpful when investigating how a possible type definition change can affect an application. The VI hierarchy screen, when used with type def’s becomes a “data definition hierarchy screen”. Looking at all of the VI in a type def’s hierarchy tells you which high level functions could be affected by changes. The callers tell you the VI’s that need special attention and will adapt to changes in the typed definition. In the case above, we can see (well I can because I can do a little scrolling) that of the 700+ VI used by the application, there are only 10 that use the definition (I shudder at the thought of trying to do this same analysis without type def’s.  ).
    To get the hierarchy snippet I presented above I located** a top-level type def. By “top Level type def” I mean a type def that is not a member of any other type def. Once I located the icon for Equipment Group type def, I was able to right-click and choose Show VI Hierarchy
    Show VI Hierachy.PNG
    Followed by a right-click Highlight connections
    Highlight Connections.PNG
    Summary
    Type definitions allow data structures to be defined and maintained across an application. Enums and clusters use benefit from being used as type def’s. The VI Hierarchy screen includes the option to view or omit type definitons. Consistent icon usage for type def’s makes it easier to find them in large applications. The hierarchy of type def’s define data dependencies.
    Closing
    I hope the above observations on type definition creation, use, and their power to be useful. I’d also love to hear about
    1) How you have used type def’s to your advantage?
    2) How you go about organizing your data structures?
    3) What features of type def’s have I omitted?
    If you have a Nugget you would like to present please post here to reserve your week!
    A list of all Nuggets can be found here .
     Ben
    Notes
    * Warning: changes to application containing hundreds of VI and were not developed using type def’s should be left to professionals. This kind of work has lot in common trying to remodel a house of cards. Every move must be done with great care and you should be not surprised if the entire enterprise comes crashing to the floor. In short, do NOT try this trick at home.
    ** You will find that if you use type definition s in your applications they will end up decorating the bottom edges of your hierarchy.
    *** Type def’s define the data type and not the default values. You cannot use type def’s to establish default values. If you modify a type def that is used as constant on a diagram, all instances of that type def will be replaced with new instances. Default values that were saved in the block diagram will be lost when the constant is replaced with the new definition. This is by design. The method I suggest for establishing a default value is to use a sub-VI to explicitly define the value. In the case of clusters use a bundle by name node to set the fields as required. In the attached 7.1 example you will find
    Type_defd_Constants
    Where I have illustrate the use of sub-VI’s to establish default values. In the example, there are two sets of default values of the type definition “Chan Info” (Channel Information) denoted by the green and grayed-out icons.
    Documented_Constants
    The sub-VI documentation also helps future developers of the application pick-out the proper default settings.
    **** The attached example includes a simple example of an action engine. Stay tuned for a future Nugget where we may discuss action engines.
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Code.zip ‏109 KB

    My recent project involving TypeDefs and 'constant' VIs is about XML creation:
    Where the red 'dot' is a formatter constant with the following content:
    <%1$s>
    %2$s
    </%1$s>
    By using a enum for the XML-tag I can avoid mistypes since XML is case sensitive
    Using 1$s allows me to reuse the first input twice
    And if I need to change the tag-creation I can edit my constant VI.
    Ton
    Message Edited by TonP on 03-05-2007 09:13 AM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    ChartLocations.xctl_KML_Core.png ‏1 KB

  • Community Nugget 02/25/2007

    The native LabVIEW controls were designed to be readable and easy to use, but they are also quite boring.
    There are many ways in which you can change the appearance of your application, ranging from changing the colors of your controls to using system colors and controls to customizing controls to look more interesting.
    Today I'm going to discuss another option which most people are not aware of - using external resources while customizing.
    Basically, every control is made up of several parts. Some of these pieces have limited options for customization, but the other pieces are usually just images which you can replace with anything you want.
    Let's start with Office. LV graphics are vector based graphics, so you can resize them and they will always look sharp. Office graphics are also vector based, so you can copy images created in Word or PowerPoint into LV and your controls will scale nicely. There are probably other programs which can do this, but Office is the one I have most readily available.
    An example might be in order. Continuing with the dials theme from my previous nugget, here are two dials where the housing part was replaced with two gradient filled circles created in PowerPoint. As you can see, this can make your front panel look different and much more appealing and should also resize nicely.
    Note - at least in LV versions in which I've tried this, the internal LV clipboard does not get the image when you copy it in Office. You need to paste it when you edit your control in customize mode and then right click it and select Copy to Clipboard.
    Here's another example, also inspired by something shown in the dials nugget.
    On the left you can see how you can create a classic looking clock by using an appropriate background image and replacing the housing of a dial with a square frame (taken from the decorations palette).
    In the middle you can see how this can be abused by placing a clown nose on a granite background. It is very important to NOT OVERUSE THIS. A user interface becomes extremely unusable if it is filled with distracting and conflicting colors.
    On the right you can see another nice thing - Office images support alpha channel transparency and this is transferred into LV. As you can see in both this picture and the next, this doesn't look too well on my computer, but maybe newer versions of Office\LV handle this better. Also, be careful - LV will usually be much slower when drawing overlapping controls, since it redraws them every single time instead of being smart and only drawing them when needed.
    On the same note, you can use transparent GIFs and PNGs to have images with irregular shapes.
    Another thing that this image shows (other than the partial transparency) is the reshaping of a numeric control by making the numeric text background transparent and replacing the frame with a shaped image
    Attached are three VIs:
    One shows the clocks with a couple of numeric controls with irregular shapes and partial transparency.
    The second shows using an image created in Office and copied into LV to create a Star-Trek like animation.
    The third shows a VI from the NI site which shows using animated GIFs inside custom controls.
    I would like to state this again - this should be used wisely. It is extremely easy to make a front panel too crowded. Remember that your users eventually need to use the program and that is the most important thing. These tricks should be used to make the user interface more usable or more appealing, but they should not come at the expense of usability.
    To learn the basics of control customization, see this page from the LabVIEW help.
    For a list of past nuggets, see here.
    If you want to write nuggets yourself, see here.
    Try to take over the world!
    Attachments:
    GIFAnimatedControls.vi ‏295 KB
    Clocks.vi ‏823 KB
    Flow 61.vi ‏39 KB

    Great nugget.
    For LabVIEW 8.20 users it might be worth mentioning that it now supports direct background images, similar to the windows desktop. You can easily expand the selection in the list by placing other images into "...\resource\backgrounds" of your LabVIEW folder (On windows: C:\Program Files\National Instruments\LabVIEW 8.2\resource\backgrounds).
    For example you could place the woodgrain background image from your clock display, then simply select to "tile, stretch, or center" the image in the pane background.
    Typically you would choose a small "atomic" image that nicely autorepeats a given pattern when tiled. The advantage is that the background will always fill the window, no matter how you size it.
    The following menu can be reached by right-clicking on the scroll-bar and selecting "properties" (LabVIEW 8.20 only!).
    Message Edited by altenbach on 02-26-2007 12:47 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    FP-Background.png ‏71 KB

  • Community Nugget, 05/27/2007

    Today, a useful tip:
    On occasion, it could be very useful to have a VI know whether one of its inputs was wired or not.
    For example:
    You could have a VI which will accept a path, or pop up a file selection dialog if you haven't wired the path input.
    You could have a LV2 style global which would execute its Write case automatically if you wired something into it.
    You could have a utility VI which will operate on the VI calling it unless a reference to another VI was given to it.
    The possibilities are endless.
    LabVIEW does not currently expose a way of letting us know whether an input was wired in the calling VI or not, but there is a workaround. When you don't wire a value into an input control, that control uses its default value. For many datatypes, you can determine as default a special value which would be considered invalid and then check if the control is equal to that value and assume that the input control was not wired if is equal to that value.
    Consider the following code, for instance:
    If a VI reference was wired, the VI will control the defer property for that VI. If no reference was wired, it will control the defer property for the caller, so to control the defer property in your VI, you just have to drop it in the block diagram of your VI.
    Common invalid values include -
    NaN for floating point values
    an empty (invalid) reference for references (VIs, controls, etc.)
    negative numbers for numbers which should only be positive
    a special invalid value for enums.
    Now go out and be creative.
    P.S. You should note that it is important to choose a correct invalid value.
    NaN, for instance, can be achieved through calculation (e.g. through dividing by zero).
    For a list of past nuggets, see here.
    If you want to write nuggets yourself, see here.
    Try to take over the world!
    Attachments:
    Defer Updates.png ‏7 KB
    Defer Updates.vi ‏37 KB

    Just a point I noticed about that (very quick) example - the Defer Updates input should probably be a required input and in any case should not be T by default, because that would make the FP get stuck.
    Attached is a simple example demonstrating its use. When the OK button is changed, the updates are defered for several iterations.
    Try to take over the world!
    Attachments:
    Defer Example.llb ‏52 KB

  • Deploying the SCCM 2012 Client to WES 7 devices that are locked down with the FBWF using 2007 task sequence via WEDM.

    I'm wondering how people are migrating their embedded devices that are using the FBWF. I've done some googling and it seems like most people are just re-imaging the devices and after migrating a single device i see why. Its not a pretty process. This will
    be a long description but ultimately my question stems more from trying to find a better way to execute the device migration from 2007 to 2012.
    Some back ground on my situation might be in order here. I'm in the process of wrapping up our 2007 to 2012 migration. We have a 2007 infrastructure that was a central server with 2 primaries and 286 secondary site servers. I've consolidated that to a single
    2012 primary site server that hosts all the main roles. There are 2 more servers in the data centers both operating solely as push distribution points I'll refer to them as 2012 01 02 and 03. I'm over half way through the migration and so far haven't needed
    to offload any site roles. There are almost 10,000 clients now reporting to the 2012 site server and almost a 100 field servers pulling content from 2012 02 as their source dp as pull dp is the only way forward for this many devices. I've read the horror stories
    of trying spin up 200 plus push dps. We are running PKI. I'm at the point now where i need to start migrating the Windows Embedded Seven Standard clients that have the 2007 sccm client on them with WEDM for write filter handling.
    What i'm wondering is if anyone has any pointers for me regarding migrating the WES 7 devices. My plan that i've come up with is to somehow script the process using a 2007 WEDM Task Sequence to try and migrate them over to 2012. Things are complicated as
    I need to somehow script the install, the policy checkin, hardware inventory, software inventory, and validate the SCEP client installs before I reboot the device one last time to enable the FBWF. How I handled the SCCM 2007 client install on these devices
    when they were provisioned was to just create a batch file that would sleep for ten minutes then check to see if the inventoryagent.log file had been created yet. I realize now that is inefficient as i can kick off the inventory using a WMI method once the
    client has installed. Also I need to make sure the machine gets its first policy as that is how it creates the communication using PKI through that first policy transfer and that also finalizes the client install. The biggest piece i'm uncertain about in this
    regard is the SCEP client.
    I had to change the SCEP client install from yes to no in the default client settings as we have some Mcaffee servers that can't have the SCEP client on them. I have incremental updates enabled on the collection that has the policy that installs the SCEP
    client but this will take an unknown amount of time unless i force the environment to update as the device starts in 2012 install, or if I could kick off the SCEP isntall... IDK. I'm also wondering if i should keep the device in the migration process until
    i validate it has its proper scep policy applied which I believe can be validated by a registry key somewhere.
    Once the 2012 client gets installed will that cause it to lose its place within the 2007 Task Sequence? Considering its going to take a minimum of 2 reboots I'd normally use the task sequence to handle its progression through the process.
    I'm also considering trying to use an Orchestrator runbook, as that would be a good way to keep track of the migration process as each device migrates. Especially since this might take several seperate scripts.
    I'm going to take a stab at scripting the migration process, but if anyone has any pointers that might make this a less complicated I'd really appreciate it as I've got about 3000 of these devices that need to be migrated over. The other things i've learned
    the hard way is any time you have something this complicated over the course of 3000 devices you will run into unknowns and the failure rate increases. I'm in the precarious position of having to not only build this process out but in some situations have
    it complete in the shortest amount of time possible as we have sites running 24x7. I know the end users behavior all to well and they will just keep hitting the power button sometimes even though their not supposed to so they can get their device functional
    again. In those situations i'd end up, if i'm lucky with a device that no longer has a healthy SCCM client in either environment and the write filter disabled.
    So like i said any pointers anyone could throw my way i'd really appreciate. I manually went through the migration process on a single device for proof of concept and ended up with almost 2 pages of pseudo code for my migration script/scripts.
    Thanks,
    -K.R.

    Hi,
    In R2 there are some new variables you can use to solve this,
    http://ccmexec.com/2014/12/smstsmplistrequesttimeout-value-in-milliseconds/
    In Sp1 though adding a step to sleep for 2-5 minuter after reboot and before the application install step is a common workaround.. a powershell command with "Start-Sleep
    -s 120" should do it. 
    /Jörgen
    -- My System Center blog ccmexec.com -- Twitter
    @ccmexec

  • Community Nugget 05/27/2009

    On occasion, you may wish to measure the amount of time a certain piece of code takes to execute.
    What many people do is something like one of these options:
    But this annoying to rewrite every time. If you're good, you probably have a merge VI or use VIs such as the OpenG VIs shown here to save some time on writing this code.
    Well, there is a faster way:
    The timed sequence has an output terminal which tells you how long it takes to execute. You can simply drop one and select that terminal.
    Caveats:
    I believe they're only available on Windows and RT.
    They take too much space (but then, so does the alternative).
    If you're running your code in parallel with other code (which you should not be doing), they might get higher priority, thus skewing the results. I don't know enough about this to give a good answer.
    When you drop one, it has terminals on the inside. You have to select to hide them if you don't want them.
    For a list of past nuggets, see here.
    Try to take over the world!

    In the first pic (flat
    sequence), the inputs of the substract-prim needs to be swapped (as in
    the code using OpenG)
    Actually,
    in both cases the earlier time is correctly substracted from the later
    time. It's just arranged differently (and I agree it can be confusing.
    Another reason to do this, although personally I don't time my code very
    often, so I don't actually use this).
    Sequences always make me nervous...
    So I prefer negative times for two reasons:
    * Something odd is on my BD
    * Rewind the time ASAP before the moment I dropped the sequence
    Felix
    www.aescusoft.de
    My latest community nugget on producer/consumer design
    My current blog: A journey through uml

  • Advice on breaking up Stacked Sequences in 6.1?

    I've dived right into an old but functional
    test system ~300 VI's. Flow and structure is pretty hard to follow and
    I'm thinking of breaking it up into state machines.
    Any ideas on how to approach a stacked sequence beast in 6.1? Flat sequence seems crucial to the method described here.
    Rough layout of main vi attached:
    Attachments:
    main.PNG ‏46 KB

    Open your VI in LV 8.x and use the method described in your linked thread ;-)
    You can copy the sequence and remove it while displaying frame 0 in the original and frame 1 in the copy. If you have controls/indicators they will be duplicated. Also, wire connections via sequence locals will be lost. So you will have to rewire and clean up your code. But I think there's no straightforward solution because flat sequences didn't exist in 6.1.

  • How to get current sequence in a stacked sequence

    Hello,
    I am trying to implement a progress bar for a stacked sequence; as the sequence increases, the bar increases etc... This may be trivial but I cant figureout how to determine the current sequence number.  There is no property node for a stacked sequence structure...
    I am using labview 8.5 
    Regards
    hvo

    First, what proces are you doing using teh sequence structure? In general, you should avoid using sequence structures, esspecially stacked sequence structures. I assume you are new to LabVIEW and data flow programming. Take some time to learn how to use data flow programming and you will find you rarely ever need to use sequence structures. There are lots of discussions which cover the negatives about sequence structures.
    Now, given that you will need to develop your own variable which is used to update the progress bar throughout the sequence. The brute force method would be to wire a value through and use sequence locals. However if you went down this path you will quickly see why sequence structures are not recommended. A more generic method would be to create an Action Engine (search for action engine for lots of explanations on those) which would control the progress bar data. Each frame would need to call the action engine to update the progress bar.
    Since it sounds like you are writing a fairly complex sequence I would recommend you do one of two things. First and probably the easiest would be to create a subVI for each frame and then simply use dataflow to wire these together in the order you want to execute them. The downside here is that you are creating subVIs which may or may not ever be reused. It is still a valid approach though. The second and more flexible approach would be to use a state machine to control your processing. This is much more flexible and easier to maintain than a stacked sequence.
    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

  • Is there a way to automatically jump to a certain frame in a stacked sequence?

    I am working with stacked sequence structures.  I would like to have a condition in some of the frames, such that if the condition is false, the sequence proceeds normally, and if the condition is true, the sequence jumps to a certain frame.  Is this possible?

    Hi D. Luprek and drewsky,
    besides "sequence structures are generally frowned upon": JUMPing around in code is generally frowned upon!
    Long long time ago I used BASIC for programming and heard comments like "BASIC is spaghetti code" or "using JUMPs (aka GOTO) isn't programming"
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • [Help]: Exit stacked sequence in advance

    I am using a stacked sequence structure. Within one sequence, if I find a condition is met, I want exit the whole sequence structure without executing following sequences. Is there a simple way to do this?  Thanks a lot.
    Dejun

    Simple is a relative term.  I would highly recommend not using sequence structures as, usually, it can hide code (stacked) and the same can be accomplished using data flow.  If you cant get around using it (or just dont want to) then the below would be one obvious solution...
    Attachments:
    NoSequence.jpg ‏57 KB

  • Stacked sequence does not trigger

    I am reviewing Pull-down Menu.vi in Labview BasicsII: Development Coarse Manual. When I go through Exercise 2-7, I never get the dialog boxes. I have the Get Menu Selection wired to the stacked sequence where it connects to the box containing the question mark. When I choose "Test 2" or any of the menu choices, it does not trigger the frames.
    I ran the program in solutions on the disk, and this program runs correctly, showing the dialog boxes.
    I have had this problem before. I connect a wire to a stacked sequence where it shows the question mark. But the stacked sequence ignores the information coming to it.

    First, I think you're refering to a case structure and not a sequence structure.
    Second, you are probably not defining your cases properly. You can use probes to examine exactly what data you're sending to the case structure selector terminal (that's the question mark). If you are using strings, the strings have to much exactly to the strings in the case definition. If they don't match, the default case will execute. If, after using a probe to see what data you are sending the case structure, and after making sure you defined the cases correctly, you still don't see what's wrong, you should post your VI.
    I realize saying this is a bit unnecessary, because you already started, but...
    To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
    Try to take over the world!

  • Stacked sequence inside for loop question

    Hi everyone,
    I am new to LabVIEW and I just want to make a for loop with a stack sequence inside. I want it so that when the for loop executes for the n-th time, the stacked sequence is at the n-th frame (because each frame contains different tasks to be carried out). Is this possible? or is there an alternative equivalent method? Please help me out! Thanks!!

    Thank you Norbert for the words of advice.
    Try to avoid Stacked Sequence Structures at all cost.  They are a nightmare to deal with when maintaining the code and they do not offer simple scalability, especially if you need to deal with parallelism.
    As Norbert suggested, State Machines is the way to go.  Try to avoid naming covention such as 1...2...3...4...5.......9999.  Give the name of each case based on what that case does.  Create a TypeDef Control for the state selector (you'll thank me after having changed it for the 5th time   ).
    There are probably 100's of examples in this forum.
    RayR

  • 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 .

  • Question on stacked sequence

    Hi,
    I have a question regarding stacked sequence.
    I have a stacked sequence with 5 sequences (0,....,4). I would like to execute these in this form
    0, 1, 2, 1, 3, 1, 4, 1  then again 0,..
    I don't want to duplicate the 1 section since it contains many objets, variables,...One possibility would be to move out the objects then duplicate the sequence and use shift registers but I don't want to use this because in 1, I have some real time graphs to plot..
    Is there another (easy) way to do this ?
    Thanks for ideas,
    Regards
    Solved!
    Go to Solution.

    nitad54448 wrote:
    I have a question regarding stacked sequence.
    Sequences MUST execute in order until all frames are complete, and there is no escape. Don't use stacked sequences, they are too limiting.
    nitad54448 wrote:
    I don't want to duplicate the 1 section since it contains many objets, variables,...
    You don't need to duplicate it. Create a simple state machine with cases 0,2,3,4 and add the code of state 1 right after the case, so it executes at each iteration of the loop after any of the states.
    Here's a quick draft (LV 8.0) that would cycle through the states as you specified forever. See if it can give you some ideas.
    Please show us your actual code, maybe we have a few better suggestions.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    RepeatStates.vi ‏14 KB

Maybe you are looking for

  • Export problem in 10g

    Hi Gurus, I have a table with a CLOB datatype column. While doing the export the table is not including in the .dmp file. Can any one tell me what will be the solution. Oracle Version: 10.2.0.1.0 OS Version: SunOS 5.10 Thanks in advance.....

  • Forms--Reader users unable to fill in "enabled" form.

    I created and enabled several PDF fill-in forms in Acrobat X. Just recently associates are telling me that they're getting the following error message: "This document enabled extended features in Adobe Reader. The document has been changed since it w

  • Hi, i need some simple help please

    Below is the current code for display and counting values in a table... boolean learningstyle = false; String lstyleresult = ""; RS=Stmt.executeQuery("select data from learningstyle where userid='"+sr_studentid+"' order by submitted desc,id desc");  

  • Open SqL query in DB2

    Hi Experts,                         I dont know wether this is the right form , but my basis team wants me to write a OPEN sql statement in DB2 . This query is for data extraction from a standard table , without any condition. Like for example , Sele

  • Result type is mx.utils.ObjectProxy

    Hi, I am using a calling a Java RemoteObject to return results from a database and the result that is returned is of type mx.utils.ObjectProxy. Each ChildNode of this ObjectProxy is an ArrayCollection whose name I want to use to populate a combobox.