0
votes

Hi I am fairly new to LabVIEW but I have been asked to write a plugin for LabVIEW to control some hardware devices. After some research I see LabVIEW uses .NET so I was wondering if it makes sense to create a wrapper in .NET or call the dll library through C/C++ wrapper.

  1. Has anyone experimented ?
  2. What are the advantages and disadvantages ?
  3. Why you decided to go with this ?

Thank you,

1
If the communication channel isn't something rather exotic then it can be done in C# just fine. - Öö Tiib
I am unclear on your question. Are you writing a driver in LabVIEW? Or do you have an existing driver and you're trying to call it from LabVIEW? - srm
Can you give some more detail on the devices: how will you need to communicate with them and what sort of data do you need to send and receive? The ideal solution would be to write your driver purely in LabVIEW, but you should be able to go via a dll if you can't afford the learning curve right now and/or you have existing code you want to reuse. - nekomatic
@srm I am writing a plugin for LabVIEW to talk to our customer's camera. I have access the API to control their camera through their sdk and I have the dll. - user1296153
You can call dll's directly from LabVIEW, but you might need to create some sort of intermediate wrapper if the dll tries to return its data in a way that's not LabVIEW compatible.If you can edit the question to describe that, you might get more help. - nekomatic

1 Answers

0
votes

First: have you checked to see if there's already a LabVIEW library available? This is a very common thing to do, so what I've learned is, there's always a good chance someone else has already done it and made it available. Second: I prefer whenever possible to write the drivers just using LabVIEW because, if you call the .dll, that's another thing you have to maintain. In my experience, even when it's the right choice for one reason or another, calling a .dll from LabVIEW always causes some hullabaloo down the line compared to communicating with the hardware directly from LabVIEW. What does the camera's manual say about its communication protocols?