LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

help with 2d array and convert string to number

hello there,
i am having 2 problems.

the first problem is sometimes when i retrieve the data for some reason it won't place it on the top of the 2d array. the 2 pictures i attached shows a NO (what i don't want it to be) and another picture of how it's suppose to be. basically i want to get the extracted data on the top and not on some rows on the bottom

the second problem i am having, is if you look at the pictures, it is being outputted as a string. since there is only 1 value being returned and it's a number, how can i make it so it is returned as a number and not a string (need this because this vi is a subvi for something else) i tried a string to number conversion, but then it doesn't even display anything.

please let me know if someone comes up with anything 🙂 thanks in advance!
Download All
0 Kudos
Message 1 of 10
(3,841 Views)
UPDATE: alright i think i almost solved problem 2. i was using decimal string to number and it didn't work but using frat/exp string to number works. only problem with that is that it rounds to the tenth and i need it to keep at least 3 decimals after the decimal point instead of 1. any ideas how to do that?
0 Kudos
Message 2 of 10
(3,838 Views)
That function converts all the decimal places that exist in the input string. Create a simple VI that passes to the function a string containing "4.678". Wire an indicator to the output and by default the indicator will display all three decimal places. If you are seeing something different check to see if the formatting of the indicator has been changed. You can set them to display a fixed number of decimal places. But even this does not change the data that is present - just what you see.

In terms of your problem #1, can you post the code?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 10
(3,829 Views)
still can't get it to go to more than 3 digits. added an indicator and changed precision in front panel doesn't work. look at help3

for problem #1 i attached help4
Download All
0 Kudos
Message 4 of 10
(3,809 Views)
Set the precision to 14 and you will see every digit.
0 Kudos
Message 5 of 10
(3,790 Views)
worked ty 🙂 any ideas on problem1? one thing i noticed is sometimes when i grab data out of database it does it correctly and puts in on top leftmost array locations but sometimes it doesn't Smiley Sad
0 Kudos
Message 6 of 10
(3,786 Views)

In the Data Return String, it looks like there is a CR or LF at the beginning. Can't tell where it might be coming from since you didn't post the VI and even if you did, couldn't run it without the database and the database toolkit. The only thing I can suggest is to use some probes or temporary indicators to see where it comes from. If you see a string indicator to '\' Codes display, you will see what the actual character is.

0 Kudos
Message 7 of 10
(3,771 Views)
i still couldn't find the problem, but i fixed it by extracting and combining strings from the 1st two boxes. but i need help copying data from excel into a 1D array 😞 any ideas? i searched but no luck
0 Kudos
Message 8 of 10
(3,759 Views)
basically i want to be able to copy a column from excel and be able to paste them all into the attached array box. atm, only the first cell is pasted
0 Kudos
Message 9 of 10
(3,757 Views)

Hello,

Check out the following link for getting data from a Microsoft Excel file and putting into an array.


http://forums.ni.com/ni/board/message?board.id=170&message.id=205282&requireLogin=False

Take Care!
reggier

0 Kudos
Message 10 of 10
(3,682 Views)