Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Borland 6.0 Help

Hi friends

So far i was working with VC++ and my device USB 6009 was natively supported by the NI drivers, I just had to include the header and the library file and it would work.

Now i'm migrating to Borland C++ Builder 6.0  i dont know weather NI driver version 8.3 supports Borland c++ builder 6.0.Although i tried it using

#pragma path "c:\borland"
#pragma link "nidaqmx.lib"

and the same for header file although  it did not give any errors for  NI API's used  It gives data type error. In VC i would use

uInt8  data[100];
int32 read,bytespersamp

But in Borland  there  is no  int32 or
uInt8  equivalent i tried int but it gives 'expected unsigned char' when i use it with the read digital lines API.

I saw the knowledge base but it is not descriptive enough.

Can any 1 guide me as to how to properly use NI APi's  within  Borland c++  builder  where do i include the library and header files and should i use a different driver version Please guide me
0 Kudos
Message 1 of 19
(6,979 Views)
Hey perk_bud,

I looked in the NIDAQmx.h file and it says that uInt8 is unsigned char (or an unsigned 8 bit number referring to an ASCII character) and int32 is signed long (or a signed integer of 4 bytes or 32 bits). If you use these data types the program should work for you. You might want to open the NIDAQmx.h (default location: C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include) file in notepad (or any word editor) to see what each of the data types correspond to. You might also want to try compiling one of the example programs (C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C) and they should work.

You needn't post on both forums (Measurement Studio for VC++ and Multifunction DAQ),  just use the DAQ forums for all questions related to data acquisition regardless of the programming language.

Cheers
Malay Duggar
NI

Message Edited by 50ohmTerminator on 01-03-2007 03:50 PM

0 Kudos
Message 2 of 19
(6,958 Views)
Thanks But will NI work with Borland c++ builder 6.0 and with NI driver version 8.3.And where can i find examples for Borland c++ builder.

Message Edited by perk_bud on 01-04-2007 02:04 PM

Message Edited by perk_bud on 01-04-2007 02:05 PM

0 Kudos
Message 3 of 19
(6,951 Views)
Hey perk_bud,

I do believe you should be able to use NI drivers with Borland C. Did you get a chance to try the data types suggested in the earlier post?
C examples for DAQmx can be found at C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C. I don't think there are special examples for Borland.

Click here for a knowledge base article that you might find helpful.

Cheers
Malay
0 Kudos
Message 4 of 19
(6,923 Views)
Thanks Malay the data types did work and it isn't giving me any errors but the application for some reason is not loading could be my problem dont know.I have integrated the normal NIDAQmx header and library file as follows

#pragma path "c:\borland"
#pragma link "nidaqmx.lib"

Is this the correct way or can u tell me the proper way to integrate NI header and Library files into my Borland  C++ builder project.

Message Edited by perk_bud on 01-05-2007 02:14 PM

0 Kudos
Message 5 of 19
(6,919 Views)
I tried integrating NI library files which are designed for borland  but i get the following error

[Linker Error] Unresolved external 'WinMain' referenced from C:\PROGRAM FILES\BORLAND\CBUILDER6\LIB\C0W32.OBJ

Can somebody help.

Message Edited by perk_bud on 01-05-2007 06:25 PM

0 Kudos
Message 6 of 19
(6,916 Views)
Hey perk_bud,

I do not think this linker error is due to the NI libraries. One way to go about debugging this would be to remove all DAQmx code and calls to the NI libraries from your program. However, include the NI libraries when you compile the program and see if you still get the errors.

You could also try and find out where the COW32.obj was created and which function caused the error.

Hopefully this will get us to the root of the problem.

Cheers
Malay
NI
0 Kudos
Message 7 of 19
(6,904 Views)
As I understand it daqmx is not supported borland.
See NI has droped Borland support.
 
To add any file to a project use the add to project menu.
 
nidaqmx.lib is a microsoft lib file and will not work with Borland.
You could create a Borland compatable lib file by using the tool suppied with Borland against the DAQMX dll.
But then NI could have done this to save all Borland developer the problem.
With the old DAQ lib the Borland version ended with a "b"
 
nidaqb.lib
 
The object file will not link as it it also a microsoft objet file type (coff) borland is omf.
Lok at toots like coff2omf.exe inpdef.exe, and implib.exe.
Hope this helps
For MX project I would use .NET and Measurment Studio as borland have trouble importing the old activex controls from MS v6.
 
Colin Hughes
Delphi Diesel Sstem
 
0 Kudos
Message 8 of 19
(6,796 Views)

The object file will not link as it it also a microsoft objet file type (coff) borland is omf.

I am wrong here as it lookes like it is a Borland file.

 

Colin Hughes

Delphi Diesel Systems

0 Kudos
Message 9 of 19
(6,791 Views)

Hi Colin

First of all thank u for u r help. Which Borland tool should i use to make NIDAQmx.lib compatible with Borland.You have a have mentioned coff2omf.exe inpdef.exe, and implib.exe which 1 should i use. & should i also convert the NIDAQmx .h header file-& also mention which tool to convert it with and what about the object file. And is there any readily available Borland Compatible file.

 

Message Edited by Parikshit on 03-06-2007 04:30 AM

Message Edited by Parikshit on 03-06-2007 04:33 AM

0 Kudos
Message 10 of 19
(6,700 Views)