01-09-2014 12:21 AM
hi,
we have developed a integral cycle controller using matlab and converted that into labview.we are facing some problem in connecting source to sink.
type of source is double,type of sink is 1D array.
01-09-2014 12:51 AM - edited 01-09-2014 12:52 AM
-Please underastand data types and structures first.You should understand what is an array and what is double.Then we can certainly help.
-Refer
http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/numeric_data_types_table/
http://www.ni.com/gettingstarted/labviewbasics/datastructures.htm
08-28-2014 03:47 AM
Hello I'm also facing that problem now...And I do read the website you give
But I don't find the way to convert double to 1D array double...
Could you give more suggestions?
Thank you!
08-28-2014 11:50 AM
@AmeHyesung wrote:
Hello I'm also facing that problem now...And I do read the website you give
But I don't find the way to convert double to 1D array double...
An understanding of what the data represents is important, and knowing this will likely answer your question for you.
Lets say you have a single analog reading of 5 volts. This is a scalar double. Now you want to graph it so you grab the Waveform Graph and put it on the front panel. But when you wire your 5V reading to the graph it says you need to provide a 1D array. This makes sense when you realize the graph is intended to display many values at once, not just one value. This is why it wants an array of values to put on the graph all at once.
Your single reading can be turned into an array using the Build Array function, but it is still just a single reading. If you wired your 5V reading to a build array then to the graph it would run, but what would you see? Nothing because the graph can't display a single point of data, it needs multiple values. So you could try to build previous 5V readings into the array so you have multiple values to display at once.
Your situation is similar, you need to understand why you have a single double, and you need to understand why your function needs an array of doubles. Then you can realize how to fix it.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
08-28-2014 01:08 PM
@AmeHyesung wrote:
Hello I'm also facing that problem now...And I do read the website you give
But I don't find the way to convert double to 1D array double...
Hooovahh already gave you some good advice.
We clearly need more information to give a precise answer. Are you dealing with a simulation node as above? Are you just trying to graph your data? If you want to graph a series of scalars over time, a chart is the easiest. I accpets a scalar and internally keeps a history buffer of a given size, allowing you to graph the last N element that arrive at the terminal.
Please show us your (broken) code so we can see what you are trying to do. The solution will most likely be very simple.
04-26-2021 02:19 PM
I'm certainly not an expert, as I'm just beginning to learn labview. But I managed to convert a 'double' to a '1D' by using the "Build Array" function. Hope this helps.
04-26-2021 02:27 PM
I don't think your message helps much when the answer was already given in this thread 7 years ago.