Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,

i want to generate a sin wave as time on x-axis and amplitude on y- axis, i connected serial port RS-422 to my system ... can any one suggest me related article and some valuable ideas about generating the wave

thank you

What I have tried:

i generated a wave with out any values of amplitude and time but i want both of them as inputs
and vary the graph by changing the values
Posted
Updated 1-Feb-17 21:19pm
Comments
Jochen Arndt 2-Feb-17 3:04am    
This can't be answered without knowing the type / format of the input data.

If the input data are single sampling values (e.g. single bytes with values with values for 0 to 255), it is quite simple:
Use the received value as y position and increment the x position with each received value.
The time between receiving two values is called sample rate. When analysing periodic signals it can be used to calculate the frequency of the signal.
Pete O'Hanlon 2-Feb-17 3:14am    
What type of application are you wanting to generate the sine wave as? WPF? Windows Forms?
Member 12941572 2-Feb-17 6:05am    
windows form

1 solution

As others noted, your request is a bit vague.
Anyway, you basically need to collect data coming from the serial port, perform some kind of normalization and the output them on the screen. You may perform this kind of operation 'on the fly' if you need to show a real time graph.
Use the SerialPort component to collect data (assuming you ahave a RS422 adapter, and whatever graphic framework/library you are using (you didn't specify it) to show it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900