10-21-2008 05:02 AM
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,
10-21-2008 07:42 AM
Hi golubovski,
Thanks for the post!
Well the resource I always use for guidence is:
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,
10-21-2008 08:07 AM
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,
10-21-2008 08:51 AM
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
10-21-2008 09:16 AM
10-21-2008 09:27 AM
10-21-2008 09:31 AM
10-21-2008 04:55 PM
10-22-2008 03:30 AM
Hi golubovski,
Thanks for letting us know. Please let us know how you get on.
Kind Regards