05-25-2018 01:52 PM
Hi i want to read a file to give as an input voltage for a ni-usb.i got a code where i choose between a constant value and a text.The constant value is ok but the text doesnt work when i try to measure with the multimeter.
05-25-2018 04:20 PM
diro,
Could you provide an example text file that you're trying to use?
05-25-2018 04:58 PM
05-25-2018 10:58 PM
In your text file VI, you are using the string "\n" as the end of file constant, but since it is in normal mode, it is a literal backslash and "n". You want to make that constant have \codes display. then edit it so it shows "\n" which at that point will be a linefeed character.
You may have more work to do with that because a typical Spreadsheet string to Array is for 2-D arrays, not 1-D arrays, and the rest of the code makes it hard to determine if you are indexing out the value you want.
05-26-2018 07:37 AM
I made some changes.Also I did make that constant have \codes display. I also tried to make the spreadsheet string to array a 1d array by using Initialize array.At path_1.vi i get to show only the first value of the text.And an the 1ni.vi it doesnt even appear the 1st value
05-26-2018 02:26 PM
Here are cleaned up versions of 2 of your VI's. It got rid of some Rube Goldberg constructs as well.
When working with indices, they should be I32 integers and not Doubles.
Don't call a numeric indicator "String" when it is a numeric.
I changed the handling of your file so that it treats like incoming string data as a 2-D string (which is what spreadsheet string to array creates) and then picks out the only column that exists in that array.