What is the proper way to close all open sessions of a NI PXI-4110 for a given Device alias?

I've found that, when programming the NI PXI-4110 that, if a the VI "niDCPower Initialize With Channels VI" (NI-DCPower pallette) is called with a device
alias that all ready has one or more sessions open (due to an abort or other programming error) a device reference results from the reference out that has a (*) where "*" is post-fixed to the device reference where and is an integer starting that increments with each initialize call. In my clean up, I would like to close all open sessions. For example, let's said the device alias is "NIPower_1" in NI Max, and there are 5 open sessions; NIPower_1, NIPower_1 (1), NIPower_1 (2), NIPower_1 (3), and NIPower_1 (4). A simple initialize or reset (using niDCPower Initialize With Channels VI, or, niDCPower Initialize With Channels VI, etc.) What is the proper way to close all open sessions?
Thanks in advance. Been struggleing with this for days!

When you Initialize a session to a device that already has a session open, NI-DCPower closes the previous session and returns a new one. You can verify this very easily: try to use the first session after the second session was opened.
Unfortunately, there is a small leak and that is what you encountered: the previous session remains registered with LabVIEW, since we unregister inside the Close VI and this was never called. So the name of the session still shows in the control like you noted: NIPower_1, NIPower_1 (1), NIPower_1 (2), NIPower_1 (3), and NIPower_1 (4), etc.
There may be a way to iterate over the registered sessions, but I couldn't find it. However, you can unregister them by calling "IVI Delete Session". Look for it inside "niDCPower Close.vi". If you don't have the list of open sessions, but you have the device name, then you can just append (1), (2) and so forth and call "IVI Delete Session" in a loop. There's no problem calling it on sessions that were never added.
However - I consider all this a hack. What you should do is write code that does not leak sessions. Anything you open, you should close. If you find yourself in a situation where there are a lot of leaked sessions during development, relaunching LabVIEW will clear it out. If relaunching LabVIEW is too much of an annoyance, then write a VI that does what I described above and run it when needed. You can even make it "smarter" by getting the names of all the NI-DCPower devices in your system using the System Configuration or niModInst APIs.
Hope this helps.
Marcos Kirsch
Principal Software Engineer
Core Modular Instruments Software
National Instruments

Similar Messages

  • What is the best way to close a communication session with the FP Server?

    Looking at NI's FieldPoint Demobox.vi example, the session is closed by wiring the FP Refnum out from the FP Create Tag vi for the AI module to the FP Close vi. Is there any difference if the FP Refnum out from any or all of the other FP Create Tags were wired to FP Close vi/vi's? Could the FP Refnum out from the FP Open vi be wired to the FP Close vi? What is the best way to do this?
    Also, as I'm new to FP and I'm conscious that I might swamp this forum with dumb questions, are the any sources of good FP code examples and/or discussions on coding techniques out there beyond the handful of NI's examples?
    Thanks again,
    Niel.

    Niel,
    The FP Open.vi provides a FP Refnum in the form of a data cluster. The cluster contains two elements; a server refnum and a tag refnum. Coming out of the FP Open, only the server refnum has a value, the tag refnum is created when the FP Create Tag.vi is processed. Thus all FP refnums in a process have the same server refnum but different tag refnums. The FP Close.vi uses the server refnum to close the server and ignores the tag refnum so it does not matter which particular refnum was used to close the server. The thing to be careful of is if you close on refnum, you close all refnums. At this point, any reads/writes/advises will result in error 32804 (Invalid IA handle specified).
    Also, please swamp this forum with questions. I am in the process of reviewin
    g the documentation and examples we provide and having a beginner asking questions that do not appear to be covered in our materials gives me an idea of what we are missing. I would ask that you upgrade to FieldPoint Explorer 2.0.4 and use the online help for LabVIEW since that has had some of my modifications added to it (program flow outlines, vi descriptions & use cases).
    Regards, Aaron

  • What is the proper way to "close" an application?

    I see, after a while, all the apps I've used still show open in the activity monitor and memory available is almost zero. I have to restart the iPhone.
    I thought pressing the Home key closed the apps. Apparently not?
    -Jim

    http://manuals.info.apple.com/en_US/iphone_user_guide.pdf
    A very, very few apps will run in the background.
    You can close them by going to the recently used apps bar (double click home button),  holding down an icon until they wiggle, then tapping the "x"
    This should not be needed for most apps.  Apps that run in the background such as Tomtom can be turned off from the app itself.

  • I have been filling up my internal memory on my laptop after years of video editing. I now want to export all this footage to an external hard drive. What is the proper way to do this.

    I have been filling up my internal memory on my laptop after years of video editing. I now want to export all this footage to an external hard drive. What is the proper way to do this.

    Are the videos being stored in iMovie or another application? Have you exported/shared the video? If the video is in iMovie what version of iMovie are you using? Give as much info as possible, and you may also want to post the question in the iLife section of this forum since more people with video skills will be reading the iLife/iMovie threads.

  • What is the proper way to reinstall iTunes after error 42404 without losing all my music?

    What is the proper way to reinstall iTunes after error 42404 without losing all my music?

    Here's what I do when I have iTunes problems and it works 9 out of 10 times.  I have Ccleaner; It's a wonderful tool to have.  If you don't have it, google it and install it, just the free version.  You'll see the list of all of your installed programs in there to unstall (among of a host of other things you could do with that program) but anyway, right click on Apple Software first to repair, when done then right click on Apple Application Support to repair, then when done with that, right click on iTunes to repair that and all should be well after that.  No uninstall should be necessary at all when you do all that.

  • What's the proper way of mixing voices on top of loud music?

    Hello!
    I'm working on a little something that contains very loud music and very loud voices mixed together.
    It sounds great on my Logitech G35 headphones, but when playing it through my studio monitors in the living room, the voices seem to get a little drowned out by the music (The music is at a pleasingly loud level that I wish to keep, as it doesn't sound as powerful as soon as I bring it's gain down a little).
    So I was wondering what is the proper way of keeping the great loudness of the music and the voices at the same time, but make the voices a little more understandable?
    The music and the voices are on seperate tracks of course in my Audition file.
    Here is an example of what it sounds like currently: http://soundcloud.com/stefanpanic/gameshow-trailer
    Thanks in advance!

    Okay, with my acoustician's hat on:
    Headphone mixing - especially when it comes to voices in the centre of a stereo field - has always been a disaster area, and you can almost always spot when a mix has been made to play on headphones, because the vocal is invariably too quiet.
    I suppose that the easiest way to explain this is to consider what happens to the central voice with loudspeakers. That voice is essentially a virtual image; there isn't a loudspeaker there to support it. So it's been created out of the off-axis responses of your loudspeakers, and is in a space that's quite a distance from your ears, compared to where it would be on headphones. So, the level of this voice depends as much on the angle of your speakers as anything, and whilst this varies considerably between different setups, it's still considerably different to the relationship that headphones have with your ears!
    Traditionally in the past, it's been recommended that you should sit in an equilateral triangle with your speakers, which should be pointing towards you which means an included angle of 120 degrees between them. Despite this information being repeated all over the place since the 1950's, there's no physical basis for it at all, and most people don't have setups like that anyway. And I have to say that this really isn't good positioning for establishing a central image - that angle is too great, and you are relying on an extremely good off-axis response to achieve any level at all there.
    In this day and age, what you really need is a monitoring compromise that will let you create a mix that sounds not so bad on both headphones and loudspeakers, and there are a couple of things you can do to improve the situation considerably, and get a generally better result. And FWIW, it's what I do in this situation...
    The first is to alter the angle of your monitors so that the included angle is 90 degrees (a right-angle) and sit so that both of them are pointing directly at your ears. This gets you a lot closer to the monitors, admittedly, but is far more realistic as far as a compromise mix is concerned. If you do your whole mix like this, you'll find that it's a lot easier to position things in it too. And don't put anything like soft furnishings between them either - that will definitely make things worse. The second thing is that one of the important things you should always do with a mix like this, to finally establish vocal levels, is to listen to it really quietly. No, really quietly! Almost at vanishing point. What you should hear is the whole mix, but if anything is standing out (like the vocal), it will become obvious like this in a way that it simply won't when it's louder. You want it to be there, certainly - but it shouldn't be either missing or standing out too much.

  • How can I use 2 Apple IDs in Itunes? I have 2 IOS Devices. They each have there own AppleID. What is the proper way to sync both of them to Itunes?

    How can I use 2 Apple IDs in Itunes? I have 2 IOS Devices. They each have there own AppleID. What is the proper way to sync both of them to Itunes? I wanted my teenager's AppleID to be different from mine so that she couldn't charge stuff to my AppleID, therefore I created me another one. Now when I go to Sync either device, it tells me that this IOS device can only be synced with one AppleID. Then I get a message to erase it, not going to do that, lol. If I logout as one ID and login as the other, will it still retain all synced information on the PC from the first IOS device? If I can just log in out of the AppleID, then I have no problem doing that as long as the synced apps, music, etc stays there for both. I am not trying to copy from one to the other, just want to make sure I have a backup for the UhOh times. If logging in and out on the same PC of multiple AppleIDs is acceptible then I need to be able to authorize the PC for both devices. Thanks for the help. I am new to the iOS world.

    "Method Three
    Create a separate iTunes library for each device. Note:It is important that you make a new iTunes Library file. Do not justmake a copy of your existing iTunes Library file. If iTunes is open,quit it.
    This one may work. I searched and searched on the website for something like this, I guess I just didn't search correctly, lol. I will give this a try later. My daughter is not be back for a few weekends, therefore I will have to try the Method 3 when she comes back for the weekend again. "
    I forgot to mention that she has a PC at her house that she also syncs to. Would this cause a problem. I am already getting that pop up saying that the iPod is synced to another library (even though she is signed in with her Apple ID to iTunes) and gives the pop up to Cancel, Erase & Sync, or Transfer Purchases. My question arose because she clicked on "Erase & Sync" by mistake when she plugged the iPod to her PC the first time. When the iPod was purchased and setup, it was synced to my PC first. When she went home, she hooked it up to her PC and then she erased it by accident. I was able to restore all the missing stuff yesterday using my PC. However, even after doing that it still told me the next time I hooked it up last night that the iPod was currently synced with a different library. Hopefully, you can help me understand all this. She wants to sync her iPod and also backup her iPod at both places. Both PCs have been authorised. Thanks

  • What is the Proper Way to "Sync My Music & Apps to a New Computer Using ITunes"

    What is the Proper Way for Me to "Sync My Music, Pictures & Apps to a New Computer Using ITunes"?
    I had to buy a New Computer since my other one went out, but when I log into ITunes with the New Computer using My Apple ID "Nothing is there"...
    None of My Previously Purchased Music or Apps are in My ITunes Media Library; so, I any not sure how to Properly Proceed with Syncing?
    Any Help & Guidance would be Greatly Appreciated!!!
    Thanks,
    Don

    Sounds like something might be wrong there. Years ago I set up the playlists to sync to my iPhone and 'Everything' for my iPod and I've never needed to change or even check it since, ever.
    However, how and why are you 'restoring' the iPod? This is not something you should ever need to do. If you restore back to original settings, then I guess that would throw away your own settings, but as I said, there should be no need to keep doing that. Or at all in fact.

  • What is the proper way to publish standard proxies/services using PI?

    Hello experts,
    Iu2019m working on a Project where we have an ECC 6.0 and we need to publish some standard services to external third-party applications. We found that the functionality that these third-party applications need is accomplished by the service MaintenanceRequestCreateRequestConfirmation_In of component ESA ECC-SE 603. As we are centralizing all our interfaces in SAP Process Intregration I have installed the ESA ECC-SE 603 XI content in SAP PI. After the installation, in tr. SPROXY transaction of the ECC system I can see the proxy properly implemented and ready to be called. And now I have to configure the interface in Integration Directoy. What I wonder is whatu2019s the best practice to configure this in PI? As I can see in ESR the service category is Inbound but, if Iu2019m not wrong, I have to publish a Outbound service? What should I do? Copy the entire definition to my own Software Component and create my own Outbound service? What is the proper way to publish standard proxies/services using PI?
    Thank you in advance.

    Using the Page Items to Submit property on the report region, the Refresh action is all that should be needed. I created a copy of page 2 on page 3, removed the Set Value action, and it is working as expected. I don't have access to 4.2.1 to try it on that specific patch level, but I've been using Page Items to Submit with a Refresh DA since 4.2.0 with no problems.

  • What is the proper way to apply SCCM 2012 R2 Cumulative Updates

    Hello All!
    I am looking for a little advice. Since deploying SCCM 2012 R2 I have not yet installed any of the cumulative updates. What is the proper way to install the previusely released updates? I believe there has been 3 CU relases since SCCM 2012R2. Should
    I just install the most recent CU or install all of them starting with CU1? I know each one addresses different issues so I would think install all of them would make sense.
    Thanks,
    Phillip
    Phil Balderos

    No, they're cumulative, so you only have to install the latest.
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • What is the proper way to reset a CoreTree's TreeModel?

    I have a senerio in which I need to clear out a CoreTree on an event - remove all roots and nodes and re-populate the CoreTree with new data.
    I've tried to nullify the CoreTree's TreeModel.
    I've tried using the PathSet:
    PathSet pathSetTransact = this.getTransactTree().getTreeState();
    if(pathSetTransact != null){
    Set ks = pathSetTransact.getKeySet();
    ks.clear();
    Neither of these work.
    What is the proper way to reset a CoreTree's TreeModel?
    Thanks,
    --Todd
    Also, in your code snippet, root isn't even used?
    Message was edited by:
    jtp51

    OK.
    This just isn't working.
    Setting my CoreTree's TreeModel with an empty GenericTreeNode does not clear out the previously populated tree.
    What other path could I take to accomplish my goal?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • What is the proper way to convert a VHD from dynamic to basic without losing data?

    Hi,
    What is the proper way to convert a VHD from dynamic to basic without losing data?
    Our VM is running Windows Server 2008 R2 SP1
    Thanks in advanced

    Hi efebo,
    "After you convert a basic disk to a dynamic disk, you cannot change the dynamic volumes back to partitions. Instead, you must delete all dynamic volumes on the disk and then use the
    Convert To Basic Disk command. If you want to keep your data, you must first back it up or move it to another volume. "
    Please refer to following link:
    http://technet.microsoft.com/en-us/library/cc731274.aspx
    You can try to backup the dynamic volume via Windows Server Backup then restore it to a new basic VHD file ( the space is recommended to be   larger than or equal to the old one ) .
    Hope it helps
    Best Regards
    Elton Ji
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • What is the proper way to do Color Space Defaults?

    What is the proper way to do Color Space Defaults?   let the color checker chart fill the whole frame or just put the  color checker chart in  front or aside items or people we are gonna shoot?

    I"m not sure how to use this through Direct Link ... as the timeline including all color-space things are locked down. Perhaps going through Sg in a "native" launch with some of the footage, though it would have to be in a codec Sg takes in "native" ... then doing the color chart thing, creating a Look from it, and then applying that in Direct Link sessions might be the process ... but yea, Dennis Weinmann, some advice here?
    Thanks!
    Neil

  • What is the proper way to lift and move a 27" iMac?

    What is the proper way to lift and move a 27" iMac? Can the stand get bent if supported under its thin edge while carrying it? thanks, Kevin

    The stand isn't all that thin, but the best way is to pick it up with both arms around the screen holding the screen to your chest. Cradle the screen in your arms where your elbows are bent. The screen is then supported by your forearms and hands.

  • What is the proper way to move the iTunes (v11) Media folder to an external USB HD?

    What is the proper way to move the iTunes (version 11) Media folder to an external USB HD?  I have tried to following listed instructions, but although I can get the songs listed, their locations are not found.

    Tried the option key, but it would not let me select the copied iTunes folder.  Also changed the path for iTunes Media Location folder.  But still iTunes is not happy.  I could try the alias route, but I don't have an iTunes folder that iTunes is happy with to point it to.  All of the songs and even the playlists will come up, but it seems some form of the folder and its files must remain on the internal hard drive.  But I want to move it off because it is out of space.  Any other thoughts?
    I have all of the music etc files what I do not want to lose is the playlists.  I don't care about the play counts.  I would be glad to reimport all of the songs to the newly designated folder, but won't I lose my playlists?
    Thanks for your help.

Maybe you are looking for

  • How can i passing chinese word parameter within jsp

    i got the issue of passing chinese parameter from one jsp to another jsp. my scenario is this : <br> i store the unicode(\u521B\u9020\u7528\u6237)in the .properties file. in 1.jsp i call the java to get the unicode from .properties file and it shows

  • Essbase Excel add-in error

    We have upgraded to Essbase 6.5.2 and when installing the excel add-in haveencountered the message "R.xls" file cannot be found. Does anyone elseknow anything about this and how to resolve this? The addin works okay,but the users get this message eac

  • Insert a Child Object via WS 2.0

    Hi Everyone, Could someone please guide to Insert a Child Object via WS 2.0. Any snippet / code would be highly appreciated. Thanks in advance. Regards

  • How to get songs out of a used ipod touch then reassign

    My son gave his old Ipod touch to his little sister. i think its a 1st gen. He has about 1200 songs and wants to be able to transfer all his songs onto his iphone. Hasn't used it in so long, he doesn't remember his login and password into his old itu

  • Error message GP626

    Hi All, Version 0 is not activated in our system from fiscal year 2011. We want to post a recurring entry for certain future expenses. But we are getting following error message, Message No: GP626. Version 0 is not defined in controlling area XXXX fo