03-07-2010 09:45 AM
Hello.
I need to run my USB6008 on an ANSI-C program on a Linux plataform
I'm having some problems installing NI-DAQmx Base 3.3.0 on an openSUSE 11.2
1- On Ni website, it's written that NI-DAQ Base in compatible with openSUSE versions 10.3 and 10.2... Can anyone tell me if it's also compatible with version 11.2?
2- After installing NIVISA without any problem, I run ./INSTALL, but I get the following error:
"./INSTALL_ line 274: return: -1: invalid option
return: usage return
Any ideas?
03-07-2010 10:18 AM
Caveat: I do not have an Open Suse system to check my reply (I am a Scientific Linux user aka RedHat).
1-The message is that Suse expects line 274 which reads 274 return -1 to be written return [-1]
2-Possibly, this script written for an older version of the operating system utility (shell) sh may violate a change in syntax in your version.
First of all, what do you see if giving the command: ls -l /bin/sh ? (both l's are small L's, not the number 1)
Among other possibilities, ls -l /bin/sh may well return a link to the Bash shell as in:
[localhost] /home/goldberg > ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Feb 4 21:11 /bin/sh -> bash
But the syntax for Bash return is precisely::
Cause a shell function to exit with the return value n.
Syntax
return [n]
So my bet is that all you need is to replace -1 by [-1] in line 274 and then
in lines 158 256 264 276 296 378 390 393 398 402
Of course, you will enclose the return value within a [ ] pair, not replacing watever is the programmed
value by -1
Any editor has a way to find the string return which is much easier for finding the places to be changed
than using the line numbers above (which is how I listed them for you)
I wish you that there be no other more difficult problem in your installation.
yanqele
03-08-2010 06:29 AM
Hi again.
Thank you for your fast answer yanqele.
When I use the command "ls -l /bin/sh" what I get is similar to what you told, "lrwxrwxrwx 1 root root 4 Feb 24 15:14 /bin/sh -> bash"
Now about the changes on the INSTALL, I can't make changes on an ISO, so I copied the hole ISO to a new folder, where I as able to make the changes on the INSTALL, but when I try to run "./INSTALL" as rooter user, I get the follow error: "-bash: ./INSTALL: Permission denied"
How can I make those changes on the ISO?
Best regards
03-08-2010 08:10 AM
If you use NI-KAL v1.10 (downloadable from the NI site), you can use openSUSE11.1, including its latest kernel, 2.6.27.45 - that is what I use.
Using 11.2 is problematic, if possible at all (at least for a newbie like me).
Sergey L.
03-08-2010 09:00 AM
Indeed you cannot edit directly in the ISO structure and you did the right thing to copy INSTALL in a new directory ecept that you should copy all the files in the ISO not only INSTALL.
The error which you have after editing is again almost certainly a simple permission issue.
Try to reproduce this:
[localhost] /root > ls -l INSTALL
-r-xr-xr-x 1 root root 37371 Mar 8 16:23 INSTALL
[localhost] /root > chmod +w INSTALL
[localhost] /root > vi INSTALL --- here I used the vi editor, you use your favorite
[localhost] /root > ./INSTALL
***************************************
* NI-DAQmx Base 3.3.0-f0 for Linux/x86 *
***************************************
as you see it begins to work.
If you see no x in line -r-xr-xr-x 1 root root 37371 Mar 8 16:23 INSTALL
you need to apply command chmod +x INSTALL which means "make it executable".
Or, just the same, you may use source INSTALL
To avoid similar further obstacles, please read carefully how to use commands ls and chmod .
man ls (man is short for show the manual for command ls) and
man chmod
May I kindly suggest this text: http://dsl.org/cookbook/cookbook_toc.html ?
Or at least this: http://www.tldp.org/LDP/gs/node5.html ?
And if you really want to master Linux.Unix, this one is a must on your desk:
Mark Sobell , an introduction to System V.
Has not left my desk since about 20 years now.
Several updates published over the year.
Good luck
Yanqele
03-08-2010 10:22 AM
Hello fellows
I used NI-KAL v1.10 on my Suse 11.2 and after that I did succeed installing ni-daq-base 3.3
Now, I'm trying to run the analog input example "Acquire1Scan.c" but When I compile (gcc acquire1Scan.c) I got the following errors:
acquire1Scan.c:40:25: error: NIDAQmxBase.h: No such file or directory
acquire1Scan.c: In function ‘main’:
acquire1Scan.c:48: error: ‘int32’ undeclared (first use in this function)
acquire1Scan.c:48: error: (Each undeclared identifier is reported only once
acquire1Scan.c:48: error: for each function it appears in.)
acquire1Scan.c:48: error: expected ‘;’ before ‘error’
acquire1Scan.c:49: error: ‘TaskHandle’ undeclared (first use in this function)
acquire1Scan.c:49: error: expected ‘;’ before ‘taskHandle’
acquire1Scan.c:54: error: ‘float64’ undeclared (first use in this function)
acquire1Scan.c:54: error: expected ‘;’ before ‘min’
acquire1Scan.c:55: error: expected ‘;’ before ‘max’
acquire1Scan.c:58: error: ‘uInt64’ undeclared (first use in this function)
acquire1Scan.c:58: error: expected ‘;’ before ‘samplesPerChan’
acquire1Scan.c:61: error: expected ‘;’ before ‘data’
acquire1Scan.c:62: error: expected ‘;’ before ‘pointsToRead’
acquire1Scan.c:63: error: expected ‘;’ before ‘pointsRead’
...and so on...
Then I tryed changing the include line to the folder where nidaqmxbase.h file is:
#include "../../include/NIDAQmxBase.h"
And now after I compile (gcc acquire1Scan.c) I get the following errors:
/tmp/ccuZkksC.o: In function `main':
acquire1Scan.c:(.text+0xa8): undefined reference to `DAQmxBaseCreateTask'
acquire1Scan.c:(.text+0x10a): undefined reference to `DAQmxBaseCreateAIVoltageChan'
acquire1Scan.c:(.text+0x12e): undefined reference to `DAQmxBaseStartTask'
acquire1Scan.c:(.text+0x18f): undefined reference to `DAQmxBaseReadAnalogF64'
acquire1Scan.c:(.text+0x1d3): undefined reference to `DAQmxBaseGetExtendedErrorInfo'
acquire1Scan.c:(.text+0x1ed): undefined reference to `DAQmxBaseStopTask'
acquire1Scan.c:(.text+0x1fc): undefined reference to `DAQmxBaseClearTask'
collect2: ld returned 1 exit status
I'm sorry, I believe those are really newbie's questions but I'm really starting on the linux world...
Regards
03-08-2010 11:18 AM
Did you really type the command gcc Acquire1Scan.c ?
This would be a very bad idea
Your nidaqbase installation provided a directory /usr/local/natinst/nidaqmxbase/documentation or something very similar
To find it, do as root find / -name nidaqmxbase
In there, read the file README.txt
To compile Acquire1Scan.c , just be lazy
cd /usr/local/natinst/nidaqmxbase/examples/ai
and give the command make
It will execute the instructions programmed for you in file Makefile , setting up includes, compiling, etc...
Again, all that is explained in README.txt quoted above.
Excuse me if you tried make : you wrote that you are a beginner, thus I write at the beginner level.
Jacques