LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert a Decimal Numeric to Hex String of 2 BYTES

Solved!
Go to solution

Hi Nayan,

 

could you please attach your Vi in LV2011 again?

 

For your question: Do you replace array subsets or do you build an array by appending new elements?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 11 of 20
(1,761 Views)

Here is the converted vi.

0 Kudos
Message 12 of 20
(1,758 Views)

Hi Nayan,

 

you insert new elements in your array at Index zero using InsertIntoArray function. And now you wonder why each call of your VI inserts a new element? Really?

Did you read the help for that function?

 

When you want to replace elements at certain indices of your array you need to define an array with those elements and use ReplaceArrayElements!

Best regards,
GerdW


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

Thax.

 

I tried 'Replace Array subset' function, but problem here was if I have an emplty array, it will not accept the value.

Is there any option that even if the array is empty it should replace the value what I wanted?? 

0 Kudos
Message 14 of 20
(1,752 Views)

Hi Nayan,

 

when the array is empty then there is no element you can replace. Sounds ok for me!

 

As I said before: you need to define an array with some elements. Or you need to implement some logic to append new elements when the y don't exist before…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 15 of 20
(1,747 Views)

How you will get the index for Empty array to replace your data ?

If you know your size of your array then 1st build array & replace your indices. If you don’t know about array size then check array and index.

If array is empty/index value is out of your array size then just add that element to array (using Build array) else replace  same as you mentioned.

Munna
Message 16 of 20
(1,747 Views)

Thanks to both of you.

 

I have 2965 elements in the array, so created it first and now will use Replace Array Subset function.

0 Kudos
Message 17 of 20
(1,736 Views)

If your replacing data continuously in a loop then use Shift registers to pass your data else you will get Array with Last updated Index.

Munna
0 Kudos
Message 18 of 20
(1,730 Views)

I am not replacing the data continuously in a loop here, but thanx for the valuable suggestion.

0 Kudos
Message 19 of 20
(1,723 Views)

@Nayan wrote:

Thanks to both of you.

 

I have 2965 elements in the array, so created it first and now will use Replace Array Subset function.


Please show your latest code. Your earlier VI made no sense at all.

0 Kudos
Message 20 of 20
(1,694 Views)