02-26-2011 01:01 PM
Hi,
In the file (Serial Read and Write to .tdms & Compare on Graph – test.vi) I am trying to integrate the following two waveforms into a single waveform: Realtime reading and Waveform chart (open vi to see). Both of them display speed vs time but from different outputs. One comes from an excel file (Teraterm – Results.xlsx – sheet 4, (column 3:row 4) to (column 3:row 1878)) and the other comes from the Serial input which is in Hex format and is split to get the various readings of speed, voltage etc. I have already wired speed to a variety of waveform outputs, but all result in broken wires.
The readings are taken in by the program and but I am unable to wire the two readings together into one graph.
Please do let me know as to how can I make this work.
Thanks in Advance.
Best Regards,
Akhil Kumar Meesala (Mr.)
Year 4 | Undergrad | Mechanical Engineering
National University of Singapore
Email: akhil@nus.edu.sg
Mobile: (+65) 9326 7069
Solved! Go to Solution.
02-26-2011 03:00 PM - edited 02-26-2011 03:05 PM
Hi Akhil,
now it's the 3rd thread with (nearly) the same attachment...
Have you read the error message that pops up when you move the mouse over the cross indicating the broken wire? It says something along the lines of "you cannot connect scalar values to inputs requiring an array"! You have to include a "BuildArray" node in the correct position and the error will vanish...
More hints:
- Do you think it's correct to AutoIndex an array (your Excel data) with a while loop without checking for the number of data items?
- HexStringToNumber has an Index input. Using it you wouldn't need the StringSubset functions as StringToNumber will also stop converting at the space char succeeding the number... Well, infact a single ScanFromString (using "%x %x %x %x %x %x %x %x %d") would be sufficient too for parsing your string...
02-27-2011 01:29 AM
Hey GladW,
Thanks for the prompt response. I put a build array from the input with speed output and have connected it to the rest of the terminals of the waveform.
But it seems like there is no increment on the X-axis values as the Y-axis value changes. The dots just go up and down (the white one is stagnant since it represents the string value which is stationary; the red dot follows the inputted excel file values). How can I add the x-axis readings (time readings) to the waveform graph?
With regards to your hints, when I disable auto indexing, there is no input from the excel file to the waveform graphs. Auto-indexing helps the program to take in values one by one into the loop right?
And thank you for your second hit, it really simplified the program. 🙂 I would clean up the wires later.
Thank you for your time.
Best Regards,
Akhil Kumar Meesala (Mr.)
Year 4 | Undergrad | Mechanical Engineering
National University of Singapore
Email: akhil@nus.edu.sg
Mobile: (+65) 9326 7069
02-27-2011 11:33 AM - edited 02-27-2011 11:34 AM
Hi Akhil,
the point on spelling my nick has been given in your other thread...
"But it seems like there is no increment on the X-axis values as the Y-axis value changes."
Have you looked at the examples explaining how to use graphs and charts? Do you know their difference?
Graphs don't buffer any data, they only show the latest data from the graph. Either use charts instead or make your own buffer!
"Auto-indexing helps the program to take in values one by one into the loop right?"
You're right - but you didn't get the point!
Right now your while loop may iterate forever, even when there is only limited amount of data... What should happen when you run out of data?
Btw. I could not run your VI as I don't have all those Excel-related subVIs nor do I have the possibility to process those nasty *.xlsx-files...
"I would clean up the wires later."
Better sooner than later! It's kind of disturbing to look at your code, especially with only limited screen size (laptop, 1280×800)... With a more compact block diagram we could also spot problematic places more easily!
02-28-2011 07:01 AM
Dear GerdW,
I'm sorry again about the misspelling your nick.
I tried connecting a waveform chart to the two terminals (speed from the DAQ and speed from the excel file) but I was unable to get the connection right. I understand that charts are used for readings which are equally spaced out, whereas XY graphs are used when the readings are not be spaced out uniformly. But I am unable to wire the connections correctly.
Actually the DAQ device continuously sends out data through the serial port. So I would not run out of data :). Are you referring to the data coming from the DAQ device or the excel file? I actually have not thought of what would happen when the excel file would run out of values 🙂 I am just hoping for the software to run till then for now 😛
I have cleared up the wires as well 😉 Thanks for your help.
Best Regards,
Akhil Kumar Meesala (Mr.)
Year 4 | Undergrad | Mechanical Engineering
National University of Singapore
Email: akhil@nus.edu.sg
Mobile: (+65) 9326 7069