Using a global for device handle

I am wondering if it is a good or bad practice (or perhaps doesn't matter) to keep the handle of an open device as a global variable. See image below for example:
www.vartortech.com

Enrique wrote:
GerdW wrote:
No, the comments go to "your approach may work, but using alternatives might reduce errors..."
"may work"... What problems I might face?
People randomly closing your task and not updating the task...
Multiple people trying to muck with the device at the same time (race condition)...
Please, learn from our experience.  Do not go the route of using a global to hold your task.  You will be much better off if you contain your drivers using an Action Engine or a Singleton.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • How to use fault message for error handling.

    HI
    Anybody has an idea about how we use fault messages to handle errors in XI
    Thanks
    Debraj

    Hi,
    Refer this link. This pdf file has descriptions about fault message types and how to use it.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/4cdfc390-0201-0010-2197-da4ada09f281
    Regards,
    Uma

  • How to receive USB device handle from DLL

    Hi All,
    I'm working on a firmware
    running on a development kit and I'm trying to communicate with the
    board through USB from Labview in Windows environment. For that, I've
    built a DLL which enumerates, opens Read/Write file handle and does a
    few other functions. I'm using standard Windows APIs for USB
    initialization. 
    I use  "Call libr. function node" in labview to call these dll's. Inside the DLL, I use a function to initialize the USB which returns a device handle to the labview. My question is,  in "Call libr. function node" what is the parameter type I should use to receive the device handle? The device/file handle is defined in the WinAPI as a void pointer.
    Any help will be much appreciated.
    Thanks,
    Hari

    Hello Hari,
    Have you seen this thread?  DLL call with HANDLE type
    Regards,
    Charlie Piazza
    Staff Product Support Engineer, RF
    National Instruments

  • I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build.  The same call works fine when running on the device

    I have a production mobile Flex app that uses RemoteObject calls for all data access, and it's working well, except for a new remote call I just added that only fails when running with a release build. The same call works fine when running on the device (iPhone) using debug build. When running with a release build, the result handler is never called (nor is the fault handler called). Viewing the BlazeDS logs in debug mode, the call is received and send back with data. I've narrowed it down to what seems to be a data size issue.
    I have targeted one specific data call that returns in the String value a string length of 44kb, which fails in the release build (result or fault handler never called), but the result handler is called as expected in debug build. When I do not populate the String value (in server side Java code) on the object (just set it empty string), the result handler is then called, and the object is returned (release build).
    The custom object being returned in the call is a very a simple object, with getters/setters for simple types boolean, int, String, and one org.23c.dom.Document type. This same object type is used on other other RemoteObject calls (different data) and works fine (release and debug builds). I originally was returning as a Document, but, just to make sure this wasn't the problem, changed the value to be returned to a String, just to rule out XML/Dom issues in serialization.
    I don't understand 1) why the release build vs. debug build behavior is different for a RemoteObject call, 2) why the calls work in debug build when sending over a somewhat large (but, not unreasonable) amount of data in a String object, but not in release build.
    I have't tried to find out exactly where the failure point in size is, but, not sure that's even relevant, since 44kb isn't an unreasonable size to expect.
    By turning on the Debug mode in BlazeDS, I can see the object and it's attributes being serialized and everything looks good there. The calls are received and processed appropriately in BlazeDS for both debug and release build testing.
    Anyone have an idea on other things to try to debug/resolve this?
    Platform testing is BlazeDS 4, Flashbuilder 4.7, Websphere 8 server, iPhone (iOS 7.1.2). Tried using multiple Flex SDK's 4.12 to the latest 4.13, with no change in behavior.
    Thanks!

    After a week's worth of debugging, I found the issue.
    The Java type returned from the call was defined as ArrayList.  Changing it to List resolved the problem.
    I'm not sure why ArrayList isn't a valid return type, I've been looking at the Adobe docs, and still can't see why this isn't valid.  And, why it works in Debug mode and not in Release build is even stranger.  Maybe someone can shed some light on the logic here to me.

  • I use a PC for work and link it to Office 365. I also have an iphone and ipad. How do I synchronise these devices to Outlook without creating multiple copies of calendars?

    I use my PC for work (MS Office and Outlook). I also use Office 365. I also have an iPhone and iPad. I'm having difficulty getting Outlook to synchronise with Apple devices. I keep getting multiple copies of calendars and not being able to see contacts. Is there a process anywhere which describes the best way to manage these devices together? Or should I just give up on the PC and buy a MacBook or Air.

    Excellent. These guides got me as far as installing my preferred language pack, which gets added to the add-ons automatically (assuming the user says yes to the appearing question when Firefox is started).
    However, the GUI does not change unless the user enters "about:config" and changes the locale.
    Is there a way to do this from the command line? I mean, changing the locale settings.
    And preferrably for all users. So even when new users get added and they start Firefox the first time, they see it appearing with the preferred locale and not in English.

  • HT204053 Hello, I have two iphones but one Apple ID. How can I use localization apps for a dedicated device? Tx

    Hello, I have two iphones but one Apple ID. How can I use localization apps for a dedicated device? Tx

    On the iPad open Settings/iCloud and delete the account using the button at the bottom. Once deleted log in using the other account. For iTunes Stores use Settings/iTunes & Apps Stores, tapp on the Apple ID at the top then sign out. Once done sign in using the other account. Once you are happy with the changes plug your iPad into your computer to update the backup.

  • Error message saying this device cannot be used because Apple mobile device service is not started.  What does this mean and how do I start service....had these devices for over a year now??

    When I tried to sync my iphone 4 and ipad in iturnes, an error message popped up saying this device cannot be used because Apple Mobile Device service is not started!  What does that mean and how do I start service?  I've had these devices for over a year and update and sync regularly and have never seen this message before!

    I got that message yesterday. I'm new at this so don't know if this is the correct solution but it worked for me. I reset my iPod by holding the 2 buttons down until the apple appears AND I restarted my computer. After that everything worked.

  • Using functional global variables to transfer data between touch screen device and other targets

    Hi,
    We are currently developing a control system that will operate on a cRIO with a touch screen interface. During development we have been using functional global variables (FGVs) to handle most of the settings/data etc, however we have just realised that we may have an issue updating the data on the touch screen, and vice versa.
    Previously we have implemented similar programs using shared variables, however we were wondering if there is anyway to implement FGVs in a similar manner, whether it'd be a combination of FGVs and shared variables.
    Regards,
    Mike
    Software version: Labview 8.2.1

    See this thread on LAVA about sharing FGV's across projects. THis should be extendable to cross paltforms (I believe).
    You also may want to concider an upgrade to LV 8.5.1. We have found a number of performance related issues with LV 8.2.1 and RT.
    If you decide not to upgrade, just remeber what I wrote (above) when you have reason to question the performance.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • HT1296 I was using the iCloud for my iPod and had recorded an important Voice Memo on the device. Before I was able to store it on my computer, the device stopped working. I have the data on the Cloud, how can I get that back to my iMac?

    I was using the iCloud for my iPod and had recorded several irreplaceable Voice Memos. It went up to the Cloud, but I wasn't too savvy with the Cloud at that point, so it wasn't syncronizing to my home computer. So, the thing is that the iPod died and the backup is in the Cloud and I would like to load the backup to my iMac to recover my data. How can I do that? Thanks

    The new device I got to replace the iTouch is a iPad and I don't see the playlist I created with previous voice memos on it at all. Is there any way to access them on the iPad? If I erase the iPad and restore it with the old back up will the Voice Memos come along and get in to my home computer or will I be out of luck?

  • How can I best make use of all my devices ? Mac mini, Apple TV, AirPort Extreme, airport express, ipad 2 (all purchased in 2011) and an old imac with OS X. I use my iPhones personal hotspot for all Internet.

    How can I best make use of all my devices ? Mac mini, Apple TV, AirPort Extreme, airport express, ipad 2 (all purchased in 2011) and an old imac with OS X. I use my iPhones personal hotspot for all Internet.

    Maybe you are looking to re-purpose this equipment versus getting rid of it if so, the best thing to do is search the internet for tutorials.  And I say this because it's what I would do, there are a lot of tutorials online.    Hope you can find good use for them.  Worse case scenario if you can't find something right now, package them very nicely and when you come across something unbox and enjoy.  I've re-purposed a mac color classic and LOVE IT!!

  • I want a soundbar for my 6th generation nano but am having trouble finding a compatible device. I'd like more than a dock, ideally a soundbar with wireless subwoofer. I'll only use the soundbar for music, not TV home theater. Any suggestions?

    I want a soundbar for my 6th generation nano but am having trouble finding a compatible device. I'd like more than a dock, ideally a soundbar with wireless subwoofer. I'll only use the soundbar for music, not TV home theater. Any suggestions? Thanks.

    Google

  • Hello , I want to ask some question about ipads \  How powerful is the iPad?  How useful is it for reading books, newspaper or magazines or for surfing the web? Can you identify any shortcomings of the device?   please help me :(

    Hello ,
    I want to ask some question about ipads \
    How powerful is the iPad? 
    How useful is it for reading books, newspaper or magazines or for surfing the web?
    Can you identify any shortcomings of the device?  
    please help me

    it's less powerful than your average computer. THink of it like a netbook but with a better processor.
    It'll do fine for surfing (although if you browse a lot of flash based sites you will need to get a third party browser since safari doesn't accommodate it)
    You may do OK on reading books, papers or magazines, especially if they have apps, but the ipad's screen is backlit, so it doesn't work well outdoors and you may need to fiddle with the brightness so that you don't get eye strain (it's just like doing too much reading from a computer screen)
    I would say the biggest short comings are data transfer. Apple's preferred work flow is that everything is done via iTunes or the internet....well people dont' always have 100% reliable always on internet access so you can find yourself in a situation where you can't get things on/off the iPad.
    By and large, it's a good device for day to day stuff, but is not a computer replacement.

  • What is used to authorize a device for Itunes?

    I  am trying to understand what is used from a specific device to "Authorize" it for itunes. Is it a MAC address or something else that would always be with a device?

    A this time there is no force upload command for iTunes Match.
    Since tis is s user-to-user forum no one here knows exactly what the process iTunes uses is. What we do know is the waveform of the song is the primary criteria, and music is only matched in the store for which you have an account. It is not unusual for some albums in a library to have some tracks matched and others uploaded.

  • If I already created additional Apple IDs for use on my kids devices, how can I convert them to "kids" Apple IDs?

    If I already created additional Apple IDs for use on my kids devices, how can I convert them to "kids" Apple IDs?

    You can't
    Family Sharing and Apple IDs for kids
    http://support.apple.com/en-us/HT201084
    The Apple ID has it's right already set and can not be changed

  • Using two different sound devices for in and out

    Hi,
    I want to do the following:
    For speakers I have the Logitech Z-10 that have an internal usb sound device. Sadly it hasn't a connector for a mic.
    Nevertheless I'd like to use a microphone for teamspeak or ventrilo.
    My mainboard has an onboard sound chip that I used before I had the Logitechs.
    So my question is, can I use the usb speakers and the onboard chip simultaniously - one for out and one for in?
    I alread adjusted my modprobe.conf so that every device has its index number but I don't know how to proceed.
    Regards
    Barghest

    You're right. In ventrilo I can chose different devices.
    TS2 is not working att all. I can't neither hear nor use the mic. There's no option for selecting the device.
    \edit: Ok, I installed TS via wine. Works like a charm. What a pitty that TS doesn't work under arch
    Last edited by Barghest (2009-05-17 16:24:25)

Maybe you are looking for

  • XDC error while running test program FP_CHECK_DESTINATION_SERVICE

    Hi, all. We are on ECC 6.0 backend single stack and EP6 on NW04 SP17. I have installed the ADS on the java stack on EP6. However, I could not get the XDC working. Note that I am just using http for the ADS, not https. When I run the test programs lik

  • External HD suddenly "unreadable" - PLEASE HELP!

    Im in total panic mode right now, so I'll try and provide all the information exactly as I remember it. Last night, I wanted to move some things off my 350GB Maxtor (model escapes me at the moment, I'm at work...) to a DVD. The External HD is connect

  • Pass Parameters to T.Code  in the portal from aTransaction Iview.

    Good Morning. I published a T.code in the portal as a Transaction Iview. This work fine. I want pass a parameter to this t.code and that the program ABAP can get this value . I check a suggestion in the post following : From Portal transaction iView

  • Can't delete row

    Hi, i am trying to implement page 664 of dev guide which is delete row of table. My page shows the data of one row. I added a delete submitbutton to my page. Here is my code : int idi = Integer.parseInt(id.toString()); XxVOImpl vo = getXxVO1(); XxVOR

  • Wrong Profit Center Posting

    Hello, My Client  posted an FI document in the month of Feb '10 but in wrong the profit center. Now they want to reverse the document and re-posting  in another profit center. They don't know the document number. They just know the balance. Kindly su