ā06-05-2009 01:53 PM
Hi all,
I want to communicate with a CP2102 (Silicon Labs). I am trying to use the example RAW VI included in LabVIEW 6.8, but have not had much success. LabVIEW does recognize the device. In fact, if I use VISA interactive control I can get the device name, etc. But I have no clue what I should be writing/reading and in what order to the device. I have asked Si Labs for some help, but no luck with this aspect. Has anyone done this before? Any codes/examples would be greatly appreciated.
Thanks.
ā06-05-2009 02:07 PM
Communication with USB RAW devices is device-specific, so the information can only come from the manufacturer. Do they provide a DLL, perchance?
I took a quick peek at the datasheet, and according to the datasheet, Silicon Labs provides a Virtual COM Port Driver for that device so that it will appear to the PC as a COM port. This should make it much easier to program. I would suggest following up with Silicon Labs or searching their web site for that driver.
ā06-05-2009 02:11 PM
They do provide a DLL, but I have no idea how to use it.
I do have the Virtual COM Port Driver installed and noticed I can get the device to show up as a COM port. Does this mean I can use serial programming? We already have a serail program written in C, but I cannot communicate with the device. What would be my next steps if I used the virtual COM port driver? How do I determine what to send?
I am quite new at this stuff, so I am sorry in advance if I am missing something simple.
ā06-05-2009 08:17 PM
The only answer I can give you is how to generally use a DLL in LabVIEW. This is done with the Call Library Function Node function. There is an example that ships with LabVIEW called "Call DLL" that has many examples of various types of calls. There are also several articles in the NI KnowledgeBase on calling external code with LabVIEW. I cannot answer how to use their DLL, as you would need to look at the documentation for their DLL.
As for the VCOM driver, yes, it would mean that you could use serial programming. You would need to look at the documentation that the manufacturer provides as to what to send.
Do you have any of this documentation?
ā06-07-2009 04:27 AM
Redseal94 wrote:They do provide a DLL, but I have no idea how to use it.
I do have the Virtual COM Port Driver installed and noticed I can get the device to show up as a COM port. Does this mean I can use serial programming? We already have a serail program written in C, but I cannot communicate with the device. What would be my next steps if I used the virtual COM port driver? How do I determine what to send?
I am quite new at this stuff, so I am sorry in advance if I am missing something simple.
Well calling a DLL from LabVIEW will require you to use the Call Library Node, have a fairly good understanding of the DLL API you want to call and last but not least a good basic understanding of C programming and especially C datatypes and such is IMHO really essential.
As to how to communicate over the COM port with a device? Using the VISA functions in LabVIEW you send strings and receive some other strings. What strings that are depend entirely on the device.The Silicon Labs chip is simply the USB to Uart converter and the commands to send will depend on the device that is connected through its serial port to that chip.
Rolf Kalbermatter