From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-13-2014 10:54 AM
Dear Forum,
Just wondering if anyone out there could advise me please.
I'm setting up code on the myRIO (using the myRIO function palette) to create a simple signal generator on the analog output, however at the AO function I receive Unknown Error -363004 as shown below:
This error doesn't occur, however using the high level analog output function.
Does anyone have any suggestions on why it may be happening?
The thoughts I've tried (to no avail)
Code shown below (and attached) as a VI Snippet.
Low-Level code (producing the error):
High Level code (which works):
Any suggestions, big or small would be greatly appreciated!!
Kind thanks,
01-13-2014 11:15 AM
Hey Tori,
The analog output VI that you are using writes a single analog value per pin. When you call the analog open VI you are determining how many pins to write to and the array passed to the analog write VI is one value for each channel. In your code you open a single channel and then pass multiple values to the analog write VI. I assume this is what is casing the error.
If you want to write out a waveform you'll need to use a for loop to iterate over each sample in the waveform and write the values one at a time using the analog write VI. You may want to consider using a producer consumer architecture to achieve this.
Let us know if that helps or if you have more questions.
Thanks!
-Sam K
Join / Follow the LabVIEW Hacker Group on google+
01-13-2014 11:32 AM
Hey Sam,
Thanks for the fast response and suggestion!
If you check the help file for the AO function, it shows that the input to the "Values" must be a 1D array of double, therefore by inserting a for loop, the values then must be built into an array within the for loop to avoid a broken wire into the AO function.
When reading this back into AI, however, the sine wave is no longer being outputted like a sine wave.
To check I've implemented it as you expected, my amended code is shown below.
Kind thanks,
01-13-2014 11:40 AM
Hey Tori,
When you say: "the sine wave is no longer being outputted like a sine wave." What exactly do you mean?
When you pull the data points out of the waveform data type you lose the timing information. As a result the code you've written will output the data points as fast as it can (as fast as the for loop can iterate). Try adding a delay to the for loop and see if that gives you better output. The delay will determine the frequency of the 'sine wave' and you may have to play with the timing and number of samples to get a nice smooth output.
Again, let us know if that helps or if you have more questions.
Thanks!
-Sam K
Join / Follow the LabVIEW Hacker Group on google+
05-20-2014 02:40 PM
Hi Tori,
Have you fixed that problem?
CZ
08-11-2020 04:14 PM