Linux Users

Showing results for 
Search instead for 
Did you mean: 

Gracefully detecting when NI-DAQmx is ready

Go to solution

I am running NI-DAQmx 20.1 on openSUSE Leap 15.1 on a PXI-8101 controller. If I login immediately after a reboot and try to run any NI-DAQmx command (e.g. nilsdev) I get the dreaded... failed to initialize
Verify that nipalk.ko is built and loaded.
Aborted (core dumped)

After about 35 seconds I can run NI-DAQmx commands without errors. I am implementing a headless server so I need to delay my startup script until NI-DAQmx is ready. I can loop until nilsdev stops dumping core but that is inelegant. Is there a better way to determine when NI-DAQmx is ready to run commands without crashing?


I used to use a fixed delay but I just spent this week debugging a failure in about 1% of reboots that turned out to be because NI-DAQmx occasionally takes longer than usual to initialize.

Chuck Cox
Embedded Systems Engineer
0 Kudos
Message 1 of 3
Accepted by topic author cccox

Hey cccox,
Thank you for posting your question here. nilsdev is the predecessor of lsni. Your error indicates that the NI-PAL service is not started yet. You can try to manually start nipal via /etc/init.d/nipal start or check its run state in a while loop before executing your own code. You can also programmatically check that your system has entered runlevel 5 via the runlevel.sysvinit command.

Generally, nilsdev and lsni are based on the NI System Configuration API, so you can write your own code to handle availability checks. Please refer to the SysCfg CAPI programming reference here: NI System Configuration 18.0 Function Reference 

Please keep us posted on your progress.
Good luck!

0 Kudos
Message 2 of 3

Here is what we ended up with in our Bash shell script:


# Wait until NI-DAQmx is ready
printf "NI-DAQmx Starting"
until /etc/init.d/nipal status
sleep 1
printf "."
printf "\n"


Chuck Cox
Embedded Systems Engineer
0 Kudos
Message 3 of 3