LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

help with serial

i am trying to receive sine wave signal on computer and i use  basic serial  read write but i canot get the original signal

and this is the signal that i received

Download All
0 Kudos
Message 1 of 46
(4,968 Views)

You are already being helped at quite some length in your original thread. Please don't start a new thread asking the same exact questions when several people are already trying to help you. This just forces people to ask you the same questions you've already answered, and it doesn't help you or us.

0 Kudos
Message 2 of 46
(4,939 Views)

Where are you getting this signal data from?

 

How many samples is it sending to represent one period of the sine wave?

 

How are you running your VI?  Because there is no while loop, it is basically only going to run once.  (Please don't say you are using the Run Continuously Button.)

0 Kudos
Message 3 of 46
(4,937 Views)

To OP: See what I mean?

 

Ravens Fan asked the same questions that were asked (and answered) in your original thread. How does this help you?

 

RF: Not busting your tail,, I know you're trying to help.

0 Kudos
Message 4 of 46
(4,927 Views)

No problem.  It is perfect proof of what you are saying.

 

When I saw the message, it had no responses even though it was few hours old.  (Of course it is a quiet Saturday night on the 3rd of July.  Our town's parade and fireworks were today and tonight.   I just got done celebrating with friends at our house and cleaning up from that when I jumped on the net.)  It was mere coincidence that you got in a reply just a minute or two quicker while I was still composing mine.  I saw your message, and jumped to the other link.  I'm impressed you knew to look for an old message since that other link was from over a month ago.  It was old enought that nothing jumped out at me that this question would sound familiar and I should search the user's profile to look for a duplicate message before responding.

0 Kudos
Message 5 of 46
(4,921 Views)

i start anew thread cause i did the program but i cant get the original signal ,i use continuous button is that problem

i use sampling frequency 200 .you comment on  small things is that will make difference with you and the original thread they didnot give me specific answer 

so would you help please or let that project

0 Kudos
Message 6 of 46
(4,913 Views)

i get the signal from outside the computer on serial port after i convert it to digital

0 Kudos
Message 7 of 46
(4,907 Views)

 


@sfhj wrote:

i start anew thread cause i did the program but i cant get the original signal ,i use continuous button is that problem

i use sampling frequency 200 .you comment on  small things is that will make difference with you and the original thread they didnot give me specific answer 

so would you help please or let that project


 

It's not that we're not trying to help. All too often new posters will simply create a new thread asking the same exact question when they're not getting the answer they want without making a single mention that they've asked the question and provide a link to the original message. As I noted, indicating the existence of the original thread eliminates duplicate questions and comments from replies. Ravens Fan asked you the same exact questions that were asked in the other thread. This inevitable leads to frustration on your end because you have to repeat yourself and it leads to frustration on our end because we end up feeling like we wasted our time asking something you've already answered, or telling you something you already knew. You have to understand that this is a community made up mostly of volunteers. We are not getting paid to do this. We do this because we try to help people. But ultimately, people who ask for help have a responsibility to the community to play the game fairly as well. Otherwise, everybody loses.

 

Now that my I've finished my diatribe... You have several problems:

  • As indicated, you are using the Run Continuously button in the toolbar. This is wrong. That button is intended for debugging purposes, not for normal operation. You were already told this in the original thread by Denns. Yet I still see no while loop. The program is not going to magically fix itself. YOU have to fix it. Look at the "Advanced Serial Write and Read" example. See the loop?
  • You have a race condition due to the local variable. The chart should be inside the case structure and connected to the same wire as the "*(type *) &x" indicator.
  • Your conversion of the data you read from the serial port is flawed. You have no way of knowing how many bytes you're getting, but you are always assuming that you're receiving some multiple of 4 bytes since you are trying to convert the string to an array of integers. What if the number of characters is an odd number, like 43? You have to carry around the "left-over" bytes into the next iteration for the next conversion. You cannot guarantee that you will be reading the entire waveform in a single read. How many bytes are being transmitted by the source? The serial port's buffer may not be the same size, and data does not arrive all at once. It comes in as a stream, and you have to read it as a stream.
  • I don't understand why you're throwing away data for the chart. You're converting to an array of integers, but for the chart you're only sending the first element. Why? That's guaranteed to make your graph look choppy.

The business about the sampling rate was already covered in the original thread. If you're trying to see the waveform in real-time (in other words see it while it's being generated), then forget it - the serial port does not have the bandwidth or speed required. If you're sampling a waveform at the source and sending a snapshot of it, then that's different.

Message 8 of 46
(4,876 Views)

ok i got you about original thread

but i didnot understand what to do with my signal i have signal 50 hz and simple analog to digital converter

so i didnot take in account fs

make conversion every 100 ms and send it as byte

so what is the wrong

i want to plot it i found so i plot the changable values of the array

0 Kudos
Message 9 of 46
(4,857 Views)

i make this program and i received this converted signal i give the shape of input sine wave but as samples 

i want to plot it as analog how?

or couldn't

if  i can do that ,could i make it general for wave  contain more than frequncy

Download All
0 Kudos
Message 10 of 46
(4,798 Views)