Tweak performance for node LV Classes and "more specific."

Here's a tip for performance on the node "to more specific" and the classes of LabVIEW.

This message is for those who really need every drop of performance rush of LabVIEW code. It won't make much difference in most applications, and make the code more difficult to read is generally not a minor speed bump. On the other hand, sometimes this trick can help you avoid a copy of important data.

In general, it is best if you can simply add a dynamic distribution VI to your class hierarchy to make specific to the type of work, but there are cases where it's just not possible. When this happens, a programmer reaches for the node "to the more specific" test type. Here's a typical piece of code:

This code works! Let me tell you: this code works. It does exactly what you expect: If the object is a particular type of child, she changes the subject. If the object is another type, it makes the object unchanged. And if the performance of your application are pretty good with the code above, I encourage you to leave him alone. It is easy to read, and a book of readability outweighs an ounce of performance. But if you hit a few bumps on road performance, read on.

So, what's the problem? The problem is that this code makes a deep copy of the object. When the node to more specific runs, if the object is not the desired type, then the output is changed to become a default instance of the desired type. This means that the wire branch which has the original value of the object must be a copy of the object where the original value is preserved. Even if these two sons back together further downstream, it is impossible for the compiler to the LV to avoid making this copy in the meantime (I continue to ask the compiler to brainstorming team in this area in the hope of a cool breakthrough).

Is there a solution? Almost. The following workaround solution did not work in LV 2011, but the compiler has learned a new trick in 2012 of LV, and I want to share with you all now so that any of you write code today will get improvement when you upgrade.

LV 2012, the following code will prevent the copy of the object:

We have taught the node to be more specific to be aware when its output is unwired and not tell the compiler that it changes the input object. This means that the first "to more specific" has simply type tests and never modifies the object even if the cast fails, then the original object remains available for the structure of the case. The second "to the more specific" is casting.

This duplication of the node to more specific means that you do the control of type double, which is a minor performance overhead. For some very small classes, I can imagine that the time to duplicate the object can be smaller than the time to make the second type control, but I seriously doubt that's going to be true for any real type in one of these situations.

So if you're writing this kind of code in 2011 (or sooner) type checking and the need for representation thrust, you can start using this model of "double to more specific. And then when you migrate to 2012, your screws will get the benefit. On the other hand, if your performance is today very well, leave the code alone and just let the compiler change over time until that one day he can avoid the copy in the case of simple code.

Thanks for the tip.  Are there other primitives, on top of your head, that only perform a subset of their features, while some of their productions are unwired?

Tags: NI Software

Similar Questions

  • Problem Manager of horizontal scrolling for OS 6.0 and more?

    Hi all. I have a problem with the Manager of Horizontal scrolling. Every thing worked for OS 5.0 and below, the question arises for OS 6.0 and more. For example, check the following:

    I have 2 HFM added to the optimization of resources.

    HFM1 - contains 2 buttons.

    HFM2 - contains 6 buttons, and the user can scroll between the buttons.

    The questions is when user keep hitting the right key, when the focus is on the second button of HFM1, then the content of HFM2 scrolls to the right - what is bad behavior.

    Check the screenshot for Simulator 9810 (when scrolling to the right inside the HFM which contains the test1, test2 scrolls the second HFM):

    Scrolling in a managing scrools in another, why this happen and how that might be solved?

    Thank you in advance.

    Finally, I found a solution using ScrollChangeListener (SCL).

    So what I did I set the SCL for HFM2, then:

     public void scrollChanged(final Manager manager, int newHorizontalScroll,
                int newVerticalScroll)
        {
    
            //----> fixing the issue when one HFM scroll another one for OS 6.0 and above
            int fwf = manager.getFieldWithFocusIndex();
            if (fwf == -1)
                manager.setHorizontalScroll(0);
            //<---- fixing the issue when one HFM scroll another one for OS 6.0 and above
    
    }
    

    Thanks to all in any case.

  • How to search for files containing one or more specific words?

    How to find file or files containing one or more words? Alan Cameron

    Yes, this solution works!

    1. Click on organize | Folder and search options
    2. 'Search' tab
    3. Always search file names and contents (NB: will be a slower search)

    Open a Windows Explorer window

    Otherwise, you could add the location to your indexed locations.

  • Properties of the component of modifing Cluster on sbRIO? No node "to more specific class?

    Hello

    I designed a fairly large RT application.  Our structure is to have our main vi RT with several large groups which pass into subvis that modify the components of the pole passed through its reference. (Easy) In addition, we have to change the properties of the cluster component as well. Other examples, to change the properties of a cluster of referral component, we do:

    (1) obtain controls [] property of the cluster

    (2) of the index in the [] for the component Control

    (3) class "to more specific" use with the exact type of the component

    (4) fix a property node to access the property of desirec

    It worked well except that we are currently making a sbRIO system. All the 'to more specific class' now are broken with the error message that this node "only is not supported on the current target".

    I spoke to a representative of OR who says that 'To more specific class' is NOT supported on the real-time hardware. If this is the case, how one is changing the properties of component a cluster without using the node "to more specific class?

    A simple example is attached. It shows a simple cluster of two components that must have their properties changed. It works fine on a material in real time (such as a host PC). It breaks on our sbRIO.

    Yet once how one change properties of a component cluster on a system in real-time like sbRIO?

    We use LabView 8.6.1 on a sbRIO 9642.

    -Paul

    I installed LabView 2009 today and here it is--the "to more specific class" node is now permitted on a real-time target. Nothing in the documentation indicates that it but I'm not complaining. You can now change the ownership of a cluster component in a subvi on a real-time target. Thanks to which it is fixed that!

  • Type mismatch and VI properties in 'for more specific classes.

    Dear all

    I have a Subvi trying to modify the properties of certain objects on the main pane of the front, in the example I have attached to this message it works well, but when I use the same Subvi in my main application which is a little bigger and has more hierarchical levels (that's why I join this one) it comes across some errors.

    Once running "to a more specific class' in the Sub - VI called ("MultpObj1N"), it gives this error that" LabVIEW: Type mismatch: object cannot be cast to the specified type.»

    I have no idea what could be the reason for this. Do you have any idea what it could be?

    Best regards

    Afshin

    Dear Darren

    Suddenly, I realized that my problem just happens to group objects (no cards) and like you said the type of data were different. Because I wanted to just access the visibility as you suggested, I've changed the strict form for normal and it worked.

    Thank you very much for your advice!

    BR

    Afshin

  • "For more specific class" does not not on sbRIO 9636

    The application that I am forcing me to programmatically access arbitrary components of a nested group. Currently, I am doing the browsing the cluster using his property [] node recursively controls. Currently, my accessor VI to accomplish this works very well on a normal PC but does not work on my target in real time, a sbRIO 9636.

    After some research, I determined that the function "To more specific class" does not work on my target in real time. I have attached a code base that shows the heart of the problem. It works fine on a PC but will return an error 53 when running on my target in real time.

    A few questions:

    (1) is 'To more specific class' supported on the sbRIO 9636 or not?
    (2) if it is supported, what am I doing wrong?

    (3) if it is not taken in charge, what are other methods for access by the arbitrary elements of a nested cluster program?
    (4) if it is not supported, why LabVIEW allows me to place the feature even when the sbRIO 9636 is explicitly selected as my goal in my LabVIEW project? It seems prudent to restrict its use, if it is not supported. My day job has been effectively wasted because of this problem.

    For reference, here's a few previous discussions

    http://forums.NI.com/T5/real-time-measurement-and/modifing-cluster-component-properties-on-sbRIO-No-...

    http://forums.NI.com/T5/real-time-measurement-and/quot-Manager-call-not-supported-quot-when-typecast...

    Thank you
    JAnthony

    The other posts are correct, because it is currently not possible to use the function on a real-time target. This is a known issue and is being investigated for correction, but currently there is no work around. It is available on the pallets that this behavior is not intentional and should work.

    You have described your application requires that recursively through a table and access to specific data. Does this mean that the Data Structure might be different when the vi is run and you need to adapt to a changing data type? If this isn't the case, then all you need to do is to get the value of the reference and then ungroup the cluster as needed then store the changed values to the same reference.

    If you're going to have to settle you will encounter difficulties to be determined pragmatically you should do but I have a suggestion. Create a cluster with an enum and a Variant. You can use the enumeration to set the type of the variant in question. He chooses the type to convert the variant according to the code. It is a similar structure, like messages in queue manager and his messages that happening except that you will be passing a reference to this group that has both the message and the payload in one. The reference could be used to get the value and then the code must only be written to accept the Cluster of Enum and variant you can then convert the variant to the appropriate type for later use. For best performance, you also use in Place of the Structure element.

    It's only a means potentially accomplish what you want. If you describe your program and needs more in depth, we are able to offer a more suitable solution for your application that does what you need. I wish you a nice day!

  • Close the reference (for a more specific class)

    I'm feeding a control reference to the node "to a more specific class.  When I finished, I understand that I have to close the order, but what I also close the reference that is the output of the node "to a more specific class?

    This is the same reference... There is no need to close the two.  And if you approve the automatic cleanup of references LabVIEW, you really do not need to close, as the references control must never be matched and will be automatically cleaned when your VI is inactive.

    For more information, here is a blog that just now, I wrote that talks about closing reference.

  • can I create a class and a package for my inframe AS and go global

    NSN

    I made an application using only inframe actionscript in a .fla;

    variable base transfrerring 1 in box 2 is not reliable.

    Sources say that the persistence on the frames, but I found it not as unreliable.

    The paintings appear to be filled with the right values. Var normal int reported in box 1 fails some time.

    You should use the classes that I hear saying you, and right you are.

    But I did not.

    Now I'm using a reload, re-initing and/or the sharedobject.

    Anyhoe...

    Question:

    If I declare a class for my main .fla file.,.

    then declare, instantiate and load the globals I want in this main class.

    I'll be able to access these variables in my timeline script main .fla?

    If so, I was able to restore my .fla into small objects/classes and make a real application.

    From scratch is. welll... I don't want to even think that.

    Which is higher

    Mac

    Oh, I know your pain. I have used a LOT more time I should have AS2. I got a few apps exceeding 10,000 rows in a single class file and had said to flash my file exceeds the size max and I couldn't even export. I saw also mysteriously loses references to objects or "something else" adjusted or cancelled my variables.

    But it was AS2 and long ago...

    I've never seen AS3 have this problem. You have a ton of code so I expect completely, having been able to Flash for more than a decade, that it is a failure. Flash is not perfect, but AS3 lose variable data between frames seems very likely. I only claim when you arrive that a lot of code, it is easy to forget something that can be reset your variables. If you draw () d them and they are not "undefined", they exist and have apparently been set to 0. This leads me to believe, somewhere in this vast desert of the code, "something else" affects these variables and is not flash.

    I've had several years of blame flash under my belt. In AS2 it actually was the case sometimes. In AS3? I've always found the mistake of being my own...

  • I bought an iPhone 6s and more in the United States, now its screen is broken, I live in China, personal APPLE let me come back to the United States for maintenance!  So ridiculous, help! Thank you!

    I bought an iPhone 6s and more in the United States, now its screen is broken, I live in China, personal APPLE let me come back to the United States for maintenance!  So ridiculous, help! Thank you!

    the iPhone may be served only in the country where it was purchased. Nothing strange in this situation. You can ask your friends or relatives in US to take your device at the Apple Store it.

  • Apple stop updates iOS 9.3 for older iDevices due to activation server locking problems more and more.

    Latest news of Apple posted, incredibly, ELSEWHERE other than on Apple own site Web/community technical forums.

    Apparently Apple has stopped now updates iOS 9.3 for older iDevices due to activation server locking problems more and more.

    http://www.IMore.com/Apple-working-iOS-93-fix-older-iPhone-iPad

    Someone just posted in another thread that it may be active again. I can't check it, because they haven't posted a link about her being active again, and I've already updated all my devices, I can't be sure. Maybe something to watch.

  • Wizard Boot Camp is stuck at "Download windows software support...". "0 minutes 0 seconds remaining (for 48 hours and more) ' for Windows 10 Pro

    Wizard Boot Camp is stuck at "Download windows software support...". "0 minutes 0 seconds remaining (for 48 hours and more) ' for Windows 10 Pro.

    I did Boot Camp with 8,1 this system successfully but the upgrade of Windows 10 dorked BootCamp upward when it is added to the system partition.  Has had a lot of work, but ultimately got all partitions disappeared and I tried Boot Camp and got it.  I erased the disc and then reinstalled El Capitan sweet factory without bringing more parameters.  Now, I still get the same error?

    I tried a few sizes of ~ 50 to 170 G with no luck.  It's on a MBP 2016 15 "with retina, 512G SSD, 16G RAM, GPU display.

    Any suggestions?  Troubleshooting?  I can't yet find/say if this thing creates something useful for a log file or?

    1. you download Windows Support software on a wireless connection? If so, try a connection cable, if possible.

    2. Please look in Applications-> utilities-> Console logs for error messages.

  • How to monitor the TX and RX on PERFORMANCE for virtual network adapter BASP monitor?

    How to monitor the TX and RX on PERFORMANCE for virtual network adapter BASP monitor?

    I have a virtual network adapter that is created with Broadcom.

    This virtual interface named "BASP eCard" visible on the performance monitor in the category 'Rhythm Pipe' but not in the category "Network Interface".

    This is problematic because the Tx and Rx (bytes received/send in second) is available in "Network Interface" that show physical network cards only.

    Someone has an idea?

    Thank you

    This issue is beyond the scope of this site (for consumers) and to be sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)
    *
  • I want to allocate more disk space for my c drive and remove the drive d

    I want to allocate more disk space for my c drive and remove the drive d. I 26 gig on the d drive and only using less than 1% of it, and I have the same amount on c, but only 39% c left. How to do this.

    LEM explained the problems that you tried to resize partitions on the same drive.

    You can create more free space in C in carrying one of the measures suggested below.

    The default allocation for the restoration of the system is 12% on your C partition is more generous. I have them would be reduced by 700 MB. Make my computer right click on your icon, and select System Restore. Place the cursor on your C drive select settings but this time find the slider and drag it to the left until it shows 700 MB and output. When you get to the settings screen, click on apply and OK and leave.

    A flaw that might be useless which is for temporary internet files, especially if you keep no copies on the disk offline. Setting the default value is 3% of the walk. Depending on your attitude to copies offline, you could bring it to 1% or 2%. In Internet Explorer, select Tools, Internet Options, general, temporary Internet files, settings to make the change. At the same time, look at the number of days, the story stands.

    The default allocation for the basket is 10% of the disk. Change to 5%, which should be enough. In Windows Explorer hover over your Recycle Bin, right click and select Properties, Global and move the slider from 10% to 5%. However, try to let you become so complete that if it is complete and you delete a file by mistake it will bypass the Recycle Bin and have gone forever.

    You can generate more space in the system (usually C) the folder move partition.

    For temporary Internet files, select Start, Control Panel, Internet Options, temporary Internet files. Settings and move back.

    To move the storage folder Outlook Express select from Outlook Express Tools, Options, maintenance, store folder and change.  http://www.tomsterdam.com/insideoe/files/store.htm.

    How to change the default location of the My Documents folder: http://support.microsoft.com/?id=310147

    You may also change the default locations of the files in Microsoft Office programs when you choose to move the My Documents folder. For Word, go to tools, Options, file locations, highlight the Documents, click on edit and change the path. For Excel, go to tools, Options, general, and change the default path.

    My Documents is one of the many the created system of special folders, which include my pictures, and my music. It can be more easily modified using TweakUi. Download TweakUI, one of MS powertoys, here: http://www.microsoft.com/windowsxp/pro/downloads/powertoys.asp.

    In TweakUi, select workstation, special folders. You can scroll down to see the full list of special folders to the left of the button to change the location.

    You can move programs, but to do this, you must uninstall and reinstall the program. With Word and Excel, the existing data files are not affected by reinstalling. Most of the work in question is going to be reinstall all updates issued after those that are included with the original Microsoft CD / DVD.

    If your drive is formatted as NTFS another potential gain arises with your operating system on your C drive. In the Windows directory of your C partition you will some uninstall files in your Windows folder in general: $NtServicePackUninstall$ and $NtUninstallKB282010$ etc. These files can be compressed or not compressed. If compressed text the name of the folder appears in blue. If these files are not compressed you can compress. Right-click on each folder and select Properties, general, advanced, and check the box before you compress contents to save disk space. On the general tab, you can see the winning amount by deducting the size on disk size. File compression is only an option on an NTFS formatted disk partition / partition.

    I'd be interested to see a report of Disk Defragmenter. Open Disk Defragmenter and click analysis. Select view report, and then click Save as and save. Now find VolumeC.txt in your My Documents folder. Open the file, place the cursor anywhere in the file, select Edition, select all to select all the text and copy and paste into the body of your message. To do this, before you run Disk Defragmenter because it is more informative.

    Select Start, all programs, accessories, System Tools, cleaning disk to emptying your trash, delete temporary Internet files and other selected options. I recommend also you click Other Options, System Restore and delete all but the last system restore point. Run Disk Defragmenter

    Using the system restore option is most appropriate when your system is slow and you need to increase the free disk space on your C partition. If you have errors that could be solved by using the system restore to your system settings back to before that the error occurred initially, do not use this option.

    Select Start, Control Panel, Folder Options, view, advanced settings and check the box in front of "show files and folders" and 'Hide protected operating system files' are unchecked. You may need to scroll down to see the second element. You should also make sure that the box before "Hide extensions of known file types" is not checked. Notwithstanding, there are some files that are hidden. Again, you will not see the System Volume Information folder.

  • If someone UN-install/reinstall the XP operating system for a new beginning and not use any old files more than cure someone of a problem of malware/malicious?

    If someone UN-install/reinstall the XP operating system for a new beginning and not use any old files more than cure someone of a problem of malware/malicious

    Reformat the disk and reinstall Windows XP would heal any problem of malicious program with the exception of an infected MBR (Master Boot Record) on the disk.   The F-Secure rescue CD is a tool that allows to remove a MBR infection.

  • I cancelled my subscription to the CC more than 6 months ago and today I discovered that I had to be charged for another six months and must pay a cancellation fees of $57?

    I cancelled my subscription to the CC more than 6 months ago only used the product and today that I found out, I had to be charged for another six months and must pay a cancellation fees of $57?

    Contact adobe during the time pst support by clicking here and, when available, click on "still need help," http://helpx.adobe.com/x-productkb/global/service-ccm.html

Maybe you are looking for

  • Channel playback TDMS property

    Hello I managed to read the property of length of channel DDHN at the level of channel using the name of the property "NI_ChannelLength". Although in the file, it is called "length". I wonder if there's a mysterious name for the property of "Strings"

  • After reconnection messed TCP/IP

    Again... back with TCP/IP more questions. When I start my two cRIOs they connect correctly, and my side host, I read the header the cRIOs send up and read correctly the following data. Now, if I stop my host application, connections are closed on the

  • Download of the updates of Windows 7 is no longer displays a progress bar and shows instead download Windows 10 which is not. How can I fix?

    For a few months now, since Windows 10 became available, download updates to Windows 7 is no longer shows the progress bar during download or installation u [pdates.  It shows only 10 of Windows that is not downloading.  Indeed updates get installed

  • Pavilion a6230n Vista Recovery

    Impossible to find on the site of HP recovery disks I guess that they are not available. Vista sticker with the always readable product codes. My question is: Can I buy a copy of "system builder" of Win 7 and use the info on the Vista sticker to acti

  • Is it possible to set the background Image of the graph?

    APEX version: 4.2.3Browser: IE9 / ChromeDB: Oracle 11 g 2Hello Experts,It is possible the background image of the cards? If so, please guide me how to do because I have found no option.Thank you!