LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

use array to store negative number

Hi,
   I use "Initialize array" to set all the 500 elements to "0". Then I input numbers to  "Replace Array Subset"  and generate a new array. But all the positive numbers are correct, negative numbers just become "0". Why? How can I store the negative number in this array?
   Thank you in advance!
0 Kudos
Message 1 of 6
(3,923 Views)
Hi,
what data type (numeric representation) are you using for the array elements? If it is integer, make sure it's not unsigned (U8, U16, ...) as this data type doesn't allow negative numbers.
Hope this helps
0 Kudos
Message 2 of 6
(3,921 Views)
Thank you! But how to set the data type of array elements?
0 Kudos
Message 3 of 6
(3,917 Views)
Right click on array, then REPRESENTATION, Then DBL

Fakstory
0 Kudos
Message 4 of 6
(3,911 Views)
Thank you very much, Fak Story!
0 Kudos
Message 5 of 6
(3,884 Views)
No problem,

                     Forum makes live easier!

FakStory
0 Kudos
Message 6 of 6
(3,874 Views)