wait in loop - VI Analyzer test

Hi all

I ran VI Analyzer on a VI.  I failed the test high rank 'Loop waiting in time', which I did not quite understand.  Please take a look at the description below

-----

This While loop containing a control on the front panel Terminal seems to have no way to adjust his speed.  If it is a Subvi, you can move the control out of the loop Terminal.  If it is a VI user interface, consider using a Structure of the event to monitor the activity of the front panel.

----

I have a state machine architecture consisting of a while loop and a box structure.  My case has a real constant which is connected to the Terminal stop condition.  The rest of the case have a false constants.  The button on the front panel connect directly to the Terminal stop condition.  It activates the .

How can I improve my code for this test?  Thank you

You missed to include a wait function in your loop. In doing so, your VI hogs the CPU in a useless way (because obviously, you wait for the interaction of the user).

Norbert

Tags: NI Software

Similar Questions

  • Name Analyzer Test descriptions

    Is there a way to retrieve the Descriptions of each of the names VI Analyzer Test?

    I looked around the llbs in the vi.lib\addons\analyzer folder but cannot find a function to do this.

    Example: Arrays and strings in loops fits the description:

    Check the passers-by to see if they contain functions of table build or concatenate strings. Avoid using these functions in loops because each call to them requires a dynamic resizing of the matrix or the chain, which can affect the time processor and memory.  This test does not check the timed loops.

    I looked some more and discovered that the info I wanted is contained in the Description of VI a VI that is the name of the test more "Config.VI". I used VI Server to open the LVLIB that contains these screws 'Config' and 'get all descendants. I extracted the descriptions that I tried using VI server.

    See attached VI (LV 8.6)

  • VI Analyzer test

    Hi all

    I try to use my vi Analyzer, but when I open it, there is no test available (no comics, no FP test test, etc.).  What is going on?

    Yik

    Are there test LLBs in project\_VI Analyzer\_tests?  Otherwise, the VI Analyzer is not installed (or maybe you accidentally installed in a different folder of LabVIEW).

  • Recommendation for size VMDK for IO Analyzer test vsan

    Hello

    Is there a size Analyzer IO Vmware VMDK recommendation? When deploy you from the model of the test is performed on the second disc of 100 MB. I saw a few recommendations to remove this second disc and add a great new.

    Analyzer 01-100MB on disk, I get 12000 IOPS / s, 45 Mbit/s on a random test of 4k_70% read_80%.

    Analyzer 02-100 GB drive, I have 1300 iops, 5 Mbps on a random test of 4k_70% read_80%.

    Caching is disabled on all drives and controllers (HP P420i). 3 x HP DL380 (200SSD, 5 x 900 10kSAS).

    I'm surprised the difference that both drives should reach the 200 GB ssd. Or analyzers from writing to disks are formatted with any FS. Obviously, the second machine with the largest disk not reading so that lower iops cache hits is but I don't know why, as are big enough SSDS.

    Thank you

    Remember, VSAN is all about having your work in cache, so that most of the readings reached the level of flash cache.

    It seems that monitor 1 with 100MB is mainly in the cache, while 2 parser is not.

    We are working on a guideline that the working set of an application is usually 10% of its capacity. It is sometimes more, sometimes less is, but 10% is a generally accepted rule.

    I don't know how the Analyzer has been configured, but it is the workload it contains repeated data profiles, while some cached data can be read?

    If this is not the case, this may mean that you are simply fill the SSD write buffer, it disabling the disk rotation when it reaches a particular threshold, then fill again. This means that you are bound by disk magnetic performance and get very little by way of benefit from caching layer of VSAN.

    Things to look at:

    1. is Analyzer using 100 GB just like its working set, and cela will reflect your production workloads? If this isn't the case, reduced to a size that is the reflection of a real production working together? If most of your VMS use 100 GB VMDK, consider a set of 10 GB size work.

    2 Analyzer uses patterns to repeat? If not, configure it to do this, or use another tool of reference that makes.

    HTH

    Cormac

  • VI Analyzer: reentrancy and USR test

    I am developing a test of custom parser VI, following the steps given here: design a VI Analyzer Test custom, that will check the status of reentrancy a VI. If it is reentrant - I then want to check for all while loops with uninitialized records the SHIFT (USR) or feedback on the block diagram nodes and compare that with the type of reentrancy (share clones and allocated in advance). If there is the USR or feedback nodes and type of reentrancy is clones part I want to point out that as a failure. It is easy check the reentrancy and type using VI server, shown VI extracts below, but I did not understand how to test for nodes of the USR/Feedback. Maybe there's a GObject property.

    If a returning VI manages the data of the State between calls and share the clones then there is no guarantee that the State will be kept appropriately between subsequent calls when a first level VI calls in several places. Excellent article by Brian Powell on LabVIEW log field found here: http://labviewjournal.com/2012/02/maintaining-state-1/.

    Any help would be greatly appreciated since it comes from a customer who wants to use this criterion of thousands of VI s rather than opening each one and control... Thank you.

    Instead of writing your own essay, can you use the test environment VI questions (in the block diagram > category warnings) of the VI Analyzer Toolkit to verify this?

    If for any reason any test of the expedition is not what you need, you can view its source code here:

    \project\_VI Analyzer\_tests\Block Diagram\Warnings\Reentrant VI Issues. llb\Reentrant VI Issues.vi

    None of the screws for this test is protected by password (in LabVIEW 2011), so you can see the script code I used to find the shift uninitialized registers and not initialized comment nodes. Let me know if you have any other questions.

  • VI Analyzer Questions: Change the default test configuration and screw "Pavilion".

    I have two things I continue to come through in VI Analyzer:

    1. are there in any case to set the default VI Analyzer so that it applies to all projects, I'm working on that?

    I tried to create a task in project A, registration of the configuration and any attempt to open this file in project B, but it says that the file could not be loaded. The reason for my question is that there are a few default options that just add errors that we don't care (e.g. Controls dialog on the façade - 99% of the LabVIEW code that we are working on is called from TestStand as code modules, so the front panel doesn't really count)

    2. can I score / report some screws as 'safe' for parser tests?

    Basically, some screws may fail some perfectly safe way VI Analyzer tests (e.g. non-stanard errors on a 'closing' VI, who doesn't have a case error structure so that the device always gets closed). I wish I had a way to mark the VI kind VI Analyzer would ignore this particular test. This would allow me to have a rule that says something like "before any construction, run the file configuration VI analyzer and make sure there is not error", as opposed to "run VI Analyzer and examine errors, decide whether or not they are important for the VI in question..." ». An extension to this question would be how do I perform a task VI Analyzer before building when the VI Analyzer screw do not accept files cfg for project based tasks.

    Any help would be greately appreciated!

    Thank you

    Shaun

    1. a project oriented .cfg file cannot be transferred between projects.  Could you possibly create a .cfg unrelated to the project file (under the option 'Start a new task' on the first page of the VI Analyzer) and use it?  He would have no file in the list, but it would have all of the configured tests as you want.  And you could start with this on your different projects .cfg file... you would just add screws based on file (on page 2 of the VI Analyzer), rather than have all come to you in a .cfg project-based.

    2. on page 4 VI Analyzer, you can exclude certain tests to run on some screws and save these settings in a .cfg.  This option is also exposed in the VI Analyzer API with VIAn exclude the VI.vi Tests.

  • Abandonment of a loop timed - what happens?

    LV2013, LVRT 2013

    I'm not clear on what happens when you STOP a timed loop, STOP TIMED STRUCTURE vi.

    The help says:

    "If you try to interrupt a timed running the timed immediately loop loop runs the current iteration and returns ABORTED in the output of the REASON for the data node left."

    Given the following loop:

    I can abandon this loop, by name, by the way.

    This cancellation occurs at any time, regardless of this loop is where its cycle.

    This loop runs at 10 Hz and takes 1 to 2 mSec per iteration.

    1... what happens if the cancellation occurs during the delay?  I guess that he wakes up with the reason set to ABORTED.  It executes the code inside, or not?

    2... Suppose that the loop has already run the vi of the SAMPLE, but not the vi STORE, when comes the demolition.  It don't...

    (  ) 2A... An abortion without running the STORE?

    (  ) 2B... Run the STORE, browse again with REASON = INTERRUPTED, and then runs the SAMPLE and STORE again?

    (  ) 2C... Run the STORE, browse again with REASON = INTERRUPTED, then popping out without running again?

    3... assume that the loop is located in the middle of the vi of the SAMPLE.  What is this VI partially abandoned through?

    What throws me is help text: "immediately runs the current iteration and returns ABORTED."

    If she abandoned after he woke up normally, then the REASON is already set, so he can't tell me that it's been abandoned.  But if she should set the REASON, then it must finish executing the code, browse AGAIN, and then run the code AGAIN, isn't?

    Anyone know the rules for this?

    I have not tested, I guess based on a combination of documentation and experience in similar situations. It should still run once with the reason set to ABORTED to give the code inside a chance to do a cleaning. If you are in the middle of an iteration, it will end this iteration, then run again immediately. If cancellation is received during the wait, the loop is executed immediately once (stops pending). The last execution will always be reason set to ABORTED, and you never have a situation where the code is suddenly stopped in the middle of execution.

  • Is it possible to execute a loop For independently within a while loop in LabVIEW 2013?

    In my program, I want to run a loop For inside a while loop and run independently, at their own rate of execution.  A test, I wrote a simple VI with a while loop with 1 second calendar and in this I inserted a loop For with 3 of a second.  I created indicators for the two terminals of the iteration.  When executing the VI, I found the while loop waiting for loop For run N times before the while loop is executed again.  I also found that sometimes the first iteration of the loop For ends at 1 second instead of 3 seconds and the STOP button to complete execution of the While loop does not always work.

    This is the expected behavior. LabVIEW is the language of s DATA stream. If you want the curls to be independent, it can be data forcing addictive so use separate loops.

  • Wait for the host disconnects and then run a command

    Hello world

    I have a stop script for my virtual infrastructure, now I have to add code to stop an Equallogic AFTER the last host table is turned off.

    I know the commands to do this, but I need help to write a loop that will test the ip address of the last host management and wait until this station responds to pings.

    In my script I have to establish what host will be put off to the end so it's not a problem... How can I keep ping IP management host to die and then run the commands Equallogic?

    I hope that I managed to explain to me... I was exploring the Test-Connection cmdlet but it seems that it displays che echo of the ping instead of State... I'm a bit lost around this, can someone help me please?

    Something like that would do the trick?

    $count = 0

    $maxWait = 10

    {}

    $count += 1

    Write-Output "$(get-date-f HH) $(get-date-f JJ/MM/AAAA)-host is offline."

    sleep 5

    } until (!) (Test-Connection 192.168.110.85 - BufferSize) count 16-1 - calm)- or ($count - gt $maxWait))

    If {($count - gt $maxWait)

    Write-Output "Host always online."

    }

    else {}

    Write-Output "$(get-date-f HH) $(get-date-f JJ/MM/AAAA)-host is offline."

    }

  • Bug in VI Analyzer 2010 support stop the creation of a solution of the files quick launch bar

    Hello

    This problem is a pain for me, as we have just completed our full transition above LabVIEW 2010.  I'm sure that I raised it as an issue in the 2010 beta test and received a new VI to solve it, but it always seems to be a problem in the final version and the beta forums have long since disappeared.

    Guidelines for creating a fast Analyzer test launch VI involves the use of the VI VIAnUtil check if valid Start Menu VI.vi

    In the previous version of the VI Analyzer toolkit this VI had no input, but in the 2010 version of the Toolbox now as a need for VI path entry and so the error if you try to use it in the Tools Menu.

    The VI belongs to the \LabVIEW 2010\vi.lib\addons\analyzer\_analyzerutils.llb library is password protected so I can't fix it myself. I guess I could throw the version of LabVIEW 8.2.1 the lib, but I'd rather have a good Vi or better yet a new _analyzerutils.llb of NEITHER.

    Should I raise a CAR on this issue or is out of reach, because it is not a VI provided in the palette

    see you soon

    DannyT

    In LabVIEW 8.5 and earlier versions, bolt of QuickLaunch launched through the built-in mechanism to put the VI somewhere in the [LabVIEW] \project folder in the Tools menu.  In LabVIEW 8.6 or later, we started to use another mechanism to launch Quick Launch screw related to the fact that the Toolbox has become licensed.  Specifically, the Refnum of VI for the VI which has been selected is transmitted directly to the VI of quick launch... as long as there is a control called "VI Refnum" somewhere on your VI in quick launch Panel, the refnum VI will be spent, how you can do what you want with... but usually , you will have right of passage to VIAnUtil to check if it is valid Menu launched VI.vi.

    You can change your VI of quick launch to have the same structure as the model of the quick launch area to vi.lib\addons\analyzer\analyzerapi.llb\VIAn Template.vit of VI in quick launch?

  • For the migration of LabVIEW VI Analyzer

    Hi all

    I remember hearing that the VI Analyzer can be used to check for issues related to migration between versions of LabVIEW.

    We already have VI Analyzer, but can someone please point me in the right direction to get the VI Analyzer test resources.

    Thank you

    Phill

    http://www.NI.com/white-paper/11636/en/

  • Producer consumer with the third loop model

    Hello everyone and thank you for looking at this.

    I have a problem that I thought for a while now on the execution of a third loop in a design model of producer consumer (with events).

    I use this type of model for a UI and am happy with how it works. However if I want to add a continuis loop model to test for example how can I control the loop?

    In my example (see table), I use a local variable to run them (or stop) the test and the same to close the application.

    I don't know why, but this feels wrong to me. Is there a better way?

    Thanks in advance

    Chuck

    Nickelback says:

    Is the problem with the consumer loop only runs when it receives a message from producer loops event.

    Nothing says that you can't have a consumer loop enqueue States to itself.  Of course, this is more in a State Machine in queue with the possibility for another loop to the States of the queue.

  • VI Analyzer - Find sub - VI calls by name of path

    Is it possible to use the VI Analyzer to detect and report if a specific sub - VI (identified by a path name) is used in a tested VI?

    I'm upgrading to LabVIEW 7.0 to 8.6. I need to identify the use of the specific screws and replace them with new native LabVIEW functions.

    I have been able to remove these screws Sub and find the broken screw, but they get to be part of the hierarchy of "vi.lib\" LabVIEW, and I prefer not to modify or delete them.

    Hi Philippe,.

    I have attached a below VI Analyzer test that should do what you want.  Besides looking for static calls Subvi, it also checks the controls/string constants and constants/controls of path of the name of VI that you specify, in case you have dynamic calls.  To use this test in LabVIEW 8.6 do the following:

    1. Copy the LLB enclosed in [My Documents] \LabVIEW Data\VI Tests Analyzer (you may need to create this folder).
    2. Run the tools > VI Analyzer.
    3. Specify the records of VIs you want to analyze.
    4. On the test selection page, place a check box next to \VI Analyzer Tests\Find VI Calls.
    5. Type the name of the VI (s) you want to search 'Offenser the screws' list on the right.  I recommend excluding the extension ".vi"... I noticed once when I was looking for a VI that the Subvi name was not what I expected.  In my case, the name I specified was 'Write to worksheet File.vi', and the VI on the chart was "Write to the spreadsheet (dbl) .vi file" because it was a polymorphic VI.  Since this test matches breaking partial strings, I just specified the name of 'writing on a spreadsheet file' and it has been found.
    6. Run the analysis.

    I would like to know if you have any questions or problems.

    D

  • Exclusion of a virtual machine foreach loop help

    I need to stop all the virtual machines in a particular vCenter due to work on the underlying storage.  I have a script that would normally do this, but in this case, the vCenter is virtual.  I need the foreach loop to ignore it.

    I thought I could do a nested loop, but my tests do not work...  Pointers or suggestions?

    Thanks in advance!

    ----------------------------------------

    SE connect-VIServer $server

    # Gets the list of all virtual machines in a specific folder

    $vms = get-data center-appoint "data CENTER" | Get - VM

    # Stop the virtual machines in the data center located in a State power.

    {Foreach ($vm to $vms)

    If ($vm. PowerState - eq 'Receptor') {}

    If {($vm.name-ne «vcenter01»)}

    $vmMOR = $vm | Get-View

    If {($vmMOR.Config.Tools.ToolsVersion-ne "0")}

    stop #gracefully

    Stop-VMGuest - VM $vm - confirm: $false

    sleep - 60 seconds

    }

    #forcefully VM stop

    Stop-VM - $vm VM - confirm: $false

    }

    }

    }

    sleep - 60 seconds

    Stop-VMGuest - VM vcenter01 - confirm: $false

    Try like this

    SE connect-VIServer $server

    # Gets the list of all virtual machines in a specific folder

    $vms = get-data center-appoint "data CENTER" | Get - VM |

    where {$_.} Name - not "vcenter01" - and $_. PowerState - eq "Receptor"}

    # Stop the virtual machines in the data center located in a State power.

    {Foreach ($vm to $vms)

    if($VM.) {ExtensionData.Config.Tools.ToolsVersion - only '0')}

    stop #gracefully

    Stop-VMGuest - VM $vm - confirm: $false

    sleep - 60 seconds

    }

    else {}

    #forcefully VM stop

    Stop-VM - $vm VM - confirm: $false

    }

    }

    sleep - 60 seconds

    Stop-VMGuest - VM vcenter01 - confirm: $false

  • Problem with waiting-task

    I tried automating the resetting of a lab with PowerCLI environment. This lab consists of 15 sets of 3 virtual machines. Each game contains a XP and a 2008 server a Linux device. Virtual machines created from templates and are assigned to specific user names. Automating this process would seriously help the technicians whose responsibilities

    The script (which is listed below) has the following functions created and work:

    (1) DeleteOldVMs - stop existing virtual machines and then deletes them from the disk

    (2) CreateVMSet - creates each of the 3 virtual machines is necessary for each user.

    (3) StartNewVMs - start all VMs newly created

    (4) AssignUserToVM - assign rights to the VM assigns to each user

    My last problem is the duplication of the task of start-VM and tasks of New - VM. New - VM task must finish before I assign rights to virtual machines and start them. I tried to use Wait-task, but I had no luck. I currently have the Wait-job sections deleted by the script. I'm looking for any suggestions on how I can properly implement Wait-task force the script to wait for that VM sets are created before proceed.

    My only other thought was using Start-Sleep for a predetermined period.

    Any thoughts?

    Here's the script:

    Function AssignUserToVM

    {

    $xpvm = get-vm WinXP-$n

    $winvm = get-vm -Win2008 $n

    $vistavm = get-vm OpenVista-$n

    #$emrvm = get - vm Avogadro - $n

    New-VIPermission -Entity $xpvm -main "sound$ n ' -role EHR822VirtualMachineUser -spread $false

    New-VIPermission -Entity $WinVM -main "sound$ n ' -role EHR822VirtualMachineUser -spread $false

    New-VIPermission -Entity $vistavm -main "sound$ n ' -role EHR822VirtualMachineUser -spread $false

    #New - VIPermission - $emrvm - main entity "sound$ n '-role EHR822VirtualMachineUser-spread $false

    }

    Function CreateVMSet

    {

    #Create XP VM

    $XPTemplate = Get-model -name 'model-WinXPPro.

    $XPSpec = Get-OSCustomizationSpec -name "Windows XP."

    $XPVMName = "WinXP-$n.

    New-VM -VMHost "$VMhost" -name '$XPVMName' -model '$XPTemplate' OSCustomizationSpec - $XPSpec -location $VMLocation

    VM #Create 2008

    $2008Template = Get-model -name 'model-Win2008-32.

    $2008VMName = 'Win2008-$n.

    $2008Spec = Get-OSCustomizationSpec -name "Windows Server 2008".

    $VMhost = Get-VMHost

    New-VM -VMHost $VMhost -model $2008Template -name $2008VMName -OSCustomizationSpec $2008Spec -location $VMlocation

    OpenVistA VM #Create

    $OpenVistATemplate = Get-model -name 'model-OpenVistA-device.

    $OpenVistaVMName = "OpenVista-$n.

    New-VM -VMHost $VMhost -name $OpenVistaVMName -model $OpenVistATemplate -location $VMlocation

    }

    Function StartNewVMs

    {

    Start-VM -VM "Win2008 *-

    Start-VM -VM "WinXP-* '.

    Start-VM -VM "OpenVista *-

    }

    Function DeleteOldVMs

    {

    Stop-VM -VM "Win2008 *-

    Stop-VM -VM "WinXP-* '.

    Stop-VM -VM "OpenVista *-    

    Remove-VM -VM "Win2008-* ' -DeletePermanently

    Remove-VM -VM "WinXP-* ' -DeletePermanently

    Remove-VM -VM "OpenVista-* ' -DeletePermanently

    }

    Write-Host "" Please enter your credentials to the announcement: "."

    $vCenterCredential = Get-Credential

    $VMhost = "hitecvsphere.ccbcmd.edu".

    $vCenter = "hitechvcenter.ccbc.ccbcmd.edu".

    $VMlocation = "AHL822".

    Se connect-VIServer -Server $vCenter -Credential $vCenterCredential

    $NumVMsToCreate = Read-Host "" enter the number of games of virtual machine that you want to create: "."

    DeleteOldVMs

    $n = 1

    While ($n - the $NumVMsToCreate)

    {

    CreateVMSet

    $n ++

    }

    StartNewVMs

    $n = 1

    While ($n - the $NumVMsToCreate)

    {

    AssignUserToVM

    $n ++

    }

    Yes, because the virtual machine is always created when the task of waiting already get the signal that the task is complete.

    Have you tried inserting a "sleep 30' for example?

    BTW, using the - RunAsync on the New - VM, immediately followed by a waiting task for this New - VM cmdlet, is in my opinion the same as New - VM running without the RunAsync parameter and not using the Wait-job cmdlet.

    The real value, IMHO, to use the RunAsync parameter is when you launch a bunch of New - VM cmdlets, and once they are all running start you a waiting task loop. See my post on Async tasks, the Get-job cmdlet and a hash table for an example of what I'm trying to say here.

Maybe you are looking for