LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Communicating Labview 8 with PIC via USB

Hi all.
 
I've been using the USB to comunicate a PIC controller with my laptop. But to the date, I'm using c# with the mpusbapi.dll.
 
Now my intention is to switch between the C# and Labview 8. But I've never programmed many lines in labview and never used a .dll file, so, I'm not really awarness to what I'm getting into...
 
I would appreciate a help and a lot of patience.
 
Thanks in advance,
Marco.
0 Kudos
Message 1 of 10
(6,455 Views)
Not to worry, labview can integrate your c# code using the .net functions.  These functions allow you to construct an instance of your class and get/set properties and call methods just as you would do in c#, then you can use teh data in labview.
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 10
(6,444 Views)
Fine, just great.
 
and to do so, I need c# installed?
 
Could you indicate me some link or application note where I could start from. Have in consideration that I've never done such thing in labview.
 
Thanks.
0 Kudos
Message 3 of 10
(6,433 Views)

Can anyone give a tip or suggestion? One doc or link where I could start wrote c# into labview 8?

And is it essential, that I have c# installed?

 

Thanks.

0 Kudos
Message 4 of 10
(6,398 Views)

Hi marcoadf,

You can find a usefull example of using c# ith LabView :

find exemple >> .net >> calculator.vi

You just need to have a .net framework installed on your computer.

regards,

BRAUD Jean-Philippe
Field Sales Engineer - Nord et Centre France
LabVIEW Certified Developper
0 Kudos
Message 5 of 10
(6,371 Views)
C# is the language in which (one of many .net languages) you can code a .net assembly, so to write a c# assembly you need a c# compilier/IDE such as visual studio, BUT you dont need these environments to call a .net object that was written in c# from labview.  You do need the .net environment installed on your machine as well as the assembly/dll you wish to call, most windows (2000, XP) probably have this already. 
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 6 of 10
(6,353 Views)
Hi.
 
Thank you both for your help.
 
falkpl, I wasn't able to understand completely what you've said. What I understood was, that if I write code in labview I do need visual studio .net, is that right? But if that code is already wrote and compile I just need the assembly/dll that might come in windows, is that?
 
But when I make the exe file of my project, then I will never need to worry about right?
0 Kudos
Message 7 of 10
(6,344 Views)

All I was saying is that you dont need a c# development environment if your c# code is already a .net dll/assembly (these assemblies are language independent), you can call this from labview using the .net tools.  If you make an executable you should make sure that the distributed code also installs the dll needed (I dont know if this is automatic in the application builder)

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 8 of 10
(6,339 Views)
And to give you some more options to think about, you can call the usb dll directly with the Call Library Function Node. There is a shipping document called "Using External Code with LabVIEW" that explains this. Just open the LabVIEW Bookshelf from the help menu. Your otheroption is that you might be able to use VISA to communicate directly with the USB device. There's plenty of links but one that will help you get started with VISA and USB is http://zone.ni.com/devzone/conceptd.nsf/webmain/6792bab18242082786256dd7006b6416?OpenDocument.
0 Kudos
Message 9 of 10
(6,333 Views)
Hi.
I'm trying to use the calculator .vi as (jp_Braud mentioned) to see if it is suitable for my application. But I'm not understand the Constructor Node. From context help, it creates .net object. But it only open .dll and .exe files. I'm trying to open the mpusbapi.dll that I mention above. But I'm not having any luck. It was supposed to "see" wich methods the .dll file has inside right?
 
One other question, should I try also the examples in the "Coomunicating with External Applications" -> "using external code" -> "integrating DLL",  inspite of ".NET"?
 
To avoid confusing what I want, I have code developed in c# wich includes the mpusbapi.dll. In the code developed I call methods inside the DLL.
 
Thanks.
0 Kudos
Message 10 of 10
(6,259 Views)