LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use analog or digital output for 1D array of data?

Solved!
Go to solution

Hi,

 

I am using a photodetector as a sensor for an encoder, and I would like to output an analog or digital signal with high and low readings. I'm collecting data continuously, 500 samples at a time, at 75kHz using the DAQ assistant. I'm am then trying to do some live processing, and then output that data either through the analog or digital output channel. (The processed data only consists of high and low values only, so analog and digital output should both work for me.)

 

When I try to output with analog ouput, I get error 200077 (see attached). Saying the requested value is not a supported value for this property (even though my output is simply a 1 or a 0.2). I have no idea why this is happening.

 

When I try to output with a digital signal, I get error 200463. Saying that the number of lines in the digital waveform doesn't match the number of lines in the channel. My waveform has 500 lines (or elements); I don't know how to output this to digital output. I tried setting the VI to "Digital -> Single Channel -> Single Sample -> 1D Boolean (N lines)", but it doesn't work. 

 

I've attached the VIs for both analog and digital output. Any feedback would be greatly appreciated.

 

Thanks,

W

 

0 Kudos
Message 1 of 5
(4,974 Views)
Solution
Accepted by topic author WCSRI

In the analog case, when you create the Task (outside of the loop) you set "One Channel for all Lines" - this isn't a valid input to "Units". If you delete the enum you're wiring there, then the default is "Volts", which you don't need to wire, but right clicking and choosing Create > Constant will show the available values.

 

You should additionally be careful with your acquisition - using the DAQ Assistant at 75kHz and 500 Samples means it will be recreating a task very frequently. You might have a better time using an Analog Input task like you create for the output.

 

It looks like you uploaded the same VI for the digital output, so I can't comment further on that, but my guess is you need to form a digital waveform and send 1 line, N samples, rather than the opposite.


GCentral
0 Kudos
Message 2 of 5
(4,939 Views)

Thanks, deleting the "One Channel for all Lines" made the analog case work. 

 

I tried converting the DAQ assistant to an Analog Input task, but now I get a frequency issue with my filter, even though my cutoff frequency (20kHz) is less than half of my sampling frequency (sampling at 75kHz). 

 

I also attached the digital output VI that I was trying to implement "EncoderADC_v4 (digital output)". 

 

 

 

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

I'm pretty sure your problem is the conversion to dynamic data type - probably the dt value is being wrongly implemented (my guess is the default is 1). You can instead use the Butterworth Filter in the 'Signal Processing > Filters' palette. This has an input to which you can wire the sampling rate explicitly.

 

You can alternatively convert the Express Filter VI to a normal subVI using the Open Front Panel right click option, then double click in a couple of layers to learn exactly what's being called - it boils down to a VI that isn't on the palettes as far as I can see, but I think it should probably be equivalent to a normal filtering option under Signal Processing.

 

 With the digital version, you have an array of booleans and a 1 Channel 1 Sample output. I expect that changing it to 1 Channel N Samples would work out, but you should make all of the same improvements if you want to test it as you have in your other VI (i.e. DAQmx tasks, removing DDT).


GCentral
0 Kudos
Message 4 of 5
(4,899 Views)

Hi,

 

Did you manage to solve this problem? Please say if you need more help with this issue.


GCentral
Message 5 of 5
(4,864 Views)