* * *

Author Topic: NIDAQmxBase header translation  (Read 31139 times)

wimpie

  • New member
  • *
  • Posts: 32
NIDAQmxBase header translation
« on: November 10, 2009, 07:14:46 am »
Hi,

Has someone made a translation of the National Instruments DAQmxBase header file? I want to use the USB DAQ devices in linux.

Thanks

wimpie

  • New member
  • *
  • Posts: 32
Re: NIDAQmxBase header translation
« Reply #1 on: November 26, 2009, 05:44:26 pm »
If someone is interested, the translation is attached.

CM630

  • Hero Member
  • *****
  • Posts: 703
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: NIDAQmxBase header translation
« Reply #2 on: September 21, 2012, 07:47:43 am »
It would be nice, if there was some demo, working with this.
I have tried (Antillasoft's solution), but its source is closed.
« Last Edit: September 21, 2012, 07:49:34 am by paskal »
Lazarus 1,8,0 RC3;XP 32bit or W7 64bit ;FPC3,0,2;rev 55409

chor

  • New member
  • *
  • Posts: 6
Re: NIDAQmxBase header translation
« Reply #3 on: December 23, 2012, 06:11:17 pm »
I am trying to use the Antillasoft's solution, but it will not link because of version mismatch. I am using Lazarus 1.1, do anyone know the work around? :)

chor

  • New member
  • *
  • Posts: 6
Re: NIDAQmxBase header translation
« Reply #4 on: December 26, 2012, 11:22:40 am »
Is nidaqmxbase.pas.zip version specific? Will I be able to use it with the latest NI libraries? What are the requirements to use it under Ubuntu 12.04?
Any chance of a demo sample?  :D

CM630

  • Hero Member
  • *****
  • Posts: 703
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: NIDAQmxBase header translation
« Reply #5 on: June 10, 2013, 02:04:30 pm »
MX means, that it should be used with the latest NI daqs.
It's another question if nidaqmxbase.pas.zip is good for anything.
Lazarus 1,8,0 RC3;XP 32bit or W7 64bit ;FPC3,0,2;rev 55409

CM630

  • Hero Member
  • *****
  • Posts: 703
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: NIDAQmxBase header translation
« Reply #6 on: June 19, 2013, 09:53:44 am »
So, here is the story:
1. I have read a post by a NI staff member (or got the same impression), that NIDAQmxBase has problems even with VC++ and VB6, and that some people had success in running NIDAQmx in Delphi. So we should better forget about the BASE version and use NIDAQmx.

2. Finally I came across that.
I took two files from there: NIDAQmxCAPI_TLB.pas and nidaqmx.pas and fixed one of them a bit (removed three brackets).
So a working snippet is attached to the post.
It is running on Lazarus 1.1; SVN revision 40379; FPC version: 2,6,1 on Windows XP.
I have installed the latest NIDAQmx, I think it is 9.7.0. A file named nicaiu.dll shall be in the c:\windows\system32 folder.
The snipped works with a virtual DAQ NI PCI-6052E. I still have not tested it on a real one.

3. BTW, I tried to contact Antillasoft on the email, but it was returned to me buy the mail server. I suppose they are defunct.

EDIT: There is a bug in the snippet. I will update it when I have the time, but so far
line    DAQmxError:=DAQmxReadAnalogF64(taskHandle,SamplesPerChannel,10,{DAQmx_Val_GroupByScanNumber}DAQmx_Val_GroupByChannel,@DAQData[0],SamplesCount,@SampsPerChanRead,nil);

shall become
   DAQmxError:=DAQmxReadAnalogF64(taskHandle,SamplesPerChannel,TimeOut,{DAQmx_Val_GroupByScanNumber}DAQmx_Val_GroupByChannel,@DAQData[0],SamplesCount,@SampsPerChanRead,nil);
where
Code: [Select]
var
Timeot: double'
begin
...
TimeOut:=SamplesPerChannel/RefreshRate+1;

+1 seems to be enough for me, but I am not sure if it does not depend on the PC.
« Last Edit: July 18, 2013, 09:27:57 am by paskal »
Lazarus 1,8,0 RC3;XP 32bit or W7 64bit ;FPC3,0,2;rev 55409

mig-31

  • Full Member
  • ***
  • Posts: 219
Re: NIDAQmxBase header translation
« Reply #7 on: June 17, 2014, 02:38:21 pm »
Any other news about it in this topic?

I think it better to use NIDaqmx Base, because this library is crossplatform compare to NIDAQmx, which is now supported only under Windows  >:(
Lazarus 1.6 - Linux 32/64 bit, win32

mig-31

  • Full Member
  • ***
  • Posts: 219
Re: NIDAQmxBase header translation
« Reply #8 on: September 10, 2014, 01:23:38 pm »
Hi,

I tested both pascal binding for NIDAQmxBase under Linux and NIDAQmx  under Windows on real NI hardware NI PCI-6250 and NI PCI-6244 and it works:
1) NIDAQmxBase 3.7, Scientific Linux 6.3 and Mageia 2 32-bit:
    hadrware clocked and software controlled analog inputs - works,
    software controlled digital input/output - works,
    digital input/output clocked by internal counter output signal - works, but limited to 2047 samples of card buffer,
    hadrware clocked and software controlled counter output - works,
    software controlled counter input works - limited by CPU speed, DMA is not implemented in the driver
This year National Instruments planes to release 64-bit version of NIDAQmxBase. LabView2014 64-bit released this year.
2) NIDAQmx 14.0 Windows 7 32-bit
    all hardware futures are work, without limition in NIDAQmxBase.

Read readme to check limitaton of NIDAQmxBase driver.
I attached a small test project, which I created for testing and learn working with hardware and then implemented it to my measurement-data logging application:
Created and tested  on Lazarus 1.2.2, NIDAQmxBase 3.7, Scientific Linux 6.3 and Mageia 2 32 bit. 
Probably it could be useful for others, who want to use Pascal for NI measurement harware instend of C and horrible LabView.
 
« Last Edit: September 10, 2014, 01:25:30 pm by mig-31 »
Lazarus 1.6 - Linux 32/64 bit, win32

CM630

  • Hero Member
  • *****
  • Posts: 703
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: NIDAQmxBase header translation
« Reply #9 on: September 10, 2014, 02:31:10 pm »
I gave it a glimpse.
Do you intend to rewrite the lib references for dynamical linking?
If you don't I will, but I have no idea when  :-X

Lazarus 1,8,0 RC3;XP 32bit or W7 64bit ;FPC3,0,2;rev 55409

mig-31

  • Full Member
  • ***
  • Posts: 219
Re: NIDAQmxBase header translation
« Reply #10 on: September 10, 2014, 02:53:04 pm »
I didn't make any changes on pascal bindings for NIDAQmxBase and NIDAQmx.
I'm primary interested on using NI hardware under Linux.

I read (I'm not sure), that dynamic linking don't work good on FreePascal.

Do you test pascal bindining on real hardware - you wrote above that tested it only on virtual card? If yes, which cards?
We also have PXI system with two counters cards NI PXIe-6612. I plans to tested nidaqmx.pas on it.


« Last Edit: September 10, 2014, 02:59:53 pm by mig-31 »
Lazarus 1.6 - Linux 32/64 bit, win32

CM630

  • Hero Member
  • *****
  • Posts: 703
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: NIDAQmxBase header translation
« Reply #11 on: September 10, 2014, 03:58:59 pm »
We use NI and Measurement Computing (MCC a NI company) DAQs with Lazarus.
I have headers for dynamic linking for MCC devices. I have a problem with some calls of several functions but still I am not sure that the problem is in Lazarus and I have not reported it as a bug.
Still I have not uploaded it, because it is not fully complete, but if someone needs to use MCC devices with Lazarus, I will take my time to.

We have a measuring device, which might be a PXI, but I personally don't use so I have written nothing for it.
« Last Edit: September 10, 2014, 04:05:48 pm by paskal »
Lazarus 1,8,0 RC3;XP 32bit or W7 64bit ;FPC3,0,2;rev 55409

mig-31

  • Full Member
  • ***
  • Posts: 219
Re: NIDAQmxBase header translation
« Reply #12 on: September 10, 2014, 05:12:13 pm »
On this time, I'm not interested on MCC devices, because we make a dission to use National Instruments hardware.
But I'm suprised, that they provide good linux support.
We also have one Labview licence for Windows and Linux and I can compare results, but LabView horrible for big application creation.
Lazarus 1.6 - Linux 32/64 bit, win32

CM630

  • Hero Member
  • *****
  • Posts: 703
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: NIDAQmxBase header translation
« Reply #13 on: September 10, 2014, 05:30:04 pm »
Btw, in latest MCC drivers there is some support for Android, I suppose NI have too.
We use NI for PCI devices and MCC for USB.
Static linking requires that all drivers by all kinds of DAQs shall be installed. That is why it is a huge problem, when writing SW supporting devices by multiple manufacturers.
And BTW one day you might come to the idea, that you can get better performance and price if you order a device designed and manufactured especially for you.
I have really huge experience with LabView, 10 years ago it still was something impressive, but I doubt it made any progress since then. Some two years ago I was told that it still has no zoom in/out abilities.
But, I still have no proper replacement for LV's graphs.
« Last Edit: September 10, 2014, 05:35:36 pm by paskal »
Lazarus 1,8,0 RC3;XP 32bit or W7 64bit ;FPC3,0,2;rev 55409

CM630

  • Hero Member
  • *****
  • Posts: 703
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: NIDAQmxBase header translation
« Reply #14 on: September 12, 2014, 07:22:21 am »
I'm primary interested on using NI hardware under Linux.
Are you sure that NIDAQmx does not work on Linux and only NIDAQmxBase works on it?
As far as remember, I found the  NIDAQmx bindings in a project for Linux.
Lazarus 1,8,0 RC3;XP 32bit or W7 64bit ;FPC3,0,2;rev 55409

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus