LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Analog Input of myDAQ (via DAQ Assistant) to Multisim Design in LabVIEW

I want to use Multisim, LabVIEW, and a myDAQ to build a power measurement loop. Essentially, I am using LabVIEW as the user interface, where I want to manually adjust a DC level (which currently is an analog output on a myDAQ), and read this DC level with an analog input on myDAQ via the DAQ Assistant. Then, I want to pass this DC level to my Multisim Design vi, where it will adjust the loop to find this DC level. The determined DC level will be output by the Multisim Design vi to a waveform chart on my LabVIEW front panel. My Multisim Design vi works fine when simply using LabVIEW controls (no myDAQ involved), but for some reason the output is not changing with the DAQ Assistant vi's in the loop. Perhaps I have created some infinite loop? Is what I want to do possible? I am using a 1 sample (on demand) in the DAQ Assistant to create my DC signal, if that sheds any light on the situation.

 

LabVIEW_Block_Diagram_Screen_Help_Request_1.png

0 Kudos
Message 1 of 5
(4,466 Views)

Attach VIs (i.e. code), not pictures.  You have two DAQ Assistants (boo!) inside a While loop, which is probably the source of your problem.  Had you attached the actual VI, we could "peek" inside the Assistant and see how you have configured it, then probably explained what your code was doing, why that wouldn't work, and possibly even how to fix it.

 

"Real DAQmx" isn't all that difficult, and is much more flexible (for real code) than the DAQ Assistant.  Do a Web Search for "Learn 10 Functions in NI-DAQmx", study this excellent NI White Paper, play around with your Device in MAX, write appropriate Tasks, and rewrite your loops with the proper 3-5 DAQmx functions that you'll need.

 

Bob Schor

Message 2 of 5
(4,437 Views)

Thanks for the reply, Bob. I'm working through that white paper and will try using the DAQmx functions to get my code working. I will attach my VI here so you can look at the DAQ Assistants. Basically, I am not getting any change in output from the Multisim Design.

0 Kudos
Message 3 of 5
(4,412 Views)

Hello 

 

Have you tried to use the Convert from Dynamic Data just to have a DB value (array).

 

Regards 

0 Kudos
Message 4 of 5
(4,403 Views)

I just did try, and that did not work. I submitted a support request to NI, which probably contains more descriptive information about the problem I am having that might help somebody find the problem. I will paste the text here along with all of my LabVIEW and Multisim files.

 

Problem Description :


I am building a loop in LabVIEW where the myDAQ reads a DC voltage in, sends
this DC voltage to a Multisim Design VI, which should track the DC voltage via
a successive approximation aglorithm. The Multisim Design VI should output the
resulting waveform showing this search process, which I then display on a
waveform chart.

 

The attached zip file "Functional_PM_Loop_Help_Files.zip" contains 3 VI's and 2
Multisim schematics. The "Functional_PM_Loop.ms14" Multisim design is the
top-level design that I am using in my LabVIEW program. The "SAR_HB.ms14"
Multisim design is a hierarchial block that is used within the
"Functional_PM_Loop.ms14" file.

 

The 3 VI's are all variants of the loop:

 

The first VI, "Functional_PM_Loop_No_DAQ_W.vi" does not utilize outside signals
from the myDAQ, (the input DC is instead generated from LabVIEW with a numeric
slide bar and fed directly into the Multisim Design VI). The output of the
Multisim Design VI seems to work properly in this VI, as you can see it tracks
the input DC with a successively approximated waveform.

 

The second VI, "Functional_PM_Loop_DAQ_Assistants_NW.vi" uses two DAQ
Assistants to interact with the myDAQ. One DAQ Assistant creates a task to make
the myDAQ output a DC level controlled by the numeric slider, and the next DAQ
Assistant creates a task to make the myDAQ read the DC level and sends that to
the Multisim Design. In this version of the loop, the Multisim output does not
update at all; there is no successively approximated waveform attempting to
track the DC input, but rather the "SAR_OUT" output of the Multisim Design VI
is a constant DC level.

 

The third VI, "Functional_PM_Loop.vi" replaces the DAQ Assistants with DAQmx
functions, as per a suggestion from someone on the community forums. Again, the
output of the Multisim Design VI is a constant DC, not the expected
successively approximated waveform.

 

Why does adding the DAQmx VI's cause the Multisim Design VI to stop outputting
the expected waveforms?

 

NI Software : LabVIEW version 2015 SP1
NI Hardware : NI myDAQ device
Driver Version :
OS : Windows 7

0 Kudos
Message 5 of 5
(4,397 Views)