Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Complier Error - Using Nidaqmx.lib Ver7.5 in Borland C++ Builder

Hi,

I use the NIDAQMX.LIB(Ver7.5) and add it to my Borland C++ Builder 6.0 project.

It will occur the error.

[Linker Error] 'C:\DANIEL_WORK\NI TEST\TEST\NIDAQMX.LIB' contains invalid OMF record, type 0x21 (possibly COFF)

How can I solve this problem?
0 Kudos
Message 1 of 15
(7,025 Views)
Daniel,

This is due to a difference between Microsoft and Borland compilers. Borland includes a utility called "coff2omf" that may be able to convert this library so that it is compatible with the Borland compiler. Another option would be to create a wrapper dll in Visual C++ that is callable by Borland. This has been done for NI DAQmx 7.4 in this KB:

http://digital.ni.com/public.nsf/websearch/A6715AA42405ACD786256F0A00633B8F?OpenDocument

Perhaps you could make a similar wrapper for 7.5. If you do not have access to Visual C++, then downgrading may be your only option. Please let me know if you have any more questions.

Hope this helps,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
Message 2 of 15
(7,006 Views)

Dear Ryan V.,

Thanks for your information. It's really help me a lot.

There are no errors when using my Borland C++ Builder project.

B.Rs.

Message 3 of 15
(7,002 Views)
Daniel,

Glad to help. I'm just curious - were you able to get "coff2omf" to work?

Thanks!
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 4 of 15
(6,992 Views)
Hi Daniel,

I've the same problem in my Borland C++ Builder 6.0 project with th e same error([Linker Error] 'C:\DANIEL_WORK\NI TEST\TEST\NIDAQMX.LIB' contains invalid OMF record, type 0x21 (possibly COFF)).

But I didn't succeed to solve this problem!!!

Can you give me your solution please!!!

Thank you in advance for your answer
0 Kudos
Message 5 of 15
(6,926 Views)
Bulot,

I'm not sure what worked for Daniel in the end. Have you tried using the wrapper dll? Have you had any luck with the coff2omf utility? Please let me know if you are having trouble with either of these methods.

Regards,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 6 of 15
(6,908 Views)
Hi Ryan,

Since this morning, I can compile my project with Borland C++ Builder. I have just take the NIDAQmx.lib and .h on the folder NIDAQmx75.zip of this link:

http://digital.ni.com/public.nsf/websearch/B09727F89DA3A06C86256F430071D88E?OpenDocument.

I have attached the .lib on my project and include the .h and the .lib included on this link is OK with borland C++ Builder.

And now is OK. Since this morning, My application use  Digital Output on my module USB 6009, on tomorrow I 'll continued my project  with  digital, Analogic Input and Output.

Thank for all,

Bulot
 

0 Kudos
Message 7 of 15
(6,903 Views)
Hi Bulot,




Coincidentially, I am also writting a support for USB-6009 and need to use the NIDAQ 7.5 drivers. I downloaded the lib file from the location that you specified, but there is no .h file there. Would you be able to direct me to where the
_correct_ lib and h files for the 7.5 drivers are?




Would it be possible for you to send me the sources of your
application (perhaps even with the lib+h files) so that I can have a look? I am using the code that I developed for
DAQ-Pad 6015 (NIDAQ-7.4) and the code compiles fine. But
after I initialise the device using (this is a copy from
ANSI C examples)



DAQmxErrChk(DAQmxCreateTask("",taskHandle));



DAQmxErrChk(DAQmxCreateAIVoltageChan(*taskHandle,chan.c_str(),"",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL));



DAQmxErrChk (DAQmxCfgSampClkTiming(*taskHandle,"",1000,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,iBufferLength));



and want to start the task by



DAQmxStartTask(taskHandle);



I get an Error message 'Floating point division by zero'.



I am using Borland C++ Builder 5.0 (service pack 4) on
Win2k and want to be able to read analog signal and
set 0/1 on digital output lines.



Would you or anyone alse be able to help me out of my trouble?

0 Kudos
Message 8 of 15
(6,871 Views)
Hi Polero,

I join you the .h and .lib (NIDAQ 7.5) how work in my Borland C++ Project.

At this time, my application can only use the Digital Output and work correctly.

This week, I develop for use the input Digital, Analog Input and Output in my project!!! with the6009 USB module.

Good Luck,
0 Kudos
Message 9 of 15
(6,842 Views)
Hi Balot,

Thanks for the files. Yes, the compilation works fine, but
I still get the same run-time error (see above). Now I am a bit lost and don't know where to search for the problem. The best would be if you could provide me with a working
example of what you have. Would you be willing to send me
your example code that you know that works? Digital/Analog
input/output, anything. I just need to test it to see whether I do something silly here....

Thanks again and hope to hear from you soon.
Polero
0 Kudos
Message 10 of 15
(6,600 Views)