|
Prev: Converting gray code to binary/decimal when using port0
Next: Question about USB diver and user interface
From: Josv on 30 Dec 2005 18:41 Hello, I have trouble to communicate with a USB device thought call library function. My cypress chip is installed to the ezusb.sys driver and is be able to communicate with the ezusbsys.h file. (Have communicated with my device thought a CIN but the program shown not stable enough)? I have read trough some parts of the ?Using External Code in LabVIEW? which briefly describes how to act: ?Instructions on including a header file xbus.h. Although LabVIEW does not permit you to include such header files, you can open header files and extract information about function prototypes and constants.? Nothing that I have tried with have worked and hopping now that someone else has worked with something similar. Links, examples and tips are happily received. Best regards, Jonny
From: smercurio_fc on 30 Dec 2005 18:41 As the document points out, header files are useless in LabVIEW in terms of operation. Their only purpose to a LabVIEW programmer is information for the programmer. With LabVIEW you need a DLL or a CIN that you either get from the manufacturer of the device or that you create yourself. You mentioned having made a CIN but that it's not "stable enough". Can you elaborate? As for tips and examples, there's lots on the NI site. Just do a search: <a>http://search.ni.com/nisearch/nisearchservlet?nistype=default&ddown=0&filter=%2Btaxonomy:top+%2B(meta.collection:www+meta.collection:www2+meta.collection:psEn)+%2B(language:en+nilanguage:en+nilanguage:english)&cluster=true&q=calling+external+code+in+labview</a> <a href="http://search.ni.com/nisearch/nisearchservlet?nistype=default&ddown=3&cluster=true&filter=%2Btaxonomy:%22Developer+Zone%22&q=calling+external+code+in+labview" target="_blank"></a>
From: rolfk on 30 Dec 2005 18:41 Josv wrote:Hello, I have trouble to communicate with a USB device thought call library function. My cypress chip is installed to the ezusb.sys driver and is be able to communicate with the ezusbsys.h file. (Have communicated with my device thought a CIN but the program shown not stable enough)? I have read trough some parts of the ?Using External Code in LabVIEW? which briefly describes how to act: ?Instructions on including a header file xbus.h. Although LabVIEW does not permit you to include such header files, you can open header files and extract information about function prototypes and constants.? Nothing that I have tried with have worked and hopping now that someone else has worked with something similar. Links, examples and tips are happily received. Best regards, JonnyA *.sys file is a kernel device driver. LabVIEW can't directly link to a kernel device driver. You will need a so called user level DLL to talk to the kernel device driver. Such a user level DLL is usually provided by the developer of the kernel device driver as well. I really doubt that the ezusbsys.h file is all that is needed for an application to call this device driver. Typically a device driver is accessed by a series of calls to the Windows kernel API functions CreateFile(), ReadFile(), WriteFile(), DevIOCtrl() and CloseHandle() and these are put into a so called user level DLL by the device driver developer for convinience of the user. Rolf Kalbermatter
From: Josv on 31 Dec 2005 07:40 > You mentioned having made a CIN but that it's not "stable enough". Can you elaborate? See a previous message that I posted: <a href="http://forums.ni.com/ni/board/message?board.id=170&message.id=158491" target="_blank"> http://forums.ni.com/ni/board/message?board.id=170&message.id=158491</a> >I really doubt that the ezusbsys.h file is all that is needed for an application to call this device driver. From discussion with Cypress and with own programming on the CIN the ezusbsys.h is the only link towards the chip, unless you want to use there API. Thanks for your opinions... /Jonny
From: rolfk on 31 Dec 2005 09:40
Josv wrote: > You mentioned having made a CIN but that it's not "stable enough". Can you elaborate? See a previous message that I posted: <a href="http://forums.ni.com/ni/board/message?board.id=170&message.id=158491" target="_blank"> http://forums.ni.com/ni/board/message?board.id=170&message.id=158491</a> >I really doubt that the ezusbsys.h file is all that is needed for an application to call this device driver. From discussion with Cypress and with own programming on the CIN the ezusbsys.h is the only link towards the chip, unless you want to use there API. Thanks for your opinions... /JonnyWell as you say yourself "unless you want to use their API". This API is most probably the user level DLL I was talking about and calling that with the Call Library Node is probably a lot easier than trying to figure out how to call the device driver directly. As to the problems you have had with your CIN you obviously still made an error somewhere. Without the source code in question to review there is only wild guessing we can do as to where it might go wrong. That and pointing you to the links about what to watch out when interfacing external code in LabVIEW. But if you had a problem with the CIN I do not see how you think you can do better with trying to avoid the CIN, without using the API DLL from Cypress. The error you made in the CIN has a good chance to also appear in any other solution you come up with to interface to the device driver directly, and many more errors too. Rolf Kalbermatter |