LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Assigning index Array to values and match with string values

Solved!
Go to solution

Hii

i need to assign Index array to the values and matching with selective string array in Labview

for example [0] =500 it should be Assigned matched to with the string array "Apple" so the input should be Apple [0] and output is 500 [ Apple[0]=500]

so i dont have the idea of logics regarding this 

if there are any Example Vi Kindly Provide it would be much helpful for us in developing in project we are in very tight stage kindly support .

 

 

siddhu01_0-1708347668311.png

 

0 Kudos
Message 1 of 13
(1,035 Views)

Hi siddhu,

 


@siddhu01 wrote:

i need to assign Index array to the values and matching with selective string array in Labview

for example [0] =500 it should be Assigned matched to with the string array "Apple" so the input should be Apple [0] and output is 500 [ Apple[0]=500]


So you want to replace an array element? What about using ReplaceArraySubset?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 13
(1,031 Views)

@siddhu01 wrote:

i need to assign Index array to the values and matching with selective string array in Labview

for example [0] =500 it should be Assigned matched to with the string array "Apple" so the input should be Apple [0] and output is 500 [ Apple[0]=500]

so i dont have the idea of logics regarding this 

if there are any Example Vi Kindly Provide it would be much helpful for us in developing in project we are in very tight stage kindly support .

 

 

siddhu01_0-1708347668311.png

 


Sorry, your description is not clear at all. Is "apple" the label of the string array or one of the values? Is "500" a numeric value or a string with three letters? How many arrays do you have, how big are they, and where do they come from?

 

As a first step, attach a simplified version of your VI and explain the problem. What does your image show? (Does not look like anything LabVIEW related.)

 

To store key/value pairs, you could use a map instead of an array.

Message 3 of 13
(997 Views)

It's not really clear to me what you are trying to accomplish.

Based on your description, it sounds like you want to take the contents of an array of numerics,  named "Index" and copy them to an array of strings, called "Apple".

If that is what you want, you can do it like this:

 

paul_a_cardinale_1-1708357286346.png

 

Message 4 of 13
(993 Views)

Hii Gerd 

acutally yes i need to replace array element into array subset to find values by using along with index .

 

For example 

Apple - String

[1]- index number

500- Value 

so i need the index number to be assigned both String and Value so that i can able to search string along with index 

 

is there are similar Concepts pls provide the vi example it would be much Helpful 

 

0 Kudos
Message 5 of 13
(965 Views)

Hi Alten 

siddhu01_0-1708406649099.png

i have updated the image above as u can see  the string array Rte_SchM_rt_min has unsigned long [6] which mean each index have seperate values 

 

for example [0] = 0 or any values so i need to implement [0] has 0 values and need to assigned with string array Rte_SchM_rt_MIN 

 

Finally it should be like  Rte_scHm_rt_min[0] =0 

 

this method i need to implement in labview kindly support on this .

0 Kudos
Message 6 of 13
(959 Views)

Hi siddhu,

 


@siddhu01 wrote:

for example [0] = 0 or any values so i need to implement [0] has 0 values and need to assigned with string array Rte_SchM_rt_MIN 

 

Finally it should be like  Rte_scHm_rt_min[0] =0 

 

this method i need to implement in labview kindly support on this .


Use array functions like InitArray or ReplaceArraySubset!

 


@siddhu01 wrote:

Hi Alten 

siddhu01_0-1708406649099.png

i have updated the image above as u can see  the string array Rte_SchM_rt_min has unsigned long [6] which mean each index have seperate values 


So there is an array of 6 integer values with a label of "Rte...": you need InitArray and an array indicator with the correct label.

 

What have you tried and where are you stuck?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 13
(939 Views)

Hi Gerd Thanks for the Response 

2. So there is an array of 6 integer values with a label of "Rte...": you need InitArray and an array indicator with the correct label.

 

What have you tried and where are you stuck?

actually i am new to LabVIEW so i don't know to implement this idea  i have tried with Mutiple methods like combine the index number with specific value and match with string array but its doesn't work so kindly help on this !!

0 Kudos
Message 8 of 13
(931 Views)

Hi siddhu,

 


@siddhu01 wrote:

What have you tried and where are you stuck?

actually i am new to LabVIEW so i don't know to implement this idea  i have tried with Mutiple methods like combine the index number with specific value and match with string array but its doesn't work so kindly help on this !!


When you are new to LabVIEW then I recommend those Training resources offered at the top of the LabVIEW board!

 

I really don't understand your "multiple methods": how did you "combine index number with specific value"? Why/how do you "match with string array"?

What exactly "doesn't work"?

 

Please show your code!

(Please attach real code aka VIs. When you use a recent LabVIEW version then I recommend to downconvert the code using File->Save for previous. I prefer LV2019.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 13
(911 Views)

@siddhu01 wrote:

Hii Gerd 

acutally yes i need to replace array element into array subset to find values by using along with index .

 

For example 

Apple - String

[1]- index number

500- Value 

so i need the index number to be assigned both String and Value so that i can able to search string along with index 

 

is there are similar Concepts pls provide the vi example it would be much Helpful 

 


I still have no idea what you are trying to accomplish.

0 Kudos
Message 10 of 13
(896 Views)