LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

digial waveform index out digital lines

Solved!
Go to solution
I am having trouble stripping out the seperate lines from a 9401 cdaq card in DAQ-9172 chassis. I have attached the vi I am using and can get the seperate line to display on a graph but can't strip each one out. I want to run each line through a dac and use single tone on the analog waveform to get the frequency of each.
0 Kudos
Message 1 of 14
(4,376 Views)

Hello Bassinbc.

 

I see that you have duplicated the post.  In this case it is ok because it is better suited in this forum --> LabVIEW however please refrain from doing this in the future as it help us stay on top of things on our end. 

 

As for your problem I ran you program and I can see that you have simple mistake in your block diagram.  You have specified that both indices be 0.    Dopuble check this and I will work on this and see if I can reproduce this issue and re-post soon.

 

Message Edited by CharlesD on 03-27-2009 02:09 PM
Charley Dahan

Global Account Manager
0 Kudos
Message 2 of 14
(4,358 Views)

After looking into your issue a little further Please conduct the following, on your Create Channel VI there is a terminal named: "Line Grouping".  Create a Constant/Control off of this terminal and select "one Channel for each line" from the drop down Enum.  The Default is "one channel for all lines". This will ensure that the data is recorded on a channel basis and not a port basis.  This will therefore create an array of waveform with index 0 for channel 0 and index 1 as channel 1.  Instead of how you had it before where index zero related to port 0.

 

See the attached VI for details on this.  

 

Thank you 

 

Charley Dahan

Global Account Manager
Message 3 of 14
(4,350 Views)
Is there a better and faster way of getting the data from each line? The dequeue loop is running slow.
0 Kudos
Message 4 of 14
(4,328 Views)

You have 1 major problem and 2 minor problems with your dequeue loop.

 

Major Problem:

You are taking a single queue and trying dequeue from it  multiple times.  Each dequeue takes an item off the stack. If nothing is there for the next dequeue, then it waits until something is.  Thus it takes 8 items to show up in the queue before the loop gets a chance to iterate once.  Only 1 dequeue per loop.  Split the wire that comes out of the dequeue and send it to each of the other pieces of code.

 

Minor problems.

The Index Digital Waveform is an unneeded subVI.  It's non-reentrant which means each instance has to wait until the others are done.  All it does is index out a single waveform from the 1-D waveform array.  Use the Index Array and stretch the bottom of the node downwards until you get 8 outputs.

 

The Build Digital Waveform is an unneeded subVI.  All you are doing is taking a digital waveform and building it into itself.

0 Kudos
Message 5 of 14
(4,326 Views)

I took your advice and things did get faster. One thing left would be to get each line (frequency) to show up on the chart as a number. That is what the build array is suppose to do. This doesn't seem to be working. I should have up to eight plots of a numeric number.

0 Kudos
Message 6 of 14
(4,323 Views)

Take a look at the context help of the waveform chart.  If you send it a 1-D array, you only get a single plot.

 

To get multiple plots, you need to send it a 2-D array.  You'll have to either use a Build array to take the 1-D to a 2-D, or a build array on each scalar wire to take them from a scalar to a 1-D, and 8 of those get built into a 2-D.  ( you could also do the former and use transpose array.)  I'm not sure which is correct for your situation.  You'll just need to play with the arrays until you get the 2-D array built just right.

 

It looks like you have LV 8.6?  I would recommend doing an Edit  -->  Clean Block Diagram on your code.  It will clean up the diagram nicely.

Message 7 of 14
(4,320 Views)
I am using 8.6. The attached program is a 1d array with each anlaolg input stripped out. The chart displays each channel seperately. I don't see why you have to send a chart a 2-D array.
0 Kudos
Message 8 of 14
(4,293 Views)
Solution
Accepted by topic author bassinbc

bassinbc wrote:
I am using 8.6. The attached program is a 1d array with each anlaolg input stripped out. The chart displays each channel separately. I don't see why you have to send a chart a 2-D array.

 

Does what you have work now?

 

The code you posted this time is a lot more complicated than what you posted before, and your chart is set up differently.  Before you just had a Waveform chart of double type that you were sending in a 1-D array of of doubles.  The chart treats that as multiple points on a single plot.

 

In the VI you just attached, you are sending a 1-D array of waveforms which is mulitiple waveforms (each element of the 1-D array) with 1 or more pts per waveform (the Y array inside the waveform data type.)  Interestingly enough, the context help for the waveform chart doesn't mention a 1-D array of waveforms, just a waveform datatype.  However, the charts.vi that can be found in the example finder does show this and other options.  I would recommend opening the Charts.VI example to see all the variations.

Message 9 of 14
(4,281 Views)
Ok I can now strip out the digital frequeny as a numeric indicator. I am trying to get these into a chart as seperate waveforms.
Message Edited by bassinbc on 04-02-2009 07:23 AM
0 Kudos
Message 10 of 14
(4,270 Views)