LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use the WriteToMemoryXX functions in a CIN?

I'm getting a linker error "unresolved external reference _WriteToMemory16" when I compile the C code that contains the calls to the WriteToMemory16 function. I've installed the accesshw files and am including the accesshw.h file in my C-code CIN. It would seem that I need to compile-in the code for the WriteToMemory function, which I assume resides in accesshw.c.

My application calls for some direct hardware i/o that falls in the "too messy to do in a block diagram" catagory. I'm using Labview 5.1.1 and talking to a Keithley Metrabyte PIO-96 card.

Thanks very much for any assistance.
0 Kudos
Message 1 of 3
(2,629 Views)
Hey JWP -

LabView ships with literally a dozen examples of using CINs and the Call Library Function function (still with me?). Check these out for including external c/c++ code into your LabView program. These examples are usally in \samples\Advanced Examples\Calling External Code Examples -> there are about 10-20 examples here.

I understand your feelings about the "too messy" part, but you would be amazed how easy programming I/O is with LabView, a NI card, and our NI-DAQ driver. Not to mention the hundreds of examples to get you started available for download free-of-charge. Something to think about. No one offers a more complete solution than NI.

good luck
ben schulte
national instruments
0 Kudos
Message 2 of 3
(2,628 Views)
Ben,
Thank you for the response. I looked at the examples you mentioned, but unfortunately I'm still unsure what to do. As mentioned, I downloaded the accesshw.zip file and installed the files in order for me to use InPort and OutPort VIs in my program on an NT box, which I'm doing and is working fine. Also, I downloaded the example, "PCI-DIO using AccessHW_DLL.c". This C file contains calls just like the ones I want to use (calls to WriteToMemoryXX) in my CIN C code to basically do the same operations as are done by the InPort and OutPort VIs. Is there a makefile available for that C file? Maybe if I knew how to build that file into a CIN, it would be the same process for me to build my file into a CIN. There is an include file in the "PCI-DIO using AccessH
W_DLL.c" file that I don't have (ansi_c.h), but I don't get a compiler error when not including this file in my C file so
I assume I don't need it. I've got the accesshw.dll file in the same directory as my .c file, as instructed to do on the accesshw.zip download page.

I'm developing the CIN using MSVC++ 4.0 if that helps.

Thanks very much,

Jeff
0 Kudos
Message 3 of 3
(2,628 Views)