Register a global hotkey with Labview

I need to register a global hotkey, in Windows, in order to fire an
event in a top-level VI application.
I suspect it could be possible by accessing the Windows API but I
don't know how to link a global keystroke event with a labview event.
I use LV 8.2 and Windows XP.
Thanks in advance.

Monitoring keystrokes within a LabVIEW application can be done with the input VIs. There's an example called "Basic Input Demo" that ships with LabVIEW that shows you how to do this. Open the Example Finder and search for "keyboard".
However, it sounds like you want the LabVIEW application to receive the keystroke if you're in another Windows application, or diddling around in Explorer. Is this the case? If so, you can still use those VIs to monitor the keys. You just need to make sure you're not stealing some keystroke that another process is expecting.

Similar Messages

  • Global (system-wide) hotkey with Powershell

     
    Hi, i have a winform which is minimized/or hidden and would like to make it appear with a global (system wide) hotkey. (see bogus "new-hotkey"-cmdlet below)
    [void][System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
    $form1 = New-Object 'System.Windows.Forms.Form'
    $form1.ClientSize = '300, 250'
    $form1.windowstate = "minimized"
    # -- bogus(!) code --
    $hk = new-hotkey -scope Global -keys "Ctrl,Shift,Z" -action ({$form1.windowstate = "normal" })
    $form1.ShowDialog()
    I searched the web intensively but only found C# solutions, which i could not translate into powershell (v3). I tried but it did not work:
    http://stackoverflow.com/questions/23855928/acessing-c-sharp-code-in-powershell
    The trouble is: even if i manage to use some C# code in my script, because i do not understand C#, i can't debug it.
    I tried a few third-party tools, like WASP, Pseventing, Autohotkey, but they all have disadvantages or did not work correctly, so using C# in Powershell is seemingly the way to go.
    I'm sorry, cause i know its not appreciated, but i need a working solution, not just tips how the get started.
    thanks a lot, Rob

    http://www.fluxbytes.com/csharp/how-to-register-a-global-hotkey-for-your-application-in-c/ shows the basics of how to accomplish this, by using the Win32
    API RegisterHotKey function (which you've already found, by the looks of your StackOverflow post.)  Converting this to run PowerShell code in response to the hotkey might be a bit complicated, and also unnecessary in your case (since you seem to just
    want to change the value of a property on the form, you could do that right in the C# WndProc method, or whatever it calls in response to your hotkey.
    To make something more generic which can cause PowerShell code to execute, I'd probably have the form raise an event in response to the Windows message.  Then PowerShell scripts can use Register-ObjectEvent to respond to it, and you don't have to worry
    about problems with threads or runspaces (since the PowerShell engine already takes care of that for you when you use Register-ObjectEvent.)

  • Using Global Mapper SDK with LabVIEW

    I am actually new to using any SDK with LabVIEW.The basic idea behind the whole thing is to plot lat and long coordinates into global mapper cutomized app through Labview.I mean I am acquiring data in labview, but i want to display the coordinates in global mapper.For that what I have to do.I don,t have much idea abt MFC too.
    Solved!
    Go to Solution.

    Hello sets,
    I found some resources on the Global Mapper site that you may find helpful. They seemed to have the same questions as you, and an employee helped answer some questions.
    Global Mapper SDK for LabVIEW Software: http://www.globalmapperforum.com/forums/technical-support/8917-global-mapper-sdk-labview-software.ht...
    Global Mapper and LabVIEW: http://www.globalmapperforum.com/forums/sdk/9116-global-mapper-labview.html
    Are you using LabVIEW, LabWindows/CVI, or Measurement Studio? This is a Measurement Studio board, but if you have LabVIEW questions, I suggest posting to the LabVIEW board. (http://forums.ni.com/t5/LabVIEW/bd-p/170)
    Regards,
    Jason D
    Applications Engineer
    National Instruments

  • Global HotKey for Pause/Play,Next Song, etc.

    It would be nice to have an Global Hotkey so you can pause/play your music while browsing and not switching between screens. Or when you are gaming and you want another song but you don't want to alt tab and stay idle, a (customizable?)  Global Hotkey(i.g. ctrl+shift+right) would be such an great improvement in the usefulness of Spotify.

    Well, there is a simple solution to your inquiry if you use Mac OSX Lion. I suppose that you, just like me, don't want to cram your toolbar with extra icons and I also suppose that you use an external keyboard that lacks the playpause/next/previous buttons.
    Here's your 5-min solution :)
    Open up the Automator Application (Applications/Automator.app) 
    Create a new document (⌘N) and choose the "Service" type for your document.
    On the "Service receives selected" item in the top side of the window select "no input" from the dropdown.
    Search for "Run Applescript" from the searchbar on the left side of the window.
    Drag the "Run Applescript" item in the main window area.
    Delete the (* Your script goes here *) line and paste this instead:
    tell application "Spotify" to playpause
    Save your script (File > Save or ⌘S) and give it a meaningful name like Spotify PlayPause :D
    Go to System Preferences > Keyboard > Shortcuts and select Services from the left column.
    Scroll down to the General Section and find your Spotify PlayPause item.
    Click the add shortcut button and press the combination of keys that will be your shortcut. (eg. I gave it the ⌃⌘P shortcut).
    Test that it's working by clicking on System Preferences (next to the Apple Logo on top of your screen) > Services > Spotify Play Pause. (Actually this step is necessary for the shortcut to be registered to your system).
    You're done! Your shortcut is now available to you, in whichever program you have open.
    PS. In order to create a next or previous track shortcut, you should follow the above procedure, but on step 6 you input
    tell application "Spotify" to next track
    tell application "Spotify" to previous track
    respectively.
    If you have any questions feel free to ask :)

  • Printing labels (barcode, datamatrix code, ...) with LabView via Codesoft

    Hello together,
    could anyone post a sample vi which enables printing labels (barcodes, datamatrix code, ...) with LabView
    via the Teklynx Codesoft Runtime Software? There are no sample programs from Teklynx for LabView.
    Many Thanks for your help, Thomas.
    Message Edited by maximint on 01-04-2007 10:04 AM

    maximint wrote:
    Hi JLS,
    thanks for the answer. I agree with you that closing the references is the best und most stable solution. But it is really slow. I made an exe but this is also slow.
    But apart from this, the VI is running well, even with a handing over of variables. I guess this is one of the first VIs in the net which combines LV with
    Codesoft from Teklynx.
    Thanks, Thomas.
    PS: I made a wrong click on the rating of your last post. Sorry. I guess I rated it too bad.
    Well, this is easily solved with an intelligent global buffer VI or as they are also often called a LabVIEw 2 style global. I use them quite often for all kinds of reasons including to avoid globals in my programs almost 100% but this is one of the cases where they are also very handy.
    Basically you write a VI that has a while loop, and a case structure inside. The while loop normally only executes once. One or more uninitialized shift registers store different values that can be reused on each call to that VI. The case selector is wired to an enum (I make them always strict typedefed) on the front panel and that one is connected to the connector pane of the VI.
    Make the enum have init, print, close items and in the respective case frame do the opening of the refnum in the init case and anything else you need to do once at initialization time storing the refnum to the right shift register terminal. In the close case do everything to close done the software and then close the refnum coming from the right shift register terminal itself passing a Not A Refnum to the right shift register terminal. The print case uses the refnum from the right shift register terminal too, does all that is necessary to do printing and then stores the refnum back to the right shift register terminal. You now have an intelligent manager function for your interface to the printing software.
    The init case is called somewhere during initialization of your application while the close case is called somwehre when you close your application. A variant is to combine the init and print case but forst test for the refnum to be Not A Refnum (comparison palette) and in that case do the initialization first, otherwise just do the printing. The advantage with this is that the Codesoft interface is only initialized if you really need it.
    There is one caveat for this if you use dynamic top level VIs to implement for instance test steps or deamon like operation. LabVIEW remembers the top level VI under whom a refnum was opened and automatically closes refnums when that top level VI goes idle (stops running). So you would need to make sure that the initialization is done in the main hierarchy that is guaranteed to run for the entire time that your interface is required.
    I have included a small archive containing an API for Codesoft 7 that also supports variable query and substitution in templates. It is an older version of something I'm currently using and not very well tested as is, but the newer version is a lot more involved and complicated and not suited to be put here. I also included another archive showing a version of such an intelligent manager buffer function using that API.
    Rolf Kalbermatter

  • How to auto create a global variable with specific variable name in a global vi ?

    how to auto create a global variable with specific variable name in a global vi using lv ? Because i need to add a lot of global variable in this global vi. But you know, if  i manually add them , it will be a much time-costing work. So i want to use someway to auto generate ? Can i ?? Thanks a lot !

    Hi
    what aartjan is saying is the way for you. but you can develop an utility which will actually help you create global variables. To get the details on this just have a look at VI Scripting section on LAVA forum.
    But i would like you to suggest few things
    1. If your programs have so many global variables (Thats why u want utility) then you should take out some time to read about LabVIEW design patterns. I think if programmer follows these practicess he dont need a single global variable.
    2. Their are some other ways to achieve similar functionality as of global variables (Uninitialized Shift Registers, Single Element Qs and so on) but they are much faster than global variables.
    I am Attaching Whatever Resources i am having I will also attach the template of the design pattern i generaly use in short duration
    Message Edited by Tushar Jambhekar on 10-06-2005 07:33 PM
    Message Edited by Tushar Jambhekar on 10-06-2005 07:36 PM
    Tushar Jambhekar
    [email protected]
    Jambhekar Automation Solutions
    LabVIEW Consultancy, LabVIEW Training
    Rent a LabVIEW Developer, My Blog
    Attachments:
    LabVIEWDesignPatterns.zip ‏1505 KB
    Large_Code_Implementation.zip ‏522 KB
    Database Tests.zip ‏868 KB

  • OPC Server Connection not possible (with LabView 7.0 it is working)

    We have used LabView 7.0 to view OPC items on a remote server (Windows CE).
    On WindowsCE it's not possible to browse the remote registry, therefore we
    make the registry settings on the client Computer and are setting the
    "RemoteServerName". For LabView 7.0 it was working.
    With LabView 7.1 when we try the same with the sample "Browse to OPC Item.vi"
    we get the Message Box "NI Network Browser Error!" "This OPC Server does not support
    the interface: IOPCBrowseServerAddressSpace error code - 0x80070005 Access denied!"
    Has any one an idea what has changed since LabView 7.0.
    The OPC Server has also an OPCEnum running. Is there any way to read this information?
    Here are the whole registry setting for the local machine to connet to remot OPC-Server:
    REGEDIT4
    [HKEY_CLASSES_ROOT\AppID\{4841A238-5E78-48AB-A9ED-666AD68F4841}]
    @="Inficon Quadrupol Massenspektrometer DA"
    "AuthenticationLevel"=dword:00000000
    "RemoteServerName"="192.168.0.206"
    [HKEY_CLASSES_ROOT\Inficon.Quadrupol.Massenspektrometer.DA]
    @="Inficon Quadrupol Massenspektrometer DA"
    [HKEY_CLASSES_ROOT\Inficon.Quadrupol.Massenspektrometer.DA\CLSID]
    @="{4841A238-5E78-48AB-A9ED-666AD68F4841}"
    [HKEY_CLASSES_ROOT\Inficon.Quadrupol.Massenspektrometer.DA\OPC]
    [HKEY_CLASSES_ROOT\Inficon.Quadrupol.Massenspektrometer.DA\OPC\Vendor]
    @="Inficon"
    [HKEY_CLASSES_ROOT\CLSID\{4841A238-5E78-48AB-A9ED-666AD68F4841}]
    @="Inficon Quadrupol Massenspektrometer DA"
    "AppID"="{4841A238-5E78-48AB-A9ED-666AD68F4841}"
    [HKEY_CLASSES_ROOT\CLSID\{4841A238-5E78-48AB-A9ED-666AD68F4841}\Implemented Categories]
    [HKEY_CLASSES_ROOT\CLSID\{4841A238-5E78-48AB-A9ED-666AD68F4841}\Implemented Categories\{63D5F432-CFE4-11D1-B2C8-0060083BA1FB}]
    [HKEY_CLASSES_ROOT\CLSID\{4841A238-5E78-48AB-A9ED-666AD68F4841}\Implemented Categories\{CC603642-66D7-48F1-B69A-B625E73652D7}]
    [HKEY_CLASSES_ROOT\CLSID\{4841A238-5E78-48AB-A9ED-666AD68F4841}\ProgID]
    @="Inficon.Quadrupol.Massenspektrometer.DA"
    [HKEY_CLASSES_ROOT\CLSID\{4841A238-5E78-48AB-A9ED-666AD68F4841}\VersionIndependentProgID]
    @="Inficon.Quadrupol.Massenspektrometer.DA"
    Regards, Robert

    Hi Robert
    LabVIEW 7.1 implements some new security features dealing with DCOM that were not in 7.0. Windows is moving in this direction, and National Instruments decided to follow suit. 7.1 requires a certain level of authentication from the server. If this is the issue in your case, it can be resolved with the following steps (this is for Windows XP; CE will probably be different):
    1. On the computer hosting your OPC server select "Start >> Settings >> Control Panel >> Administrative Tools >> Component Services.
    2. On the tree on the left, expand "Component Services >> Computers >> My Computer >> DCOM Config.
    3. Your OPC server should be registered as one of these items. Right-click on your server and select "Properties."
    4. On the "General" tab, change the "Authentication Level" to "Connect."
    If this property is already set to Connect or Default (and the default setting is Connect) then this will have no effect.
    You can also try checking some of the other settings:
    1. On the computer hosting your OPC server select "Start >> Settings >> Control Panel >> Administrative Tools >> Component Services.
    2. On the tree on the left, expand "Component Services >> Computers >> My Computer
    3. Right-click on My Computer and select "Properties."
    4. On the "Default Properties" tab, make sure "Default Impersonation Level" is set to "Identify."
    You may also want to look at the "COM Security" tab to make sure your computer has the right permissions.
    If all else fails, you can try adding the line "ole.AuthnLevel = 1" to the LabVIEW.ini file. This should reverse some of the changes to 7.1.
    regards
    Manuel Wielander
    National Instruments

  • Trouble getting consistent voltage readings with LabVIEW using a 1102/B

    Here's the situation:
    I have an optical sensor with reflector that I'm using these to determine the velocity of a rotating wheel. (actually it's a spool of cable)
    no beam reflection = 0 Vdc (actually it's floating from 0 - 2 volts)
    beam reflection = 10Vdc
    This is hooked up to an 1102/B channel configured for reading voltage in MAX
    Now, everything is fine at slower speeds.  The trouble is when the velocity increases...
    I'm using a DAQmx read VI in LV 7.1 to read the virtual channel I set.  It's in a while loop, outputting to a chart.
    The reads are missing reflections at higher speeds, but only seems to happen in LabVIEW.  The cable needs to be letting out at 2 ft/sec.
    Now, the sensor has an indicator light that says when it's seeing the reflected beam.  When I spin the wheel by hand (faster than the necessary speed) the sensor says it's picking up the reflectors (2 at 180 deg apart).  When I open MAX, and the test panel for that channel, I see that I have to increase the "sampes to read" to about 5k and the "rate" to 5kHz.   At that point, MAX  sees every beam reflection as well.
    Within LV, it still misses...  even with the loop delay set to 5ms.   I'm hesitant to go much lower with the delay... 
    The final destination for this reading function will be in a fairly large VI with a lot of serial communication to external instruments.
    Anyone have any advice?
    Thanks!
    Chuck

    Hi Chuck,
    Looks like you are configuring a DAQmx task/global channel
    My suggestion would be why not use any continous voltage read examples you will find in the examples shipped with LabVIEW?
    Go to examples>>Hardware input output>>DAQmx>>Analog measurements>>Voltage in this folder find and use the example VI cont-acq-volt-int-clk.VI ( named something like that ) read its documentation to know how to use it
    Or find the VI here
    any doubts, do get back

  • Open and close multisim contact with LabVIEW

    Can I open and close multisim contact with labview and read the receptor estatus (p.e. lamp)?
    Thanks.
    Attachments:
    Dibujo.JPG ‏13 KB

    Hi Guddan,
    I created a RFC having a query which is taking a long time to execute. So i want to close RFC connection with portals which is via java connector(JCO) before that query and open the connction again after that query.
    I guess i will need to understand your requirement a little more in detail, as i understand you have an RFC which has a query within to fetch some data and is taking a long time to do so. In the meantime you don't want to keep the connection open?
    My question would be, Is the role of this RFC to only execute the query and fetch the data or does it do something else?
    If it does other things and these are independent of the query execution, then you can span a parallel call within the RFC to execute the query and in the meantime the RFC does the other things (or vice versa) hence reducing the overall time taken.
    If the sole purpose of this RFC is to execute the query, then you will not be able(i mean to say there is no simple and direct way of doing this) to close the connection after the Query is started and re-establish the connection after its execution, for a simple reason that - how will you know if the query has completed it's execution, so that you can establish the connection back.
    Alternate solutions, make this a two way asynchronous call, 1) You invoke the RFC asynchronously and close the connection, the RFC in turn will execute the query and transfer the data to JCO via another RFC call.
    If this needs to be a synchronous call, then you will need to optimize the query to its best.
    Regards,
    Chen

  • Lost ActiveX connection with LabVIEW server

    I have called LabVIEW in TestStand and tried to execute the test cases .
    While executing I got the following error:  ( Lost ActiveX connection with LabVIEW server.
    The LabVIEW adapter will try to reconnect on the next execution attempt.-18001; An error occurred accessing the LabVIEW ActiveX automation server.).

    Same error.  Is anyone from NI going to bother commenting on this?  It's been >8 months...

  • Registering a Partner application with Oracle SSO 10gR2

    Hi Everybody
    I'd like to ask a question around registering a partner application with Oracle SSO.
    I have entered my home_url, logout_url and cancel_url e.g. home_url is https://vevopuitest1.co.uk/vevo_test1 and so on for the other fields.
    When I save the details some information is automatically created e.g. Site Id, Site Token etc.
    The bit that I am particularly interested in are the fields Single Sign-On URL and Single Sign-Off URL.
    For my purposes these fields are respectively: https://cwassotest1.co.uk/pls/orasso/orasso.wwsso_app_admin.ls_login and https://cwassotest1.co.uk/pls/orasso/orasso.wwsso_app_admin.ls_logout
    My questions are:
    1. Where do these values come from?
    2. Can I view them anywhere, say, in Oracle Directory Manager or using ldif queries?
    I would like to be able to verify these values.
    Many Thanks
    Andy

    I'm afraid this won't answer your question completely, but AFAIK in principle it does not matter on which machine SSO is running, as long as it passes the user id and credentials properly through the HTTP Header. Even more: in practice it is very common to have SSO running on a different machine than where your app runs.
    So what I would do is find out how to use ADF Faces with SSO. Perhaps someone else can provide pointers on that.
    Jan Kettenis

  • How can I create a scene and move 3D models in INSIGHT with Labview?

    Hi!
    I need some help in doing a LabView application. What i have to do is controlling a 3D model represented in Insight with Labview. Something similar like the six-axis-robot example. I follow the insight configuration wizard, but nothing moves. Comparing the ".cis" files in my program and the one from the six-axis-robot, i found that in the six-axis-robot file contains something called localsystem and the one made by me, doesn't. Can be this the problem? How can I make it work? I would need some kind of step-by-step response, because i'am a beginner with Insight and 3D models. Thanks in advance!
    Regards!
    Juan

    Thanks for the advice!
    I'm actually finding the next problem. Although in my VRML file the objects are defined separately in a jerarchy tree, I can't move(rotate, translate) each object individually. I have noticed that when i define a new local system and asign it the points of the object i want move in the way you explain (right click, and then dragging the points to the new local axis), the movement of this object is dependent of the other local systems i have defined for other objects , specially if the slave  nodes of the .cis file has a lower numeration than the object i want to move. The fact is, the movements assigned , for example to the nodes 1 to 100, will affect to the rest of the nodes if i also define for the rest of the nodes other movements. How can i solve this? I send you my .cis file, just in case my explanation is not enough clear. In this file you can see that movements assigned to nodes 1 to 4078, will also affect to nodes 4079 to 7168, and what i would like to do is define a movement for each obeject independently.
    Thanks again!
    Attachments:
    ring.zip ‏2 KB

  • Excel with Labview 6?

    I'm trying to get Excel '97 to work with Labview 6.02, but I'm always receiving error message: -2147319784: "old format or invalid type library". I modified windows registry as told in LV knowledgebase. After that I could see Excel components in ActiveX pull down menus. I have tried to run demos such as "Open Excel And Make visible.vi" but they always output the error message. I have tried this with both Windows 2000 and NT. Other programmes, for instance MS Access, seem to work fine. What is the catch?

    Anders,
    You have run into a special case of the problem that actually has a work around for it. However, you will have to contact LabVIEW technical support to obtain the temporary fix since they need to keep track of all the people with this special case.

  • I am using report generation toolkit 1.1 with Labview 7.0 and Office 2003 profession​al. The create new report VI opens Excel but throws error (-21471672​62- from automation open VI) when I try to open MS word. please help...

    I am using report generation toolkit 1.1 with Labview 7.0 and Office 2003 professional. The create new report VI opens Excel but throws error (-2147167262- from automation open VI) when I try to open MS word. please help...

    Hi Leo22,
    Does this error occur if you use any of the example programs that come shipped with LabVIEW? I would try opening one of the examples that write data to Word and see if those give you an error. Also, have you tried just putting down a New Report.VI and change the report type to Word? If this simple vi (that's all you need to open Word) breaks, I would check to see if there are any instances of Word still open. Check the task manager to see if any word processes are still open. There should not be a problem accessing Word 2003 from LabVIEW 7.0. If neither of these solutions work, please give some more detail about your application and we can research further. Thanks!
    Jeremy L.
    National Instruments
    Jeremy L.
    National Instruments

  • Calling a VI which uses "system exec.vi" with LabVIEW run-time engine as adapter

    Hi,
    My TestStand sequence calls a VI which includes a call to "system exec.vi". When I try to load it in TestStand and if LabVIEW adapter is set to run-time engine, I get an error message "Unable to load Vi...". If I switch the adapter to "Development system", then it works fine.
    Is there any way to use "system exec.vi" in a VI which is called in TestStand with LabVIEW run-time ?
    Thanks,
    Alex
    Solved!
    Go to Solution.

    Hi Alex,
    In you case, you are getting a -18002 error.
    The reason is explained in the following link:
    -18002 Errors in TestStand
    http://digital.ni.com/public.nsf/allkb/D82FEAF0B4BA293A862575710053E252?OpenDocument
    Please have a look at the 2nd reason. This is your case.
    Hope it helps,
    Regrads
    Julien De Freitas / Applications Engineer / Certified LabVIEW Developer (CLD)
    National Instruments Switzerland

Maybe you are looking for