LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulating NI USB-6001 using NI MAX

Solved!
Go to solution

I'm taking a Udemy course on LabView currently working in a Section on NI-DAQmx Python API.  This course requires using a USB-6001 data acquisition module to test their suggested code. 

 

I've watched several other YouTube videos on creating and configuring "Simulated Devices" with NI MAX.  However, their examples simulate the NI cDAQ-9174, NI 9205, and NI 9375 which worked fine for their example.  However, I tried to create a new Simulated Device for the NI USB-6001 device and it would not allow me to Configure Simulated cDAQ device.  It only showed me a Configure Hardware Device which I don't have any hardware.

 

So, is there a way to simulate and configure a NI USB-6001 device or is there a cDAQ device close to functionality, configuration, etc. that can be used to simulate a NI USB-6001 device?  Are there instructions on how to achieve this device simulation?

 

Thanks, JT

0 Kudos
Message 1 of 13
(563 Views)

@Tesi2023 wrote:

So, is there a way to simulate and configure a NI USB-6001 device or is there a cDAQ device close to functionality, configuration, etc. that can be used to simulate a NI USB-6001 device?  Are there instructions on how to achieve this device simulation?

 

Thanks, JT


Do you have LabVIEW and MAX?  Here is what MAX shows me ...

Simulated USB DAQ Devices in NI MAX.png

 

Bob Schor

0 Kudos
Message 2 of 13
(529 Views)

Bob_Schor,

Thanks but I've already tried exactly what you suggested and it did not provide me with a Simulated Configuration tab, it only provided a Hardware Configuration tab which means I would need actual USB-6001 hardware.  I clearly stated I do not have any hardware in my original post.

 

Any other ideas on how to simulate the USB-6001?

 

Thanks, John

0 Kudos
Message 3 of 13
(505 Views)

@Tesi2023 wrote:

Bob_Schor,

Thanks but I've already tried exactly what you suggested and it did not provide me with a Simulated Configuration tab, it only provided a Hardware Configuration tab which means I would need actual USB-6001 hardware.  I clearly stated I do not have any hardware in my original post.

 

Any other ideas on how to simulate the USB-6001?

 

Thanks, John


John,  the 6001 is a straight stand-alone DAQ device and does not operate as part of a cDAQ system.  This is why you are getting your error.  Simulated a USB-6001 the way Bob Schor shows under the "New>>Simulated device " menu.


"Should be" isn't "Is" -Jay
Message 4 of 13
(499 Views)

Knight of NI,

Here are the steps I used to create a Simulated USB-6001.

1. From the NI MAX main window, I RT+CLK the selected Devices and Interfaces

Tesi2023_0-1707662306746.png

2. Create New and select Simulated NI DAQmx Device...> CLK Finish button

Tesi2023_1-1707662466016.png

3. Expand USB DAQ folder and Select USB-6001 > CLK OK button

Tesi2023_2-1707662640448.png

4. Select the newly created NI USB-6001 "Dev1" device that shows Hardware Configuration Utility tab.  

Tesi2023_3-1707662796572.png

5. Note when I select the previously created NI cDAQ-9174 "cDAQ1" device, it has a Configure Simulated cDAQ Chassis...  

Tesi2023_4-1707662914494.png

So, how exactly do I create a Simulated USB-6001 device that actually has a Configure Simulated USB-6001?

 

Thanks for your patience,

John

0 Kudos
Message 5 of 13
(492 Views)
Solution
Accepted by Tesi2023

John,  a Compact DAQ ("cDAQ") chassis can't contain a USB-6001.  Only cDAQ modules have an interface that can be used in a cDAQ chassis and, cDAQ modules need a cDAQ chassis to work.  An NI USB-6001 connects directly to a computer via USB and does not have a cDAQ interface. 

 

A simulated NI USB-6001 needs no hardware configuration page because it needs no other hardware.   Whereas, a cDAQ module does need a hardware configuration page because it has to be part of some cDAQ system. 

 

Clear?


"Should be" isn't "Is" -Jay
Message 6 of 13
(480 Views)
Solution
Accepted by Tesi2023

@Tesi2023 wrote:

 

So, how exactly do I create a Simulated USB-6001 device that actually has a Configure Simulated USB-6001?


Not! Since there is nothing to configure on an USB-6001 device. It contains 8 analog inputs, 2 analog outputs and 3 digital ports with in total 13 digital IO lines. There is no way to add any other hardware or remove anything from it. It is what it is and that is it.

 

A cDAQ chassis in itself has no IO hardware that you can control with DAQmx. Instead you plugin C modules but you can select from a few dozen of them depending on your needs. Here the simulated hardware interface for the cDAQ chassis lets you configure what C modules you want to have simulated in the various slots. The USB-6001 has no slots that you could configure by plugging in different modules.

Rolf Kalbermatter
My Blog
Message 7 of 13
(459 Views)

Jay,

It is clear now about not requiring any configuration of a simulated USB-6001 according to your response.  

 

So, I ran the following python version 3.12.1 code:

 

# Section 7 DAQ Programming Using Python
# Tutorial 137 Analog Read using Python
# filename: Analog_Read.py
# Python 3.12.1
# J. Trites, February 7th, 2024
# Simulated - Model = NI USB-6001, Name/Channel = 'Dev1/ai0'

import nidaqmx
with nidaqmx.Task() as task:
task.ai_channels.add_ai_voltage_chan('Dev1/ai0')
value = task.read()
print(value)
task.stop

 

And, here is the result:

Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 21:47:43) [MSC v.1937 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license()" for more information.

= RESTART: C:\Users\JohnTrites\Documents\Python and LabView Integration\Section7_DAQ\pycode7DAQ\Analog_Read.py
-0.07447198144304724

 

My only question left is how did this simulated USB-6001 come up with a negative analog value and how would I connect a simulated source voltage with range ? to generate simulated varying DC voltage values?

 

Thank you for your patience in walking me through this problem.

 

Best Regards,

John Trites

0 Kudos
Message 8 of 13
(452 Views)
Solution
Accepted by Tesi2023

@Tesi2023 wrote:

My only question left is how did this simulated USB-6001 come up with a negative analog value and how would I connect a simulated source voltage with range ? to generate simulated varying DC voltage values?

 

Thank you for your patience in walking me through this problem.

 

Best Regards,

John Trites


NI DAQmx simulates a sinewave for simulated devices, and you have no control over its amplitude and frequency. Always remember "simulated" != "real" regarding functionality.

 

NI DAQmx driver does not provide a way to override the simulated device behavior; you can add a layer on top of the DAQmx driver to make it simulate an application-specific signal.

 

Please read these considerations - https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019Nw0SAE&l=en-US

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 9 of 13
(447 Views)

Santhosh,

Thank you for your answer.  I've read all the articles on your link below.

 

"NI DAQmx driver does not provide a way to override the simulated device behavior; you can add a layer on top of the DAQmx driver to make it simulate an application-specific signal.

 

Please read these considerations - https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019Nw0SAE&l=en-US"

 

Regarding adding a layer on top of the DAQmx driver to make it simulate an application specific signal, is there a link or example showing how to add this layer you indicated?

 

Thank you again,

John Trites

0 Kudos
Message 10 of 13
(434 Views)