Can I programmat​ically control USB with LabVIEW?

I have a requirement to test a USB device. The test includes powering several of the devices off and on, i.e., power cycling for several hours. My plan is to accomplish by using a USB hub, breaking out the power circuit and running it through a relay inside of a DAQ. A neater solution would be to programmatically turn the USB device off and on. I know that the computer communicates with the device under test via USB and not the USB port itself. So I’m wondering if it’s possible with LabVIEW to accomplish this.
Thank you.

I'm not exactly sure what Eric was referring to as far as ActiveX. If it's with respect to the operating system, you're not going to find any ActiveX interface with the OS to do this. Unless he was referring to software programmability of the hub? Don't know.
With respect to power-cycling, a USB port can be disabled using OS calls. Thus, if you want to just turn off the whole hub you can disable the USB port that the hub is connected to. On Windows you can use a command-line utility called devcon to do this (search the forum as this has been mentioned before). The limitation is that devcon is not redistributable. This means that you cannot include it if you're giving this software to a customer. If, on the other hand you need to selective turn off the ports on the hub (i.e., to test individual devices), then you'd have to go back to the manufacturer of the hub and find out if they have a software interface to do this. Otherwise, it's the external power on/off approach via a relay or via a regulator as suggested by SnowMule.
EDIT: Additional caveat: devcon may not work under Windows 7. You did not indicate what operating system you're using. However, the OS calls that devcon makes are still there.

Similar Messages

  • Comiucation computer usb with labview

    Hi
    I want to communicate us computer with labviwe but I don't know how can I do it?
    Can you tell me please how can I communicate between computer usb and labview?
    Thanks you .

    The USB interface on the pcb has to be implemented by something. Do you have a microcontroller, or something like that? If you don't know much about USB communication, then this will be very difficult for you. In addition to the KB article I mentioned before, it would be worth your time to read this nugget: http://forums.ni.com/ni/board/message?board.id=170&thread.id=340676.
    If you haven't implemented anything yet in hardware, you may want to consider chips like those sold by FTDI which can provide a virtual COM (serial) port interface for applications via their drivers.

  • Can i control a digital photocamera trough the USB with Labview

    i want to control my digital photocamera with labview, so that i can take a picture on a labview command.

    NeoVista (www.nvsi.com.au) has an excellent toolkit for controlling Kodak digital cameras - maybe they could help?
    Copyright © 2004-2015 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 2.5 License.

  • Problem with programmat​ically control histogram color

    Hi,
    I'm developing a function to display multiple channel histogram. But I can not programmatically control the color. I use XY graph to display, and there's no problem with other type of plots.
    Attached is the example vi I use for the test. Please tell me if I make any mistakes.
    Inhaler
    Attachments:
    histogram_colortest.vi ‏38 KB

    instead of using plot.color, use the fill/point color.
    -Joe

  • Can you programmat​ically change a picture control frame/bord​er

    In a platform neutral manner can I programmatically change a picture control frame/border
    Solved!
    Go to Solution.

    You can make it look that way using many differnt methods.
    The simplest is to make the border transparent and put a boolean behind the picture. Size the boolean so it looks like it is the border of the picture. Change the color of the boolean and you are on you way.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Ant+ USB with LabVIEW

    Hello. Has anyone attempted to read sensor info via Ant+ USB into LabVIEW? I have some code that sort of works... regardless of whether I use the Dynastream provided driver or create a VISA driver using VISA Driver Wizard, I get the following errors in the LabVIEW VI "VISA Open":
    "The specified VISA resource is not a USB device"
    "Error -1073807346 occurred at VISA Open. Possible reasons: The given session or object reference is invalid."
    I've tried using both "VISA Defaults" and "Load Configured Settings" for the "access mode" of the resource.
    Any insight would be appreciated. LabVIEW code is attached. The main program is "Ahad_Vectorfinalpstruct_JFA" in JFA_Mod\Jamie.
    Thanks,
    -Jamie
    Solved!
    Go to Solution.
    Attachments:
    JFA_Mod.zip ‏151 KB

    Hi jfalesi,
    This is Roel in Applications Engineering at NI. Some more information about your project might be helpful in assisting you. Are you able to see the device in NI Measurement and Automation Explorer (MAX)? If so, have you done a self-test? If yes to this also, try using the VISA test panels to interactively communicate with your task. Before troubleshooting code, it is best to follow these steps to ensure that the computer can indeed communicate with the resource.
    Best of luck!
    Best Regards,
    Roel F.
    Applications Engineer
    National Instruments

  • How can I programmat​ically detect transition times in a digital waveform

    Hi, I have a digital waveform and at certain times I have transistions and glinches , how can I programmatically detect and record the time stamps of the transitions
    Thanks  

    Let me see if I understand you. You are reading 14 bits in parallel and you want to know how long between transitions of just one of those bits - say bit 11. Is this bit number constant or can the number of the bit in which you are interested change?
    Well, you could XOR the value from each read of the digital bits with the 14 bits you got from the previous read. If the resulting value of bit 11 is true, the state of bit 11 has changed. Use that flag to read/restart an interval timer. Of course the resolution of your measurement will be dependent upon the rate at which you are reading the 14 bit input. If you are only sampling the 14 bits every 500 msec, you obviously won't be able to measure intervals of less than 1/2 sec.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Can I use any acquistion card with Labview?

    I have got a non NI acquistion card, how can I use LabVIEW to program it?

    > But are all the software drivers provided by vendors recognized by
    > LabVIEW? In other terms, must these drivers get a satandard
    > architecture or protocol so LabVIEW can communicate with them? Or, if
    > I develop my own acquisition card, how can I write it's driver so
    > LabVIEW can communicate with it?
    The LV drivers for various NI products are essentially VIs that call
    into a user level DLL. That DLL does its work and returns the results
    and/or error info to the diagram.
    If the board has a DLL that allows it to work, then you can make quick
    wrapper VIs to make it fit the LV language a bit better.
    There are no architectures or protocols for drivers to replace NI-DAQ or
    other NI driver wrappers.
    Greg McKaskle

  • Can i genarate a VHDL skript with Labview?

    Hi,
    is it possible to genarate an VHDL skrit or .dat like
    name.vhd
    with Labview?
    mabye that i can write the code with Labview and save it as .vhd
    on this way it is very easy to use Labview as VHDL-software. is it possible to do this?
    thx

    I think it is not possible at this time.
    At my opinion NI is forced for releasing a tool that can do this in the future because there is software from the mathworks who can do this; 'Generating VHDL code for target independent hardware'.
    Magic Google words:
    http://www.google.be/search?hl=nl&q=%27Generating+​VHDL+code+for+target+independent+hardware&meta=

  • How can i change video into pictures with labview

    hallo,i have video about 5 minutes and i want to change it into photos with labview,can you please help me?
    Solved!
    Go to Solution.

    Vision Assistant is part of the Vision Development Module and represents a Configuration Environment including Code Generation for Machine Vision Applications.
    Separeting Images in AVI files will lead into using some Low-Level VIs. However there are numerous examples for AVIs shipped with LabVIEW.
    Christian

  • How can I find the vanishing point with Labview?

    I am using a myRIO for developing a system for helping visually imapaired people in their navigation. I have already done the image processing of what is being aquired by the camera (edge detection and finding of straight lines).
    How can I fin the vanishing point from the two edges of a path in an image with LabVIEW? Is there any special function that I can use?
    Thank you!
    Solved!
    Go to Solution.

    The vanishing point is the intersect of two lines, right? 
    https://www.google.com/webhp?sourceid=chrome-insta​nt&ion=1&espv=2&ie=UTF-8#q=intersect%20point%20of%​...
    Machine Vision, Robotics, Embedded Systems, Surveillance
    www.movimed.com - Custom Imaging Solutions

  • Usb with labview

    First of all sorry for my English. I would like to use labview for comminication with microprocessor. Until now iI'm using visual basic for this, specifically HID, not DLL. Do you know how can I use HID in labview?
    Thank you very much

    Hello,
    which is exactly HID? Is that a set of functions for Visual Basic to program microcontroller?
    To get started about LabVIEW and USB communication, you can see the following link:
    http://digital.ni.com/public.nsf/websearch/42B604435E3F9604862565E20043CD30?OpenDocument
    Inside, there is another link to Using NI-VISA to control your USB device
    crisR

  • USB with LABVIEW / VISA

    Hi all,
    I am a beginner in Labview. I had to develop a small prototype to read data from RS232. With VISA's functions and labview examples, everything worked fine.
    Now I would like to interface some USB devices by using similar VISA's components. In order to acquire skills in USB programming, I would like to build a simple program which for instance would get information on a simple USB device (as a USB KEY, or a USB mouse...).
    I already succesfully created specific visa drivers with the drivers wizard, installed them, see them with MAX.
    I studied the LV examples USBRawControl.VI and USBRawBulkMain.VI. But I do not succeed in getting any results. I guess I enter the wrong parameters in the example. Can anyone explain me a bit more how it works ? Or give me a set of parameters to test the LV example and get any results ?
    Thanks a lot.
    Jérémy

    No, there is no international standard in order to get/receive data from a USB device. That's exactly the problem. How the vendor implements a USB serial adapter could be completely different than implementing a USB storage device.
    You would need to ask the vendor about the data transfer mechanism - i.e. bulk or control pipe. Bulk is probably the simplest since you can just use a VISA Write or VISA Read so you would need a list of the commands to send and how the received data is formatted. This is what I used and since we wrote the firmware for the USB device, it was fairly simple. Look at the shipping example called USB - RAW Control to see how much information you need to read/write with this mechanism. If you got this to work, you would still need information on how to translate the control buffer data. I've never had to formally request this but you misght want to search the forum for posts regarding USB RAW to see if you can find more information.
    If you are getting a commercial sensor, then it is very likely that they have a dll available that can be integrated into multiple programming environments. In most cases, this is a much better solution than trying to develop your own VISA driver.

  • How to use ELMO motion control device with LABVIEW

    Hi,
    I am
    new to LabVIEW withvery little controls
    experience (just now graduated).  I need to use LabVIEW, NI USB 6009( DAQ)
    and a Harmonica servo drive from Elmo to control a voice coil.  . What I
    am looking for is some general guidance to get me started; point me in
    the correct direction so I can get rolling.  I will be using a RS-232
    line between the Harmonica and the PC.
    I have generated a sine waveform to the NI USB 6009 from LABVIEW. I have to send this signal through the ELMO Harmonica 5/60 N to control a voice coil. I have
    been reading the Elmo SimpleIQ Software Manual and am  lost Kindly help me out. 
    Regards,
    Pawan 
    The software manual states using Interpreter Language or User
    Programming Language.  Both of the languages seem to resemble what I
    remember of C++, sort of.  The document explains "while" and "for"
    loops, etc.; however, my understanding is that I should be able to use
    LabVIEW to accomplish such tasks and then just ask LabVIEW to output a
    command to the Bassoon to control my voice coil.  My best guess is that
    I use the "System Commands" to output commands to the Bassoon although
    the software manual also mentions compiling code similar to that of
    standard programming modes.
    Please help me out.
    Thanks        

    Continued here.
    LabVIEW Champion . Do more with less code and in less time .

  • Can I programmatically change my USB Dev assignment?

    I have a production test program that uses two USB 6501 DAQs. Currently during development they're assigned Dev1 and Dev2 in MAX and my DAQmx drivers are set up for those addresses. This test fixture, when deployed, will be connected and disconnected from the production equipment, and other USB devices may be plugged into and unplugged from the production test computer in the interim, then these will be plugged in again when it's time to test this product, and the Dev assignments are likely to be different from Dev1 and Dev2. I know I can change them in MAX, but that's not practical. I want this problem and a solution to be transparent to the people using the test program, and I'd like to reassign or change Devs programmatically. Is this possible? If so, how?

    System Configuration VIs will allow you to chance MAX device names
    But...
    I had a similar problem with 25 identical test sets each with 6 USB power supplies. Power supplies are swapped out for calibration just about weekly. The identifiers in MAX needed to be changed each time based off of their serial number.
    Years ago I attempted to modify the setting in MAX and had some success using the now deprecated “MAX Copy Configuration” VI, but opted instead to query the test set to find the power supplies and what their references names where and store the device names. Then the program could care less what MAX had for their device names. There was some extra code to figure out which supply was which (1-6) that depends on how YOU are using your devices.
    We have adopted a similar methodology for other test sets for ALL our instrument device references (VISA, DAQmx, GPIB, USB, PXI, LXI). Find what’s there and use whatever name MAX has for and not try to change it.
    See the
    System Configuration VI
    GPIB Find listeners
    VISA Find Resource
    niModInst
    Depending on the system, I use some combination these to find my instruments.
    I also use Mico Soft’s DevCon function to find devices on my test sets.
    Omar

Maybe you are looking for

  • How to search for files using wildcards * and ?.

    Hi All, I've been searching the forum for a couple of hours now and have been unable to find a good example of how to search a directory (Windows OS) for a file using wildcards * and/or ?. Does anyone out there have a good example that they can share

  • Sender's email id in function module SO_DOCUMENT_SEND_API1

    Hi All, I am fetching the sender's email id dynamically from HR database and then trying to use it while sending email via FM SO_DOCUMENT_SEND_API1. But the email does not go. The FM is erroring out with return code 6. If I maintain email id in the u

  • Robohelp vs Webworks

    Hi All, I am the lone writer at a startup and I need to pick the online help tool. I showed my manager Webworks (she has no documentation background) and she thought it was very cool. Since then I have gone to the STC conference and learned that Webo

  • Windows 7 Ultimate (64) clean install on HDX9004TX

    A clean install on my HDX9004TX went virtually incident free with the following exceptions: Screen intermittently blanks for a few seconds and notice advises "Display driver stopped responding and has recovered". This initially happened with driver i

  • Exporting Mediasource Tracklist to

    Hey folks! I would like to review the tracklist from my Nomad Jukebox Zen Ztra in another app via export (MS Word, MS Excel). I seem to be unable to do so with the Mediasource application that came with the player. I thought to be slick and use the M