Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

How Can I Use The NI-DAQmx ANSI C Function Library With GCC (on Windows)?

When I run the script, I get the following error:

C:\Program Files (x86)\National Instruments\NI-DAQ\DAQmx ANSI C Dev\lib>bash ./
./ line 2: $'\r': command not found
./ line 19: $'\r': command not found
./ line 20: $'\r': command not found
./ line 21: $'\r': command not found
./ line 56: syntax error near unexpected token `$'do\r''
'/ line 56: `do



I think your has DOS-style line endings, but bash is expecting UNIX-style line endings.

Brandon Streiff ·
0 Kudos
Message 41 of 43

Thanks a lot for your reply Brandon.


I solved this problem too. I also check nicaiu.dll.exp and NIDAQmx.dump in Notepad++, it seems like they are properly generated.


Again in step 5, when I run:

C:\Program Files (x86)\National Instruments\NI-DAQ\DAQmx ANSI C Dev\lib>bash ./ nicaiu.dll.exp NIDAQmx.dump > nidaqmx.def

I dont get any error in command prompt and the bash script generates the nidaqmx.def.

However, when I open the nidaqmx.def in Notepad++, I see the following error:

Error: 0x80070057


Does anyone know how I can get through this problem?

dplamp, in the text file, was suggesting to make 500-line chunks from the .exp using: 

head -500 > chunk1.exp
head -1000 | tail -500 > chunk2.exp 


When I run, head -500 > chunk1.exp, I can see chunk1.exp is generated while command prompt is still running. However, the size of chunk1.exp remains as 0 KB. The command prompt does not stop running, then I have to close to command prompt to start from the beginning of step 5. My problem may not necessarily be due to the error dplamp mentioned. 


At this point, any suggestion is welcome.

If I can get through this step, the sample C example will probably work fine.

0 Kudos
Message 42 of 43




I was able to generate 500-line chunks as well. One can generate chucks as follows:

type ==> head -500 nicaiu.dll.exp > chunk1.exp

head -1000 | tail -500 nicau.dll.exp > chunk2.exp


Here I can properly generate chunks, I open them on Notepad++, they look fine. No Problem here!



Then dplamp suggests running the script on each chunk 

i.e.: bash ./ chunk1.exp NIDAQmx.dump > chunk1.def


and concatenating the .def chunks generated:

chunk1.def > nidaqmx.def

chunk2.def >> nidaqmx.def




The problem occurs here. When I run the script, chunk1.def (others in the same fashion) file is generated on the same directory. However, when I open it on Notepad++, I only see this: Error: 0x80070057


This is the same error when I run the script before generating chunks. Therefore, I think my problem is related to bash script.


Can someone suggest something?









0 Kudos
Message 43 of 43