LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

conversion from double to 1d array of double

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.

Download All
0 Kudos
Message 1 of 7
(15,257 Views)

-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

Thanks
uday
0 Kudos
Message 2 of 7
(15,245 Views)

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!

Message 3 of 7
(14,737 Views)

@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.

0 Kudos
Message 4 of 7
(14,715 Views)

@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.

0 Kudos
Message 5 of 7
(14,698 Views)

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. 

0 Kudos
Message 6 of 7
(5,003 Views)

I don't think your message helps much when the answer was already given in this thread 7 years ago.

Message 7 of 7
(4,998 Views)