Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulated devices on Linux stuck in "Initializing"

I am attempting to simulate a NI PCIe-6320, NI cDAQ-9189, and some modules on Ubuntu 22.04. I can successfully add the simulated devices with `ni-hwcfg-utility` or by importing a nidaqmx config file, but after I do, the simulated devices don't work as expected. For example, I can't use the NI-DAQmx C API or Python API to communicate with the devices. I get an error message about the device not being found.

 

When I check `nilsdev`, I see:

 

 

 

$ nilsdev --verbose
mfio [DAQmx Simulated] [Initializing]
   BusType: PCIe
   DebugSession.Configured: 0
   DebugSession.ServerEnable: 1
   DebugSession.ServerIsOutOfProcess: 0
   DevIsSimulated: 1
   DevSerialNum: 0x0
   PCI.BusNum: 0x0
   PCI.DevNum: 0x0
   ProductNum: 0x7425C4C4
   ProductType: PCIe-6320
daq1 [DAQmx Simulated] [Initializing]
   BusType: TCP/IP
   DevIsSimulated: 1
   DevSerialNum: 0x0
   ProductType: cDAQ-9189
   TCPIP.DevIsReserved: 0
   TCPIP.EthernetIP: 0.0.0.0
   TCPIP.EthernetMAC: 00:00:00:00:00:00
   TCPIP.EthernetMDNSServiceInstance:
   TCPIP.Hostname:

 

 

 

 

It seems like the simulated devices are stuck in this "Initializing" state. Occasionally the devices come out of this initializing state and I can then use them as expected, but every reboot means they may go back into this state, and it's pretty rare they come out of it. I haven't been able to determine what causes the devices to go into or leave this state.

Message 1 of 5
(1,790 Views)

Hi. I'm experiencing the same issue, also with a NI-9189 on Linux (specifically Linux Mint, which is basically Ubuntu). Did you ever find a solution? It appears to be the cause of the issue in these posts (at least for me):
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P8k8SAC&l=en-US 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000PARISA4&l=en-US 

 

The actual error I'm getting in python (with the nidaqmx library) is:

DaqError on line 1036: Device not available for routing.  It is possible that the device needs to be reset or that the device is being reset.
If you are resetting the device, wait for the reset to complete.
For example, if you have used the device through Traditional NI-DAQ, you must reset the device before the requested route can be made.  For SCXI devices, you must reset the communicator DAQ device. Call the Traditional NI-DAQ Device Reset VI or the Init_DA_Brds function. To reset all devices in Traditional NI-DAQ, right-click the Traditional NI-DAQ Devices folder in MAX and select Reset Driver for Traditional NI-DAQ.

Device: cDAQ2

Task Name: _unnamedTask<0>

Status Code: -89130

 

output of nilsdev --verbose:

cDAQ2 [DAQmx Simulated] [Initializing]
   BusType: TCP/IP
   DevIsSimulated: 1
   DevSerialNum: 0x0
   ProductType: cDAQ-9189
   TCPIP.DevIsReserved: 0
   TCPIP.EthernetIP: 0.0.0.0
   TCPIP.EthernetMAC: 00:00:00:00:00:00
   TCPIP.EthernetMDNSServiceInstance: 
   TCPIP.Hostname: 
   cDAQ2Mod1 [DAQmx Simulated] [Initializing]
      CompactDAQ.ChassisDevName: cDAQ2
      CompactDAQ.SlotNum: 1
      DevIsSimulated: 1
      DevSerialNum: 0x0
      ProductType: NI 9205
   cDAQ2Mod5 [DAQmx Simulated] [Initializing]
      CompactDAQ.ChassisDevName: cDAQ2
      CompactDAQ.SlotNum: 5
      DevIsSimulated: 1
      DevSerialNum: 0x0
      ProductType: NI 9485
   cDAQ2Mod3 [DAQmx Simulated] [Initializing]
      CompactDAQ.ChassisDevName: cDAQ2
      CompactDAQ.SlotNum: 3
      DevIsSimulated: 1
      DevSerialNum: 0x0
      ProductType: NI 9253
   cDAQ2Mod8 [DAQmx Simulated] [Initializing]
      CompactDAQ.ChassisDevName: cDAQ2
      CompactDAQ.SlotNum: 8
      DevIsSimulated: 1
      DevSerialNum: 0x0
      ProductType: NI 9213
   cDAQ2Mod6 [DAQmx Simulated] [Initializing]
      CompactDAQ.ChassisDevName: cDAQ2
      CompactDAQ.SlotNum: 6
      DevIsSimulated: 1
      DevSerialNum: 0x0
      ProductType: NI 9485
   cDAQ2Mod4 [DAQmx Simulated] [Initializing]
      CompactDAQ.ChassisDevName: cDAQ2
      CompactDAQ.SlotNum: 4
      DevIsSimulated: 1
      DevSerialNum: 0x0
      ProductType: NI 9237

edits for extra context

0 Kudos
Message 2 of 5
(75 Views)

Hi!

I did find a work-around that works for me, maybe it'll work for you.

The fix is to first import a simulated NI cDAQ-9179 with no modules, then to replace it with an import of the NI cDAQ-9189.

So I have this file, I'm calling import_temp.ini

[DAQmx]
MajorVersion = 25
MinorVersion = 0

[DAQmxCDAQChassis daq1]
ProductType = cDAQ-9179
DevSerialNum = 0x0
DevIsSimulated = 1

 
And this one, I'm calling import.ini

[DAQmx]
MajorVersion = 25
MinorVersion = 0

[DAQmxDevice mfio1]
ProductType = PCIe-6320
DevSerialNum = 0x0
DevIsSimulated = 1
ProductNum = 0x7425C4C4
BusType = PCIe
PCI.BusNum = 0x0
PCI.DevNum = 0x0

[DAQmxCDAQChassis daq1]
ProductType = cDAQ-9189
DevSerialNum = 0x0
DevIsSimulated = 1
BusType = TCP/IP
TCPIP.HostName = daq.mda.lan
TCPIP.EthernetIP = 10.0.73.2
TCPIP.EthernetMAC = 01:23:45:67

[DAQmxCDAQModule daq1sg1]
ProductType = NI 9236
DevSerialNum = 0x0
DevIsSimulated = 1
CompactDAQ.ChassisDevName = daq1
CompactDAQ.SlotNum = 1

[DAQmxCDAQModule daq1sg2]
ProductType = NI 9236
DevSerialNum = 0x0
DevIsSimulated = 1
CompactDAQ.ChassisDevName = daq1
CompactDAQ.SlotNum = 2

[DAQmxCDAQModule daq1sg3]
ProductType = NI 9237 (DSUB)
DevSerialNum = 0x0
DevIsSimulated = 1
CompactDAQ.ChassisDevName = daq1
CompactDAQ.SlotNum = 3

[DAQmxCDAQModule daq1di1]
ProductType = NI 9401
DevSerialNum = 0x0
DevIsSimulated = 1
CompactDAQ.ChassisDevName = daq1
CompactDAQ.SlotNum = 4

[DAQmxCDAQModule daq1di2]
ProductType = NI 9401
DevSerialNum = 0x0
DevIsSimulated = 1
CompactDAQ.ChassisDevName = daq1
CompactDAQ.SlotNum = 5

[DAQmxCDAQModule daq1ai1]
ProductType = NI 9219
DevSerialNum = 0x0
DevIsSimulated = 1
CompactDAQ.ChassisDevName = daq1
CompactDAQ.SlotNum = 6

 
So I do

nidaqmxconfig --import import_temp.ini --eraseconfig

...and then...

nidaqmxconfig --import import.ini --eraseconfig



If I don't import that temp file first, the devices stay as "Initializing" forever. However, when I do, I have never had that same problem.

Message 3 of 5
(57 Views)

This is so helpful thank you!! I’ll def be trying this later. Two quick questions. Does this workaround ever fail? How did you create the tempimport.ini and import.ini? Did you use hwcfg or write them by hand?

0 Kudos
Message 4 of 5
(41 Views)

It has never failed for me. I run these steps dozens of times every day as part of our CI pipeline and it's worked every time. You can create them by getting things setup as you like in hwcfg, then running `nidaqmxconfig --export <filename>`.

0 Kudos
Message 5 of 5
(22 Views)