12-09-2009 11:57 AM
Hi,
I want to plot some data from rs232 to a chart with a time based axis. I made something like the example "Variable-time Chart XY" but im getting an error : "connect 1-D array cluster of 1 element to sink cluster of 2 elements".
What shoud i do to fix this?
Thanks in advance
12-09-2009 12:10 PM - edited 12-09-2009 12:12 PM
You have two different types wired to the same waveform graph.
You have a cluster of DBL/SGL/SGL/SGL/DBL and an array of clusters[SGL/DBL].
Question: Why is your code so complicated? What are you really trying to do? I'm sure there is a much simpler way of doing it.
R
12-09-2009 12:25 PM
I want to plot data to chart with time axis,
I made this and its ok, but now i want to show time on X axis.
12-09-2009 12:29 PM - edited 12-09-2009 12:30 PM
Problems:
You have a race condition. Two sets of values being written to the same graph in parallel. I realize that you want to send the X-axis seperately, but to what values are you associating those values to (on the y-axis)?
What does the data from the serial port look like? And why do you use a byte array? Is the data all binary?
If so, maybe the first step is to determine the start & end of a byte array and convert it into numeric. You read it in 12 bytes, why do you do that? Can you ensure that it is the full / proper data frame? Are there any delimiters or patterns to indicate start / end of data?
Why do you add zero to the strange timestamp? 0 does not change the value. You're adding the strange timestamp to the data going to the graph... That's going to make things ugly.. Not only in the esthetics sense 😉
You should bundle the timestamp with the data in a waveform. I would suggest a smaller number for the timestamp, but that might be a requirement that you are trying to meet.
You need to describe what you want to do before getting help with this.
R
EDIT: I type too slow, you've made some improvements while I was typing... 😉
12-09-2009 12:35 PM
rty wrote:
I made this and its ok, but now i want to show time on X axis.
You mean to tellme that the above code works and you are getting the desired plot?
Maybe I am missing something, but you are probably getting to points and maybe a straight line between them. Is this correct?
All you want to do is add a timestamp to those two points? Is that correct?
12-09-2009 12:58 PM - edited 12-09-2009 01:05 PM
ok, forget about the time problem and lets focus on rest first.
I have this:
Im sending many types of data to rs232 (XY acelerometer values, temperature, and others). in the chart example, i send from hardware something like "x%0.2fy%0.2f" where 0.2f is the value and the x/y is a tag that help me to know what kind of data is that.
So when i receive, firstly convert the string to an array and then i serach if the first position of array is an "x", if so then i know that string has data that i want to plot on chart. It enters on a case structure and then i split the array to "x%0.2f" and "y%0.2f, i remove the "x" and "y"and convert the data to decimal string to plot on chart.
This is working fine, i belive there are many easiers ways to do this but im begginer with labview!
Ok, now i have 2 plots on the same chart and i want to set the X axis as current system time (HH:MM:SS,xx).
Thanks for your help and forgive me my bad english
---------------------------------
EDIT:
Yes, as far as i know it's working 🙂
12-09-2009 01:06 PM
You can use an XY graph and get what you are looking for. See blow
12-09-2009 01:21 PM
12-09-2009 01:33 PM
12-09-2009 01:41 PM
u mean this ?