From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

need help in interfacing in LabView

I have a C code for the Lab window, for the interfacing of the following hardware. I have to modify the code in LabView. 
The hardware list for the experiment is:
Scientific Instrument (SI)  Digital temperature controller Model 9650
Keithley 487 Picoammeter/Voltage Source Keithley 428 Current Amplifier
HP 8110A pulse generator (power for laser)
Tektronix TDS 544A Oscilloscope, 500 MHz, 1 GS/s
I am not a programmer just a physicist. I know there is way to use the external code option in LabView, but I really dont understand the terms. Please guide me in very simple way so that I can interface in Labview. Thanks in advance.
0 Kudos
Message 1 of 12
(3,020 Views)

Hi Aware,


I have a C code for the Lab window, for the interfacing of the following hardware. I have to modify the code in LabView. 
[snip]
I am not a programmer just a physicist. I know there is way to use the external code option in LabView, but I really dont understand the terms. Please guide me in very simple way so that I can interface in Labview. Thanks in advance.

(i think) You're requesting "very simple" instructions on how to accomplish a somewhat complex task! ... I mean, how would you respond to someone who asked: "Please guide me in very simple way so that I can build a microwave-oven?"? - Ok, maybe it's not that bad. Smiley Wink

From what you've described, you (or someone) should identify a set of "steps" - now performed in C - that need to be performed by LabVIEW ("steps" is my term).  What pieces of data are required-by and returned-by each "step"(?)  You may want to create new C-functions - one for each "step" - and "export" these new functions in a DLL to LabVIEW's "Call Library Function Node".  Possibly, most of your existing C source-code can be used without changing it.

You might start by learning how to write a simple C-function; then "export" it as part of a DLL; then use a LabVIEW CLF Node to run your DLL function!  There is much NI documentation on this subject. Smiley Wink

Cheers!

Message Edited by tbd on 04-01-2007 02:36 PM

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 2 of 12
(3,004 Views)
Thanks Mr /Miss TBD. I apapreciate your solution. These things are new for me. I a, doing PhD in Physiscs and knowing nothing about the computer abc. I'll try to do what you are suggesting. I am dead sure I 'll need further guidance doing this interfacing. Would you please help me if I need. y email is rubi786@yahoo.com. I dont know the rules in this website, but if possible send me just a line on this email so that I can contact you directly, if you dont mind.Thanks once again, I am starting from today under your guidance.
Bye
0 Kudos
Message 3 of 12
(2,992 Views)

Hi aware,

      I'm sorry, but email is not convenient for me!Smiley Sad  ... but you'll find much more help HERE anyway.  The best way to get an answer, is to ask a very specific question, supplying as much background-information as possible - attaching a picture or example code is encouraged.  I think contributors, here, are less patient with questions that reflect a lack of effort [by the poster] to answer they're own question.  It will help to become very familier with LabVIEWs HELP\"Find Examples" and the "search" tool at the top of this page. 

Cheers!

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 4 of 12
(2,982 Views)

Hi aware,

Like TBD I'm not sure I completely understand with what you are experiencing trouble.  If you are having difficulty with calling an external dll in LabVIEW, you may want to take a look at this example program that simply uses a call library function node to play a Windows sound.

If you are interested in converting LabWindows/CVI code into LabVIEW, you should be able to do this with little difficulty.  Most functions in LabWindows/CVI have the same or a very similar name as they do in LabVIEW.  Therefore, using the search function on the functions palette, you should be able to locate all the functions you need to convert your code.

Please do not hesitate to let me know if you have any further questions. 

Best of luck on your application, and have a great day!!

Regards,
Ching P.
DAQ and Academic Hardware R&D
National Instruments
0 Kudos
Message 5 of 12
(2,963 Views)
Hi Ching and TBD
I have attached the two files which I have. The interfacing program was written for LabWindows. One file is in .c and the second is for LabWindows. I need to make it work in LabView. I told I am just a begginer in programming, I dont understand from where to start. From reply of tbn, I have to start from c and make dll file and then iinport to LabView. From your reply I understand that I have to start from my second file (LabWindow) and convert the functions. Please guide me in a very simple way in small stpes as I have to learn every step in sequence.
I would really appreciate if you guide me as a teacher for a grad1 student.Smiley Sad
Thanks in advance.
Download All
0 Kudos
Message 6 of 12
(2,944 Views)
Hi Ching and tbd
Sorry I think I made an error in attchment of file. The extention for the file was basically .ex, but when it was forwarded to me, security server has changed it to .PRJ file. I am attaching the file once again. I am not which one will work.
Thanks
0 Kudos
Message 7 of 12
(2,940 Views)
Do I need differnt header and source files in LabView, than the one which are used in LabWindow onterfacing code? Same for the drivers, do I need to download other drivers for LAb View?
0 Kudos
Message 8 of 12
(2,936 Views)
The c file you attached is empty. What about the rest of the files? There should be a .h and .uir. Do you have access to LabWindows? If you do, then you can probably make a dll instead of an exe. Then you wouldn't need to translate the entire program to LabVIEW. If you did want to rewrite it, you may have to download different drivers. Both LabWindows and LabVIEW can use the same driver if it''s what 's called an IVI driver. Obviously, without the entire LabWindows project files, it's impossible to know what was used.
0 Kudos
Message 9 of 12
(2,926 Views)

Hi aware,

You can either use your LabWindows/CVI program and convert it into LabVIEW function by function, or you can just create a dll that you call in LabVIEW. 

If you would like to create a dll from you LabWindows/CVI program, please take a look at this document.  The link I provided in the previous post is an example that shows you how to use the call library function node you would use to access the LabWindows/CVI in LabVIEW. 

Please let me know if you have any further questions by replying to this post.  Best of luck on your application, and have a great day!!

Regards,
Ching P.
DAQ and Academic Hardware R&D
National Instruments
0 Kudos
Message 10 of 12
(2,904 Views)