LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Include constant in Array

Solved!
Go to solution

Hello All,

Using the ramp function i have generated an arry of Values from my min, max and the step. Now i want to add another array with 2 constants alternately along with this array. Such that if i have 10 values in this array then the constants should be inserted only 10 times alternately and if this array has 100 values then accordingly. A short example is shown in the attachment!

 

Regards!

 

 Array with constants.png

0 Kudos
Message 1 of 6
(2,900 Views)

I am not sure I understand your goal here.  Perhaps an example of data would help (what you have coming in and what you expect as a result).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(2,878 Views)
Solution
Accepted by topic author acuteboy

This should do what your example shows.  I'm sure there is a more elegant solution than this but it's what I got.  

Example_VI_BD.png

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 3 of 6
(2,872 Views)

Hi,

 

I want an array in this format (see picture). The first column can be created using the ramp funtion as shown above with the help of Min, Max and step values as inputs. I want to include the second column where i can insert two constant values alternatively.

 

Format1.png

0 Kudos
Message 4 of 6
(2,871 Views)

@aputman wrote:

This should do what your example shows.  I'm sure there is a more elegant solution than this but it's what I got.  

Example_VI_BD.png


Actually you can get rid of the transpose by moving the "Build Array" inside the while loop and wire it up with the input array. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 5 of 6
(2,863 Views)
Solution
Accepted by topic author acuteboy

Hi,

 

another approach:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 6
(2,855 Views)