LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How come two signals of the same frequency show on the graph as having the same?

Hi!

My assignment for school is to build a 2 channel oscilloscope, with generators too. Initially, I tried using a waveform chart, that actually showed a very "ugly" image. Just for testing, I left the chart there with hidden indicator.
The student teacher suggested I use a graph, which is ok, as far as the shape of the signal. The "time" axis however doesn't really show the time.
Thinking that it might show the samples, I put at the "nr.of samples" the reciprocal of the sampling rate multiplied with 1000,000 and the result was the same. The really strange part is that if I'd put two different frequencies for each channel it showed as is the signals had the same frequency.
And that's not the only problem... The while loop everything is in doesn't look like it's executing more than once. Now, I know the vi is pretty large but is that what makes it behave like that?
I also put cursors (like in the example from Fundamentals> Graphs and Charts > Programatically Control Cursors) that should be in the middle of the graph. Since I didn't use a chart, are the values at "Style" or "Pointer Style" different? (I wanted the cursors to be multi-plot).
Can you help me with any of that?

Thank you very much!
Patricia

0 Kudos
Message 1 of 5
(3,129 Views)
Could you send the code you already built ? It could be easier to help you if I can look at the code...
CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 2 of 5
(3,114 Views)
I'm sorry... I thought t was already attached.
Thanks!
0 Kudos
Message 3 of 5
(3,105 Views)
Hi Patricia !
First of all, I would suggest you to synchronize all actions according to data flow concept : try to link all property nodes with error wires... That way, you MAY notice some warnings/errors. Then you should try to group functionalities into clusters, that way your code would be easier to debug...
Then your While Loop runs as fast as possible (which makes your processor to run at 100% all time long), you should consider using a timing function to slow down the loop.
Then using "Graphs", the X-axis will display the number of samples in the array to plot. If you know the sampling frequency of your signal and the number of samples in the array, you can try use "Xaxis.Multiplier" property node to convert the number of samples into time.
Then for your cursors, you should consider using "Cursos List" property node... It's not really cool to program it (lot of options) but it works very well and allows you to deeply customize your cursors.

I hope this helps... Otherwise, don't hesitate to post another message !

Zyl
CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
0 Kudos
Message 4 of 5
(3,091 Views)
And the reason that the while loop appears to run only once is because of the event structure. it is waiting for the value change event of "Creaza imaginea". You need to wire a time out to constant to the event structure. Even better would be to put the event structure in a parallel loop. That way it does not hold up your main loop. Also you need to learn about data flow and you should make some of these multiple things on your BD into subvi's.
 
I moved your event structure in the example attached



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 5 of 5
(3,071 Views)