10-19-2009 04:26 AM
I developed a MCU based DAQ and control system that communicates with PC via COM port. My client would like to have a driver for LabView. Since I am not familiar with LV system, but I can program in C, so I would like to ask if I can develop the driver as a dll, and if is there any special requirements that I should know?
10-19-2009 05:07 AM - edited 10-19-2009 05:08 AM
Once you are done with your VI's functionality & testing it thoroughly, you can develop a driver in LV by building the VI as a DLL.
In your Project Explorer, if you rt-click Build Specifications, you can see many options under New >> EXE/DLL/Zip... Use the DLL option to create a LV driver out of your VI.
Also, read this article about LV Project Explorer.
10-19-2009 05:44 AM
From my point of view an awkward solution, but it is doable. Just a tip. Keep the return types and input very simple. Do not use structures but simple types like arrays,numbers, and strings.
10-19-2009 06:15 AM
I guess you create a dll with a C SDK...
Yes you can build a "LabVIEW driver" using your C-dll. LabVIEW offers a "Call Library Function Node" element:
You can configure the node with this dialogue and add, remove parameters. I think your client needs a set of VIs each one calling a certain C function (Init, Status, Read, Write). I never tried to handle events.
Yours RZM
10-19-2009 06:19 AM
Coq Rouge wrote:From my point of view an awkward solution, but it is doable.
Did you mean mine or in general the OP's query?
10-20-2009 09:31 AM
Hey Daodao,
For some more information about using the Call Library Funtion Node to call your .dll from LabVIEW, check out this NI Developer Zone: Tutorial.
10-20-2009 10:07 AM - edited 10-20-2009 10:10 AM
I'm thinking that learning enough LabVIEW to understand the requirements to develop a C based dll, then develop and test a LabVIEW wrapper is harder than looking at the serial examples in LabVIEW (he did say it communicates vi the COM port) and writing some vi's that encode/decode the necessary protocol. Since you developed the system I would presume that you are more than a little familiar with the protocol. Then the driver is in "Native" LabVIEW and changes won't require revisiting the dll. Developing the dll in LabVIEW seems like adding one extra, unnecessary step, unless the desire is to hide the Intellectual Property regarding communicating with the unit. The customer's request appeared to be for a LabVIEW driver, if it was for a dll to be used elsewhere that would be a different story.