From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-01-2012 03:25 AM
i am acquiring data from serial port rs 232 instead of nidaq card but the problem is that my graph is not coming that smooth as i am providing a sine wave through function generator, although acc. to input data output value changes, but instead of showing sine wave graph is shpwing peaks of the amplitude that i provide, so i am not getting where actually is the problem, if any one culd help
01-01-2012 07:37 PM
Because you did not include any data for us to look at, it is more difficult to detrmine what the problem might be.
Run your VI so that some data shows on the Waveform Chart. Stop the VI. From the Edit menu Make Current Values Default. Save the VI. Post that VI with the data.
These possiblities come to mind.
1. Serial communications are asynchronous which means that the time between adjacent bytes can vary.
2. Your signal frequency and the sampling rate do not meet the Nyquist criterion.
3. You are only looking at two bytes of the received string for each iteration of the loop. You may be missing data.
4. You can probably get your numeric output in one step by using the appropriate formatting with Scan from String.
Lynn
01-01-2012 10:57 PM
i am saving only 2 bytes bcs my actual data consists of 2 bytes only, other bytes represents channel name and next line address and i had tried almost all solutions to get the numeric output in one step by scan from string but but since i had to separate my data from channel name and next line address, i came across this solution only, if there is any better approach please let me know
my data is like this 1C8F 0A, 1 represents the channel name and 0A is next line address so data is only C8F which is of my use
01-04-2012 05:11 PM
From looking at the graph and the data it appears that your data acquisition setup has at least two serious problems. 1. The remote device is saturated at both the maximum and minimum levels. The repeated 5, 5, 5 and 0.1, 0.1, 0.1 data values indicate this. You need to attenuate the signal before it reaches the device or reduce the internal gain of the device. 2. The sampling rate is too low to reproduce the waveform nicely. You are only getting 8 or 9 samples per cycle. While this meets the Nyquist criterion, it is too low to give you anything which looks like a smooth sine wave. Do you know the data will always be a sine wave? Are you trying to measure amplitude, frequency, phase, or something else?
Your string is always two data bytes followed by a line feed, right? How much of the string is the channel name? One bit, 4 bits, something else? What numeric value does "C8F" represent? What is the exact data format?
Lynn
01-19-2012 12:21 AM - edited 01-19-2012 12:23 AM
thanks for the help, i made some changes in my vi, and now i am getting the correct output.