07-05-2017 08:09 AM
When I run the script, I get the following error:
C:\Program Files (x86)\National Instruments\NI-DAQ\DAQmx ANSI C Dev\lib>bash ./mkdef.sh
./mkdef.sh: line 2: $'\r': command not found
./mkdef.sh: line 19: $'\r': command not found
./mkdef.sh: line 20: $'\r': command not found
./mkdef.sh: line 21: $'\r': command not found
./mkdef.sh: line 56: syntax error near unexpected token `$'do\r''
'/mkdef.sh: line 56: `do
I think your mkdef.sh has DOS-style line endings, but bash is expecting UNIX-style line endings.
07-05-2017 10:14 AM - edited 07-05-2017 10:16 AM
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 ./mkdef.sh 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.
07-06-2017 11:53 AM
Update:
Hello,
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 ./mkdef.sh 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?
Cheers