I do not remeber where did I took these from.
It could be you took them from
here. It is a translation of nidaqmx.tlb (the NI DAQmx C API) to pascal. But I think the conversion-utility which made this did not take into account that errorcodes where
signed long integers and should be negative for errors (and positive for warnings). It just translated the "32 bit space" to a 32 bit unsigned long integer (which in my point of view is not correct according to the National Instruments libraries).
It should have been like:
const
DAQmxSuccess = 0;
ErrorCOCannotKeepUpInHWTimedSinglePoint = -209805;
ErrorWaitForNextSampClkDetected3OrMoreSampClks = -209803;
ErrorWaitForNextSampClkDetectedMissedSampClk = -209802;
ErrorWriteNotCompleteBeforeSampClk = -209801;
...
etc.
Like it is defined in
NIDAQmx.h by the National Instruments libraries itself.
But anyway... the solution you use now works too.
They could be a float number, but I suppose that the sign $ in FPC is what defines them as a unsigned integer number. Probably another character would define them as something else?
No, it's not the $ what makes them an unsigned numer. Actually $FFFF1111 is not defined as negative or positive. It's just the same as 4294906129. So in that sense you would be comparing your ErrorCode to 4294906129 (which ErrorCode can never hold because it is too large). If you want automatic conversion you should either use LongInt($FFFF1111) or disable the range checking because that's what keeping you from comparing these values. With the absolute method you're essentially bypassing the range checking which is fine as long as you know what you're doing.
You would still have a problem calling this function like this:
showmessage(DAQmxErrorDescription($FFFCCC73));