LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

binary sequence to function of time in labview

Hey people!

I want to change a binary sequence to a funtion of time, and I have changed it to a sequence of 1s and -1s as required of my application.

I want to plot this new sequence as function of time i.e. each bit being plotted for a time i specify.  

How do I do this? I tried using zero order hold, but the hold time in cycles input doesnt seem to change anything.

i have attached an example array below, and an example of how the output shuld look. Any help is appreciated.

Thank you.

 

 

 

0 Kudos
Message 1 of 10
(4,597 Views)

One option is to use a Graph with the following settings:

 

Bundle a zero constant with a unity constant with your 1D array of data. Pass this cluster into a waveform graph.

Set the plot interpolation to the fifth option (lower middle).

 

What you've done here is equally spaced each data point by '1', starting from '0'. The '1' is your i.

 

 

 

 

 

Message Edited by Thoric on 05-05-2009 01:17 AM
Thoric (CLA, CLED, CTD and LabVIEW Champion)


Download All
0 Kudos
Message 2 of 10
(4,588 Views)

Hey Thoric!

Thanks a lot for your help. Did as you suggest. However, for the last element on the array, the graph doesnt display.

I have attached a figure of what im getting now. It seems that for hte last element, the spacing isn't applying.

Thanks again for your help.

 

0 Kudos
Message 3 of 10
(4,552 Views)

What do you mean?

 

Your image shows a 1 at x=0 and 1, and shows -1 at x=2 and 3, just like your array .

 

0 Kudos
Message 4 of 10
(4,535 Views)
Pleae see Thoric's attached graph. For the last element/data point, there is a spacing of 1 as well. However, it isnt the case for my graph generated. (see the x axis lol)
0 Kudos
Message 5 of 10
(4,532 Views)
Then he has a data element of -1 at index #4 of his array as well, which doesn't show on the front panel since he is showing only the first 4 elements (indices 0-3).
Message 6 of 10
(4,528 Views)

Hello

Was just wondering. Is there a way I can represent the binary sequence on the time axies i.e i want the bit 1 to hav a certain time like 1ms etc.

How do I do this. Im realy stuck on this.

Thanks for all the help.

0 Kudos
Message 7 of 10
(4,513 Views)

The issue is that you are trying to display 4 bits, but you need 5 points on the display to do this the graph plots points that are essentially at the edges of the bit.  It is like the difference between an XY graph in Excel and a bar graph.

 

x=0 is the start of bit 0

x=1 is the start of bit 1, but the end of bit 0

x=2 is the start of bit 2, but the end of bit 1

x=3 is the start of bit 3, but the end of bit 2

x=4 is the end of bit 3

 

Just take your array, index out the last value, and just build it back onto the end of the array.

 

Alternatively, you should probably looking at something like the mixed signal graph to plot digital waveforms.

0 Kudos
Message 8 of 10
(4,508 Views)

Hi LSASS

Apologies for the late response,

Ravens Fan is correct, there is an extra element in my data set to ensure the final data point is drawn. To duplicate this effect, just copy the last data point back into your array, creating a new array of n+1 data points.

 

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 9 of 10
(4,492 Views)
Seems to be a corollary of this question.
0 Kudos
Message 10 of 10
(4,474 Views)