LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB communication with LabVIEW

Colleagues,

I wasn't sure which board is the correct address for my post. I have a custom (home) made PIC based piece of hardware doing DAQ that needs to be contrled via USB. I have no experience with programming USB at all so I don't know where to begin learining from. I guess the first step is to identify the particular USB port, than to open session, write/read byte streams and close it - but don't know how to do this in LabVIEW.

I have search the Developer Zone but the articles I found are advanced for me and I cannot follow. Can somebody  help me with this? The PIC will do DAQ constantly and time-stamp it. My LV app needs to read from it a string of sampled values per channels. Upon certain circumstances I need to send to the PIC cmd for him to do DIO action via relays. So there is no formal serial protocol implemented, and unlike the COMs I don't know how to identify the USB part the PIC is connected to.

Thanks in advance,

 

0 Kudos
Message 1 of 9
(3,315 Views)

Hi golubovski,

 

Thanks for the post! 

 

Well the resource I always use for guidence is:

 

USB Instrument Control Tutorial

http://zone.ni.com/devzone/cda/tut/p/id/4478

 

As long as your using NI-VISA 3+ you can just use the VISA vi's in LabVIEW - just as you would for serial comms. There is an example in the tutorial but also in LabVIEW example finder. (Help>>Find Examples..). These VISA commands are Low level and would let you control what you send/read and when i.e. your own protocol. 

 

I hope this helps and please ask more questions, if have them!

 

Kind Regards, 

 

 

 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 2 of 9
(3,295 Views)

Hillman,

The link you point (http://zone.ni.com/devzone/cda/tut/p/id/4478) is dead! Anyway, I did try an browsed through the corresponding tutorials but could not follow the code. Can you compile a short tutorial - steps for accessing custom made USB device just to read/write? I am not familiar neither to the vocabulary used in associated links nor with the tutorials and the concept. For example, how do I identify the USB port to which my PIC board is connected - and how do I address it? Do I just open session, use "Control In.vi", Control Out.vi" and "Get Intr Data.vi" and close, or if I'm wrong, what are the appropriate VIs to use and in what way and interaction?

Thanks again,

0 Kudos
Message 3 of 9
(3,291 Views)

Hi,

 

I have done a similar thing recently. A good place to start on general USB stuff is Jan Axelson's book 'USB Complete'. I implemented a PIC based USB system but was not too impressed with the speed. I ended up using a FTDI USB chip connected by UART to the PIC. This is fantastic, easy to implement, cheap (£12 for a plug in dev module) and supported by a full set of VIs. This approach makes USB easy as pie, as you don't need to have a clue about what is actually going on with the USB part, it handles it all if you want it to.

 

Cheers,

 

Blue 

0 Kudos
Message 4 of 9
(3,277 Views)
That link is fine. In that link, you will learn how to identify your device and address it. You might also find this thread very helpful.
0 Kudos
Message 5 of 9
(3,268 Views)
I get a 404 error with that address too.  Even if I click the actual link in the NI Developer Zone.  Other links on the page work fine so maybe it's being serviced or upgraded.
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 6 of 9
(3,259 Views)
Weird. I checked the link before I posted and again, just now. Still no problem for me.
0 Kudos
Message 7 of 9
(3,256 Views)
Thanks guys, the link is OK now! It seems to answer my request. I'll have my PIC board ready this weekend and hopefully make progress.
0 Kudos
Message 8 of 9
(3,227 Views)

Hi golubovski,

 

Thanks for letting us know. Please let us know how you get on.

 

Kind Regards

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 9 of 9
(3,200 Views)