An api imported USB does not work correctly

Hello everyone,

I am currently using LabVIEW to communicate with a USB device and I had to import an api USB I bought. With VC ++ this api works well, but LabVIEW has its problems.

First of all, I imported through Tools > Import > Library (DLL), chose the DLL and the corresponding and any Headerfile which worked without problems. Now I got my 14 VI, one for each function declared in the DLL.

It is, most of these functions will not properly work, or maybe I just don't understand their right or give them the wrong settings. I will attach a screenshot of the 'GetList.vi', which should return a list of all connected USB devices.

My guess is that the defined pList could be a problem because it must contain the char, int etc but as you can see in the screenshot, contains only numbers.

Any help would be greatly appreciated!

Kind regards

Pedro

EDIT: Here's the description of the documentation of the api USB GetList method:

GetList)
This function searches the system for USB HID devices and generates a list of these devices and their availability.  The caller must provide a pointer to a buffer that will contain the list of entries of the structure.  Must also provide an integer representing the maximum number. entries may contain the buffer.  Returns the total number stored.

int CUsbHidApi::GetList)
unsigned int VendorID,
unsigned int ProductID,
char * manufacturer.
char * SerialNum,.
char * DeviceName,.
mdeviceList * pList.
(int nMaxDevices);

Description of the settings:

  VendorID / / Vendor ID search (0xffff if not used)
ProductID / / product ID of research (0xffff if not used)
Constructor / / manufacturer (NULL if not used)
SerialNum / / serial number to search for (NULL if not used)
DeviceName / / name of the search tool (NULL if not used)
pList / / table of the appellant for the storage devices
nMaxDevices / / size of the ArrayList to the appellant (no.entries)

smercurio_fc wrote:

When I posted response you has not yet posted any header file, so I did not see the header that you posted 2 minutes after my answer. In view of the header, you should be able to call these functions. However, the pList parameter is a pointer to a structure that contains variable length strings. This isn't something that you can easily manage, and such a question was discussed several times on this forum. When you get to this level of complexity in terms of parameter data types, you will need to write a wrapper DLL so that the types of data between LabVIEW and the DLL are simple data types only.

In fact the code created byt the library import wizard handles pointers of varying sizes correctly for an item in the structure, so nMaxDevices must never be placed in anything else but 1.

It is also not entirely clear if manufacturer, DeviceName and SerialNum always are inputs to the function or not, but I guess they are. A problem here is that the DLL function expects a NULL pointer if it must ignore the string parameter according and not only a string empty, so you will probably need to create call several nodes of the library with the configuration of the various parameters to ignore one or more of these settings.

The data type of mDeviceList which had been initially used by the library with a fixed size of embedded strings would have been a little bit more efficient to implement in LabVIEW but always a PITA too.

I can only recognize smercurios statement that this type of API is absolutely better managed with a wrapper DLL. While it is not impossible to do it entirely in LabVIEW, it is more than the import library Wizard can eventually handle automatically and doesn't require so some stunts of advanced in the LabVIEW diagram memory pointer that must be done manually. Something which is not really run by a person without some serious C programming knowledge, but this person is clearly going for the wrapper DLL solution because it is much easier to manage than to do everything in a LabVIEW diagram by hand.

Tags: NI Software

Similar Questions

  • Webcam USB 2.0 on my laptop with windows vista error device does not work correctly

    Original title:

    I just plugged a usb2.0 webcam on my laptop with windows vista. It is loaded ok, but the device manager says that the device does not work correctly. Any ideas please.

    I just got a webcam via ebay and plugged into my laptop. I'm working on windows vista. He finds and load device software right away, no problem. But I can't work. go into my device manager it tells me that the device does not work correctly. Any ideas please.

    Hi Matthew,

    The first thing I would try is to connect the webcam to another computer to make sure that the webcam is not defective.

    Now, check out these links and return to the State of the question.

    When hardware installed in or attached to a computer doesn't work properly, it is often because of a driver problem.

    Here are a few common problems with drivers and the means to solve them.

    See the following link for more information:

    Tips for solving common driver problems

    Also check out the following link and run the fixit available.

    Hardware devices do not work or are not detected in Windows

    The fixit diagnose and solve problems with the equipment. (USB) Keyboard and mouse are not detected by the Manager of devices or when they do not work.

  • my mouse on my laptop does not work correctly...

    the "clicker" on the laptop to put it technically, but not the touchpad. You must hold it down for a while and press really hard to make it work, I don't know if it's something that I can fix it or to replace. any suggestions to fix this would be appreciated!

    the "clicker" on the laptop to put it technically, but not the touchpad. You must hold it down for a while and press really hard to make it work, I don't know if it's something that I can fix it or to replace. any suggestions to fix this would be appreciated!

    Hello

    It looks like a hardware problem if the button does not work correctly. Until you can find a solution, you can use an external USB mouse.

    I recommend you contact the manufacturer of the computer for that matter.

    Concerning

  • My phone does not work correctly

    My phone Bluetooth, Wi - Fi and GPS connection does not work correctly. Bluetooth and wifi have the low range of connection and can barely connect what either. GPS won't work at all, so I can't use it for direction more.

    Take it to an Apple store for diagnosis.

  • I have an Apple computer, use the browsers Firefox and Safari, use Comcast for my email. Lately, when the Firefox, my email does not work correctly. Why?

    I have an Apple computer, use the browsers Safari and Firefox. I use Apple mail and Comcast to my email. Lately, in the case of Firefox, my email does not work correctly. I get a message "your server license has expired. While usually, I can access my emails, I can't delete the unwanted emails. This problem will not occur when I use Safari and Apple mail. Is this a problem of Firefox or Comcast? Do you know what license is expired?

    Hello

    Many issues of the site can be caused by corrupted cookies or cache. To try to solve these problems, the first step is to clear cookies and cache.
    Note: This will be you temporarily disconnect all sites, you're connected to.
    To clear the cache and cookies to do the following:

    1. Go to Firefox > history > clear recent history or (if no Firefox button is displayed) go to tools > clear recent history.
    2. Under "Time range to clear", select "all".
    3. Now, click the arrow next to details to toggle the active details list.
    4. In the list of details, see the Cache and Cookies and uncheck everything.
    5. Now click the clear now button.

    More information can be found in article to clear your cache, history, and other personal information in Firefox .

    This solve your problems? Please report to us!

    Thank you.

  • Satellite A300-1EH - windows installer does not work correctly

    Hello, this is my first post on this forum!

    My windows installer does not work correctly.
    What should do?

    Soryy, but I did not now much on computer systems.
    I have reinstall this installer?

    I'm waiting for your answers.

    > My windows installer does not work correctly.
    What do you mean exactly? You see a mistake? What exactly happens?
    Maybe your CD is scratched or damaged.

  • Config Free - Connectivity Doctor does not work correctly

    Hi all

    yesterday, I've updated the driver for my WIFI, with the driver found on the Toshiba support page. After installation, the Config Free utility does not work correctly. Indeed, the diagnosis of the doctor of connectivity us window briefly, just to replace it with the classic error message: cfmain.exe has encountered a problem and needs to close...

    The details are
    AppName: cfmain.exe AppVer: 5.0.0.119 ModName: venapi.dll
    ModVer: 5.0.0.3 Offset: 000034df

    Thank you very much for your support

    I found this:
    cfmain.exe - this is a component of the Toshiba network device. Network device Toshiba is Toshiba network device selector. For starters, this application requires a common Module of Toshiba ACPI and hotkey wireless.

    Well, because of this description that I recommend you to reinstall the common modules and wireless keyboard shortcut utility

  • my super USB does not work after last update OS EL Capitan

    my super USB does not work after last update os el capitan

    Hi viral_02,

    The resources below provides a few for the SuperDrive USB troubleshooting steps.  Click on the link to see all the possible symptoms and solutions, including resetting the system management controller.

    Get help with the SuperDrive slot on your Mac computer loading

    If the problem persists, Contact Apple or an provider of services authorized Apple, or make an appointment with an Apple Retail Store additional diagnosis, evaluation, or service.

    Take care

  • Signature "by the account" does not work correctly

    Features: iPhone 6 iOS available 9.2 41.1 GB

    I have configured and you can send from multiple e-mail accounts (6 including iCloud) on my iPhone.

    My problem: the signature "by the account" feature does not work correctly. I enable this feature, create distinct signatures, choose to send other than the default e-mail account. However, the default signature in the message, followed two copies of the signature on behalf of which I want to send the message below. I deleted and readded to each email account and of the signature, but find the same result.

    Having this problem as well, or very close.  I can't get the HTML signatures to work (IE, appear) when

    I sent mail from an account that has a.

    This question to a while back in older iOS and has been fixed, now it's back...

    I often crash parameters when you try to paste a HTML signature in place and when

    I have a y arrive, it does not show in the email project.  When I add a text character

    at the signing, he sometimes shows up.  Very erratic...

  • "cooling fan does not work correctly.

    Product name: HP Pavilion dv6 Notebook PC

    Product number: LZ801PA #ACJ

    Operating system: Windows 7 64-bit

    Erroe message:

    "The system has detected a cooling fan does not work correctly. . Continued operation is not recommended and can result in unpredictable behavior that may cause stop randomly, loss of data or damage the system as possible. The system will stop in 15 seconds. To prevent stop and continue the operation please press enter now. »

    OK, now, I cleaned compressed air fan can now issue is completely resolved and my laptop is like as it should. I ask to do something else?
    I mean I don't want my internal parts of the laptop to be defective.

    http://compareindia.in.com/specification/laptops/HP-Pavilion-dv66115tx-lz801pa/238232

    Try a hard reset as follows:

    (1) remove the battery and unplug the DC power adapter.
    (2) press and hold the power button for more than 15 seconds.
    (3) plug the DC power adapter (leave the battery for now)
    4) press the power button

    Please post here your positives or negatives in your thread.

    Best regards
    ERICO

  • I installed Windows XP on my new computer (with Windows 7 PRO), but my USB does not work on Windows XP. It works fine on Windows 7

    I installed Windows XP on my new computer (with Windows 7 PRO), but my USB does not work on Windows XP. It works fine on Windows 7.

    Hello

    And much more: (XP mode requires professional, Ultimate or Enterprise).

    Get all the benefits of Windows 7 and continue to take advantage of your investments and more
    business and productivity programs that require a PC running Windows XP.

    Note: Windows XP Mode requires a download.
    http://www.Microsoft.com/Windows/Windows-7/features/Windows-XP-mode.aspx

    Windows XP mode
    http://www.Microsoft.com/Windows/Virtual-PC/Download.aspx

    Windows XP Mode is supported through Technet

    TechNet - Forums - Windows 7 virtualization
    http://social.technet.Microsoft.com/forums/en/w7itprovirt/threads

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle=""><- mark="" twain="" said="" it="">

  • My Phlinxtogo game does not work correctly

    Original title: "C:\Program Files (x 86) \Pogo Games\Phlinx Go\PhlinxToGo.exe" __My Phlinxtogo game does not work correctly ".

    \Pogo Games\Phlinx to Go\PhlinxToGo.exe

    Hello
     
    1. what operating system is installed on your computer?
    2. What is the exact error message you get?
    3. what happens when you try to run the game?
    4. has been the work of game much earlier?
     
    There is currently no information on the compatibility of Phlinxtogo with Windows 7.
     
    However, you can perform two or three steps and check if it helps.
     
    Step 1:
     
    Once the Phlinxtogo game is downloaded, right click on the .exe file and run as administrator.
     
    Step 2:
     
    If this does not help, run the game in Windows compatibility mode and check.
     
    If none of the suggestions work, I'm afraid you must contact the manufacturer of game for a better support.

    Aziz Nadeem - Microsoft

    [If this post was helpful, please click the button "Vote as helpful" (green triangle). If it can help solve your problem, click on the button 'Propose as answer' or 'mark as answer '. [By proposing / marking a post as answer or useful you help others find the answer more quickly.]

  • Poloroid MP3 does not work correctly.

    Original title: connect a MP3 player to the poloroid mp3 files

    Sorry for the caps, my problem is I just got a Poloroid MP3 and it does not work correctly as no movement between the icons etc. Y at - it anykelp like a download or something I can put it on its feet again. Thank you very much

    Gary lumbard... e-mail * address email is removed from the privacy *.

    Hi Gary lumbard,.

    Thanks for posting your question in the Microsoft Community Forum.

    According to the information of Polaroid MP3 player does not work on your Windows XP computer.

    Since you are faced with the question with player MP3 of Polaroid, you can get in touch with ato Polaroid supported if verification updates is available for the player and for further assistance.

    Polaroid support

    Hope the helps of information.

    Let us know if you need help with Windows related issues. We will be happy to help you.

  • My gesture control function does not work correctly there on and off automatically

    My gesture control function does not work correctly there on and off automatically

    which application you are using? try reinstalling the media gallery.

  • spell check does not work correctly. It highlights each word

    my spell checker does not work correctly. When I send a message it highlightes, virtually every word and all are spelled corectly - help please

    You use Outlook Express when you see this? Office Word 2007 or 2010 is installed?

    You no longer have the correction spell checking capabilities in some languages in Outlook Express 6.0 after you install the Microsoft Office 2007 or Office 2010 system
    http://support.Microsoft.com/kb/932974

    Outlook Express cannot use the check spelling of MS Word in Office 2007 or newer. A free spell-checking the download is the easiest way to get around this.

    Vampirefo spell check.

    Download from Major Geeks:
    http://www.MajorGeeks.com/download.php?Det=2952

    Or upload it to SnapFile:
    http://www.SnapFiles.com/get/spelloe.html

    You wanted TinySpell or. (Check spelling while typing).

    Download it here:
    http://www.tinyspell.M6.NET/

    Australian English spell checking
    (Also suitable for other English speaking countries).
    http://www.justlocal.com.au/clients/oespellcheck/

    If you have an earlier version of Office, see this:
    http://www.Outlook-tips.NET/archives/2006/20061228.htm

Maybe you are looking for

  • I really don't like Firefox 4. Can I go back to the previous version please? I use a Macbook Pro.

    Please provide me a link so I can download the previous version.

  • PRS 950 frozen

    I downloaded a file PDF from Google Book Search. The guy was small and I did XL without any positive result. I then 'zoom', and as I tried to adjust it, it went from portrait to landscape and froze for about an hour. I can't turn off - it is just fro

  • Satellite A80-142 with Geforce Go 6600 there MXM?

    I am the owner of a Satellite A80-142 with a Geforce Go 6600 (128 MB) and I really want to know if its mounted directly on the card or if it is a MXM. I have already searched the web and found some Go 6600 cards which are MXMs.Can someone help me ple

  • Want 5530: Cartridge Incopatible

    My 5530 desire refuses to receive 61XL cartridges. They are suppsed to be compatible, but I get the message incompatible and can not get around.  Tried to reboot several times.   Is there a setting to change or something?

  • Messages do not automatically moved from the Outbox to the sent items

    Hello. Everything worked fine until 08:00 this morning. Now, when I send an email, it is sent but is not automatically moved from Outbox sent items. So, I get an error message (but no error code. He says only: "some errors occurred while processing t