LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB Device, C++ API, how to I/O into Labview

Hi:

Thanks in advance for your help. I am REALLY need some guidance.

I am tasked with bringing device control & data from our USB device into Labview. This is, um, *interesting* because I am basically clueless about Labview. I laid eyes on the v7.0 eval copy today for the first time. I have been studying the manuals, the website, and these forums to get familiar.

To start with, what I have today is a C++ API for controlling our device. Once configured, the C++ API object delivers continuous data asynchronously to the owner using Windows messages.

First, I gather that using the DLL external code method to get to my API functions will not work for the async data that I want to capture. Is this correct? Or is
there a way to catch windows messages or supply a callback to external code? Would a CIN be able to do this?

If the above is true: then I could wrap my API into a COM object and set up an event handler in Labview. [ The example code for this is very hard for me to follow. I'm "challenged" by the visual nature of Labview.. ] Also, I am concerned about the performance of that approach.

Also, using our API, it is possible to configure it to pump the continuous data out a windows "named pipe." However, I noticed another post out there lamenting the fact that there is no VI for windows named pipes. Is that correct?

Third: How does any of this relate to creating a device driver? I imagine that a driver could/would just bypass the API DLL and read/write straight into our windows USB device driver (although I haven't seen any examples of such).

Does anyone have any thoughts on these questions? What would you do?
Or
Does anyone see that I am missing something important
here?

Sorry for the mile-long post.

Thank you VERY much-

Suz.
0 Kudos
Message 1 of 3
(3,517 Views)
I believe you are on the right track. I'm currently working on a Labview USB project myself. We created a DLL in C++ to comunicate with our device. We use this DLL in a variety of different engineering USB tools. The DLL has all the functions to enumerate, open, read and close our particular device. We created a VI for each function. The VI has at its core a CIN that communicates to the various functions for our DLL.

Labview 7 is supposed to make USB comm easier through VISA, but I don't have a clue as to how it works. I still think you need to talk to the device driver in some way. I would love to see some examples.
0 Kudos
Message 2 of 3
(3,517 Views)
MarkAPC wrote:
> I believe you are on the right track. I'm currently working on a
> Labview USB project myself. We created a DLL in C++ to comunicate
> with our device. We use this DLL in a variety of different
> engineering USB tools. The DLL has all the functions to enumerate,
> open, read and close our particular device. We created a VI for each
> function. The VI has at its core a CIN that communicates to the
> various functions for our DLL.
>
> Labview 7 is supposed to make USB comm easier through VISA, but I
> don't have a clue as to how it works. I still think you need to talk
> to the device driver in some way. I would love to see some examples.

USB with VISA is similar to this TCP example

http://sine.ni.com/apps/we/niepd_web_displa
y.DISPLAY_EPD4?p_guid=B123AE0CB98F111EE034080020E74861&p_node=DZ52059&p_submitted=N&p_rank=&p_answer=&p_source=External

The VISA manual explains in more detail what strings to cast to a VISA
reference number.
0 Kudos
Message 3 of 3
(3,517 Views)