MyRIO analog output
I want to output an analog signal by building the analog output block in my FPGA main? How can I achieve this?
Hi Syntyche,
Could you give me a little more information about what you are trying to do? Your question is not too clear. In general to do analog output on a myRIO is using the analog output express VI http://zone.ni.com/reference/en-XX/help/373925B-01/myrioreference/myrioref_exp_ao/. Are you wanting to create a custom FPGA instead of using the default personality?
Similar Messages
-
I'm new to myRIO and LabVIEW. My questions are as follow:
1. I tried a simple program to acquire analog sine wave from a function generator and display it in PC (labVIEW). The sine wave displayed in labVIEW was pretty accurate for approximately 50Hz. When I increased the frequency (sweep the frequency of function generator slowly) the displayed signal was badly distorted. At some frequency, pure sine wave appeared again. The frequency of waveform displayed in PC was different from that has been set in function generator. How to configure the sampling and acquire analog signal accurately?
2. I tried to produce a sine wave at analog output port using signal generated by using 'Simulate Signal' VI. I tried the default frequency which is 10.1Hz but the waveform observed in oscilloscope was around 1 Hz. If I set the frequency to 10Hz, DC line appeared in oscilloscope.
Can anyone please point out the problems and discuss on how to solve it? I should be grateful if anyone could share some example code.
Many thanks.trieu wrote:
Hello everybody!
I'm new to myRIO and Labview . can you help me? documents manual myRIO of ''Digital Image Processing with LabView''
thank you very much!
This qurstion seems unrelated to MyRIO analog IO, so why did you append to a seemingly unrelated thread?
Please start a new thread and explain what your question is. It is not clear what you want.
LabVIEW Champion . Do more with less code and in less time . -
Usb 6009 continuous analog output
Hi
I'm pretty new to Labview, so you may have to bear with me. I have a USB-6009 and I want to generate a continuos analog output voltage. I've got the example you have posted 'Gen Mult Volt Updates-SW Timed_LV7.1 (0 to 4).vi' working and it outputs a continuous sine wave.
In a similar manner I need to generate:
1. Ramp up voltage (and ramp down voltage): starting with a continuos constant voltage, which after a period of time linearly increases to another constant voltage, and which allows me to specify the 3 time intervals and the rate of increase.
2. Pulsations: whereby I can specify the amplitude and time interval of each pulsation
This is so that I can control voltage to a valve which regulates my pipe flow. In the example I have (one stated above), I do not understand specifically:
i. Why I need both a 'Software Loop Time (ms)' as well as 'Timeout'
ii. The 'Sinusoidal Pattern' input which seems to generate data for a sine wave- I can't get a description of that and there are no similar VIs for other waveforms; and what is the function of the two numbers it has?
iv. How do I change amplitude and time period for the wave?
iii. What does 'Index Array' do?
thank youHi there,
I'm guessing the VI you are using is the one from this KB:
http://digital.ni.com/public.nsf/allkb/6F2C2B49A89D685C8625711D007BDD64
i. The software timed loop control is to control the rate at which you change the voltage output. The timeout on the DAQmx Write VI is the maximum time in seconds the VI will wait to output a sample (eg. if the write buffer is full, the Write VI will wait for it to become available for 'timeout' seconds before outputting an error).
ii. The sine pattern is just an array constant of doubles that make up the sine wave voltage values, and the for loop adds an offset (of two volts) to every single one of those values. You might want to replace that entire array constant and for loop with a Simulate Signal Express VI (just search for Simulate Sig or look in the Functions >> Input palette) and convert the dynamic data output to an array of doubles. You can configure the type of waveform, amplitude, and time period from that express VI as well.
iii. Refer to previous answer.
iv. Index array returns an element of an array based on the index input. You can turn on the context help and move your mouse over functions to get more help on them.
I hope that helps!
Way S.
NI UK Applications Engineer -
Usb-6009 analog output voltage
Hi,
The usb-6009 has two 0-5 volts analog ouputs. Is it possible to connect
them in series, in order to get a single 0-10 volts analog output
channel ?
Thanks,
NicolasThose are ground-referenced signals. To connect them in series, you would have to connect one of the outputs to ground. You would be shorting out (at least) one of your analog outputs, and probably damage the unit.
John Weeks
WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
www.wavemetrics.com -
2 analog output channels with different frequencies
Hi,
hope that somebody can help me:
I created two physical tasks, analog output channels.
I should give signals (triangle signals) to a scanner. The problem ist that I need these triangle signals with two different frequencies.
I can create the signal with each of the task, but not together. Can I solve this problem somehow?
Ah, and of course the 2 tasks should start together...
Thanks for your help!!
TellyYou didn't mention the type of device you're using, so I'll assume it's a standard MIO. A typical MIO only has one AO timing engine, so you'll have to create one task for both channels and use a single update rate for the task. You will have to make the output frequencies different by passing different data for both channels.
For example, let's say your update rate is 1KHz. The data for channel 0 is 1000 data points of a single cycle of a triangle wave. The data for channel 1 is 1000 data point of two cycles of a triangle wave. When you run the task, you will get a 1Hz triangle wave on channel 0 and a 2Hz triangle wave on channel 1.
Good luck,
Joe -
HELP about analog output video
Hello, I´m need help about analog output video in Premiere CS5 using Matrox RTX2. I need to crop a video with resolution in 1440x1080 to 4:3 in output analog. But what happens is wrong (I think). My video is in format anamorphic and the other option is 16:9 letterbox. Is there any way to crop the video without using effects. Thanks a Lot and sorry my bad english (my native language is Portuguese).
There are no 4:3 HD specifications. You'll have to put the video into a normal SD sequence, and scale it down till the top and bottom of the video meet the frame. That way the sides will be cut off.
-
Simultaneous analog output 1k sine wave and data acquisition
Although many topics of simultaneous analog output and input can be found in NI Developer Zone, I have not found a case similar to my project. I'm trying to generate a 1kHz sine wave by using the analog output of NI DAQPad-6070E, and acquire one channel input signal simultaneously. I found most of the examples can not work properly above 100Hz. Any suggestions are welcome. Thank you.
JianI have sucessfully solve the problem when I observed the increase of
scan backlog number. Simply increase the buffer size of AI/AO and you
can make the 1kHz sine wave output and data acquired properly.
On Tue, 3 Feb 2004 09:03:07 -0600 (CST), jujian wrote:
>Although many topics of simultaneous analog output and input can be
>found in NI Developer Zone, I have not found a case similar to my
>project. I'm trying to generate a 1kHz sine wave by using the analog
>output of NI DAQPad-6070E, and acquire one channel input signal
>simultaneously. I found most of the examples can not work properly
>above 100Hz. Any suggestions are welcome. Thank you.
>
>Jian -
How to avoid delay during analog output generation by changing its frequency?
Windows XP
LabVIEW 7.1
PCI-6036E + BNC-2120
Hi,
I am going to create a vi to generate an engine speed sensor signal (a simple square wave with specific missed pulses, in my case 58 pulses “teeth” and 2 missed pulses “missed teeth”) as an analog output but in addition give me the opportunity to control parameters for example frequency online to simulate the engine speed changes during running that vi. For this purpose I have started with “Continuous Generation.vi” which is available in NI Example Finder under the following path:
Hardware Input and Output > Traditional DAQ > Analog Output > Continuous Generation.vi
Then I modified it towards above mentioned goal, all related vi s are attached. The main vi is: "Motor Signal Generator_1.12.vi"
At the first try it looks that it works properly but when have a look on that more accurately with Oscilloscope (fortunately I have a good one: Agilent 54621A – 60 MHz, 200 Ms/s) obviously there is a gap (delay or Jitter) whenever I change the engine speed. It is also attached in Signal generation_problem report.doc file.
Note: Small gaps are OK and related to predefined missed teeth but the big one is happened during changing engine speed.
As far as I understand it is related to the time which case structure in AO C-GEN sub-vi needs for AO reconfiguration each time after changing the engine speed (update rate). How can I get rid of this delay or gap during signal generation and generating completely continuous signal?
I have to mention that obviously I changed the frequency by changing the update rate. The other possibility is to change the number of updates in one period (refer to "generate arb frequency.vi" in NI site: http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3E48F56A4E034080020E74861) which resulted in no delay however then I can not change the frequency continuously but step by step (for example jump from 5Khz to 2.5KHz immediately) and this can not pass to my application.
Any hint is appreciated.
regards
Attachments:
Signal_generation_NIsupport.zip 81 KBHi Roozbeh,
The following example will allow you to vary the pulse train frequency during run time.
Thanks,
Lesley Y.
Attachments:
GenDigPulseTrain-ChangingSpecs.vi 75 KB -
How to switch analog output between two waveform frequencie​s
Hello,
I'm using a fairly simple VI to generate a square wave at our analog output board. I have the square wave controls in one panel of a sequence structure, and a "release" function in the other panel of the sequence. Currently the VI is programmed to switch from the original square wave to -10V when the Boolean control is switched.
What I'd like to do now is to modify the VI so that I can swtich between a square wave of a given frequency, say 100 kHz, to a square wave of a different frequency, say 10 kHz, or to DC -10V. But I'd like to be able to vary each frequency and amplitude independently.
Could anyone give me some programming pointers?
Thanks,
MichelleThanks to the three of you for the suggestions. I started trying a few of them, and then realized that what I had already built will work pretty well to update the frequency. I didn't realize that it would update the waveform in "run" mode -- I thought it would only do that in "run continuously" -- so I've found that I can change the frequency of the waveform by doing that. This doesn't allow me to change the frequency and the amplitude simultaneously, but I'm not sure yet whether or not I will need to do that -- I so will probably go ahead with the experiments I need to do with this set-up, then modify it if I find that I need to control both frequency and amplitude simultaneously.
Thanks for your help!
M. -
NI-DAQmx VisualStud​io C++ 6 Single point analog output
Specs: NI-DAQmx 7, VisualStudio C++ 6.0, PCI-6722,8channel AO
We have a very simple application: set a voltage (actually 6 channels) and keep it until we want it changed again, perform the change very quickly in response to an image capturing algorithm. So I don't need any waveforms or buffering.
In this forum post http://forums.ni.com/ni/board/message?board.id=231&message.id=3283&query.id=18094 you talk about an AOOnePoint example, but I get an error that the NI-DAQ driver does not support my device.
I may need to use NI-DAQmx, but how? I would like to use something like AO_VWrite(,,), maybe for 6 channels in one call. But I can't find it in NI-DAQmx. It seems I need to setup buffers and frequencies. I have a working sample, but it seems a slow and certainly overkill of this simple application:
// Link with \DAQmx ANSI C Dev\lib\msvc\NIDAQmx.lib
#include "NIDAQmx.h"
double[2] data;
int taskHandleAnalog;
int written;
void Init()
DAQmxErrChk (DAQmxCreateTask("",&taskHandleAnalog));
DAQmxErrChk (DAQmxCreateAOVoltageChan(taskHandleAnalog,"Device and Channel Info","",0,10,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandleAnalog,"",1000,DAQmx_Val_Rising,DAQmx_Val_ContSamps,NUMBER_OF_AO_SAAMPLES));
DAQmxErrChk (DAQmxWriteAnalogF64(taskHandleAnalog,NUMBER_OF_AO_SAAMPLES,0,1.0,DAQmx_Val_GroupByChannel,data,&written,NULL));
DAQmxErrChk (DAQmxStartTask(taskHandleAnalog));
void SetVoltage( double voltage )
data[0] = voltage;
data[1] = voltage;
DAQmxStopTask(taskHandleAnalog);
DAQmxErrChk (DAQmxWriteAnalogF64(taskHandleAnalog,NUMBER_OF_AO_SAAMPLES,true,10.0,DAQmx_Val_GroupByChannel,data,&written,NULL));Hi,
It looks like you simply wants to output voltages on the analog output channels, but only wants one update at a time with no waveforms or buffering in DAQmx.
As I'm sure you know there are really just 3 types of measurements. Single Point, Finite, and Continuous. Since you want a single value at a time it's just a Single Point operation.
You can find DAQmx examples for single point operations in this path:
C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog Out\Generate Voltage\Volt Update
Simply place the DAQmx Write Code within a loop and you will be updating one value at a time, but multiple times when "we want it changed again".
Dennis Morini
Field Sales Engineer
National Instruments Denmark
http://www.ni.com/ask -
I have only 3 slots of PCI or 4 slots of ISA bus, I want to configure with the minimum possible modules to attain 128 channels of DIO and 128 channels of analog output. This is inturn fed to the PCM (Pulse code Modulator). The cards will be placed in industrial PC.
Associate Engineer-Marketing,
Using just those 3 PCI slots you're not going to be able to get the 128 analog output channels. You will probably want to go either the MXI-3 (PCI bus extender) to a PXI chassis or E Series DAQ card to a SCXI chassis for such a high channel count system. Which analog output cards and which digital I/O cards you will want depends on your application. You will have to decide whether you will need static or dynamic analog output as well as whether you need clocked digital I/O or not. I highly recommend contacting our internal sales department at 1-800-433-3488. They are great at helping specify systems.
Ames
Applications Engineering
National Instruments -
Hello.
I have a piece of machinery that my system is connected to. Every time it reaches a proximity sensor (It's a reciprocating unit), I need to do a single pulse of 5v out of my analog output. It has to be fast, it has to stop until the sensor is reached again, and it can't stay 'on' for long.
I've attached my VI. I'm using a voltage input via DAQ assistant, routed through some logic to produce a 'true' boolean every time that sensor is reached, and that boolean is connected to a case structure with voltage out tasks created in DAQmx.
My problem is that the machine won't reverse while the case is still true and there's still the 5v being called by the true case on the case structure. It has to pulse, then stop, then be allowed to come back when the proximity sensor is reached again. As it is now, the machine reaches the prox and then the whole system stops, as the 'true' condition on the case structure, and subsequent voltage output, remain high.
I've attached the VI and heirarchy as well.
I've tried a few different things here, as well as just using a DAQ assistant with N samples, but that would just retrigger when the loop repeats anyway.
I'd love to sit and bang my head against this til I get it, but I'm under a time constraint. Help!
Still confused after 8 years.
Solved!
Go to Solution.
Attachments:
using create channel.vi 94 KB
logicsub.vi 32 KBRalph, without knowing the exact DAQ card that you are using, it is difficult to give you the best solution. If you want to continue with the solution that you currently have, try adding a shift register to the outer while loop to track the previous value of the boolean. In this way, we can keep multiple values that are above the threshold from causing multiple pulses. Next add a time delay after the DAQmx Write, then add another DAQmx Write to set the output back to your low value. Remove all code from your "false" case. See attached VIs. Please let us know what model of DAQ card you have as we may be able to do something clever like a retriggerable pulse train if your card can support it.
Charles Chickering
Charles Chickering
Architecture is art with rules.
...and the rules are more like guidelines
Attachments:
using create channel.vi 98 KB
logicsub.vi 29 KB -
Which audio interface(s) for 16 to 20 analog outputs?
Hi. I wonder if anyone can help me...
I'm running Logic 7.2 on a black MacBook. For my inputs I am using the MOTU 8pre, as this is convenient especially when recording drums with my band... no scrambling together of pre-amps... no faff...
The thing is... I've been given a shed load of gear (literally), including a 24 channel analog mixing desk and tons of outboard rackmounted effects units/compressors/gates...
I would REALLY love to integrate the two systems, especially at the mixing stage, by routing my Logic tracks to the desk. Unfortunately, the MOTU 8pre only has a couple of analog outputs (+ headphone out).
To make this a venture worth undergoing, I'm going to need a minimum of 16 analog outputs. 20 would be great if possible.
I suppose my initial questions are:
1. Can I daisy-chain 2 firewire audio interfaces (each with 8 analog outputs) to give me a total of 16 analog outputs?
2. Bearing in mind I have a low budget, could anyone advise me on which units to get. I don't think I could afford any more MOTU gear, unless I find an amazingly low priced second hand item. What about Edirol or M-Audio?
Thanks in advance.
MSThis is worth checking: http://www.ioneconnects.com/product.shtml
Based on new DICE II firewire chip with JetPLL technology (should have much lower jitter than regular firewire Audio devices that are not built on DICE II).
I believe that you can choose the configuration you need.
The only question for me is whether they are affected by apple's firewire streaming bug. But as I've heard that in the info of 10.4.9 SDK is a statement, that core audio bugs were repaired, I hope the offset streaming problem will be finally the past...
Man I am really considering this firewire snake, as it definitelly has many ins and outs - including 4 AES/SPDIF in and out!!!
I am going to upgrade my studio and two of those will probably give me enough ins and outs for all my needs (musicians + outboard hardware and a summing mixer). I was also thinking about Symphony (PCI solution seems to be still more stable than firewire) and some I/O "modules" from apogee, but that is much more expensive. And I 've read only positive info about the DICE II, so maybe I will give a firewire another chance... -
Hi everyone,
I am doing simple task in Visual C++ and I am using PCI-6221(37 pin).
Basically, I want to send same signal from 'analog input' to 'analog output'
at the same time (almost), to make it real-time application.
Can someone please provide me sample program.
I would appreciate if you could provide me with the good tutorial which explains
step by step everything about programing NI-DAQmx for C/C++.
Best Regards,
Khassan
Solved!
Go to Solution.This is my code in C++, you can optimize it if it looks too messy. This code reads signal from analog input and outputs it through analog output.
To make this code work additional include directories and library directories must be added from NI.
I hope it helps someone.
#include <stdio.h>
#include <conio.h>
#include "NIDAQmx.h"
#include <math.h>
#define DAQmxErrChk(functionCall) { if( DAQmxFailed(error=(functionCall)) ) { goto Error; } }
int main(int argc, char *argv[])
int32 error=0;
TaskHandle taskHandleRead=0,taskHandleWrite=0;
int32 read=0;
float64 dataRead[1000];
char errBuffRead[2048]={'\0'};
char errBuffWrite[2048]={'\0'};
bool32 done=0;
int32 written;
DAQmxErrChk (DAQmxCreateTask("",&taskHandleRead));
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandleRead,"Dev1/ai0","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandleRead,"",100.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,0));
DAQmxErrChk (DAQmxCreateTask("",&taskHandleWrite));
DAQmxErrChk (DAQmxCreateAOVoltageChan(taskHandleWrite,"Dev1/ao0","",-10.0,10.0,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandleWrite,"ai/SampleClock",100.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));
DAQmxErrChk (DAQmxStartTask(taskHandleRead));
DAQmxErrChk (DAQmxStartTask(taskHandleWrite));
while( !done && !_kbhit() )
DAQmxErrChk (DAQmxReadAnalogF64(taskHandleRead,1,10,DAQmx_Val_GroupByScanNumber,dataRead,1000,&read,NULL));
DAQmxErrChk (DAQmxWriteAnalogF64(taskHandleWrite,read,0,10.0,DAQmx_Val_GroupByChannel,dataRead,&written,NULL));
_getch();
Error:
if( DAQmxFailed(error) )
DAQmxGetExtendedErrorInfo(errBuffRead,2048);
DAQmxGetExtendedErrorInfo(errBuffWrite,2048);
if( taskHandleRead!=0 )
DAQmxStopTask(taskHandleRead);
DAQmxClearTask(taskHandleRead);
if( taskHandleWrite!=0 )
DAQmxStopTask(taskHandleWrite);
DAQmxClearTask(taskHandleWrite);
if( DAQmxFailed(error) ){
printf("DAQmx Error: %s\n",errBuffRead);
printf("DAQmx Error: %s\n",errBuffWrite);
printf("End of program, press Enter key to quit\n");
getchar();
return 0; -
Loop in combination with Analog output
Hi
I have modified the script thats translate a value in to a static analog output voltage. The value comes from another online running application. The analog output value must remain static until a new value arise. I'm using VB6 and DAQmx 8.5 on a XP computer. The DA converter is NI USB-6211. I have tried to play around with the Start/Stop and clear commands but my script still makes the program highly unstabile.
So am I using the commands correctly?. And have I setup the write commands correctly too. Can anyone allso explain how to use the command Doevent correctly
Dim taskHandle As Long
Dim clockEdge As Long
Dim sampsPerCycle As Double
Dim desiredSampleClockRate As Double
Dim resultingFrequency As Double
Dim amplitude As Double
Dim numSampsPerChannel As Long
Dim numChannels As Long
Dim errorCode As Long
Dim errorString As String
Dim sampsPerChanWritten As Long
Dim XICVolt As Double
' Create the DAQmx task.
Call DAQmxCreateTask("", taskHandle)
' Add an analog output channel to the task and check to see whether there is only ONE task.
Call DAQmxCreateAOVoltageChan(taskHandle, "Dev2/ao0", "aoChannel", "-10", "10", DAQmx_Val_VoltageUnits2_Volts, "")
Call DAQmxGetTaskNumChans(taskHandle, numChannels)
If numChannels > 1 Then
errorCode = -1
errorString = "Please specify only one channel."
Err.Raise errorCode, , errorString
End If
Data_is_recorded:
If Actualcycles = expectedcycles Then
GoTo end_script
Else
If Actualcycles > lastcycles Then
DoEvents
Call DataPoint.GetDataPoint(thenumberOfDataPoint, theXvalue, theYvalue)
XICVolt = (theYvalue / 10000000#)
' Write to the desired channel(s).
Call DAQmxWriteAnalogF64(taskHandle, 1, True, 10#, _
DAQmx_Val_GroupByScanNumber, XICVolt, sampsPerChanWritten, ByVal 0&
Else
lastcycles = theWF.GetActualNumberOfCycles(sampleIndex, 0)
End If
GoTo Data_is_recorded
end_script:
End If
call DAQmx.stopTask(Taskhandle)
call DAQmx.clearTask(taskhandle)
Best regards
PeterDavid Weber wrote:
thanks lot for all the great feedback. That's really helpful. I think I'll go for the NO_MERGE hint. A first test with this looks good.Keep in mind, only undocumented hint MATERIALIZE along with subquery factoring clause WITH (for which this hint was created) will work in real queries:
SQL> select my_id as id
2 , my_id as same_id
3 from (select /*+ NO_MERGE */ xxx_test_pkg.get_id(1) as my_id from dual),emp where rownum < 6;
ID SAME_ID
20 20
21 21
21 21
21 21
21 21
SQL> select my_id as id
2 , my_id as same_id
3 from (select xxx_test_pkg.get_id(1) as my_id from dual where rownum=1),emp where rownum < 6;
ID SAME_ID
22 22
23 23
23 23
23 23
23 23
SQL> select my_id as id
2 , my_id as same_id
3 from (select /*+ MATERIALIZE */ xxx_test_pkg.get_id(1) as my_id from dual),emp where rownum < 6;
ID SAME_ID
24 25
26 27
28 29
30 31
32 33
SQL> with t as (select /*+ MATERIALIZE */ xxx_test_pkg.get_id(1) as my_id from dual)
2 select my_id as id
3 , my_id as same_id
4 from t,emp where rownum < 6;
ID SAME_ID
34 34
34 34
34 34
34 34
34 34
SQL> SY.
Maybe you are looking for
-
Can't Log In with Different AppleID
I accidentally tried to log in with the wrong AppleID this morning and now I don't even get the option of trying to log in under a different ID. Every time I try, I click "log in" and the next page that comes up already has the wrong ID listed and of
-
FF4 install freezes win 7 during reboot and can't uninstall or reinstall
I upgraded to FF4 and it requested a reboot. Upon reboot, Windows 7 freezes up and repair or restore is required to get back into windows. If I try to reinstall or uninstall, the install program informs that states that I have to complete the previou
-
Help!!! error -45054 when trying to play/download music in iTunes
Help! I've recently bought my macbook pro. I can see my the music i have previously bought on my iPhone in iTunes but cloud symbol next to most music. When I try to play any of these or download new songs I get error message -45054. I have checked an
-
This is all I can see. it will not resize the window, full screen mode shows only this as well.
-
Hi There, I was having some problems with Acrobat and with other CS3 components, too, so I just ran the CS5 Cleaner Tool and reinstalled CS3. As far as I can tell, the only problems I have now are with Acrobat 8 Professional. - It appears that I'm a