.h to .d advice needed

Don Clugston dac at nospam.com.au
Thu Aug 10 09:47:24 PDT 2006


Emp wrote:
> Oh Yeah! my first readout from my virtual card :D.
> Thx, everybody.
> 
>> Not at all. I've been using NI-DAQmx with D for months. I can confirm that 
>> it works perfectly after translation. I'd post you my translation, except 
>> that would probably violate NI's copyright restrictions.
> 
> Could you maybe tell me how you handled the error handling code which htod 
> commented out?

I did my translation before htod existed.
It's pretty simple stuff though...

bool DAQmxFailed(int error) { return error<0; }

and all the errors should be constants.

const DAQmxSuccess = 0;
const DAQmxErrorCOCannotKeepUpInHWTimedSinglePoint = -209805;

.. repeat 2000 times or so. <g>


> 
>> You need to run the 'coffimplib' program (download from Digital Mars) on 
>> NIDAQmx.lib, to turn it from a Microsoft-format import lib into Digital 
>> Mars/Watcom/etc format.
>>
>> BTW, the reason all those #defines are duplicated is that they really 
>> should have been enums.
> 
> You mean that the original (labview) headers were enums?

No, but they should have been. The original headers seem to be written 
in very ancient C (about 1982 era :-) ).

> 
>> Good to see another NI user.
> 
> (I will be using the physical card for the readout of a purkinje eye 
> tracker, pretty nifty stuff :) 

Cool! I think D is fantastic for this stuff.



More information about the Digitalmars-d-learn mailing list