08-09-2016 04:37 PM
hello all so im sending data from my app that has push buttons to a text file and i want labview to read this text file. The text file will be in the following format.
08
0c
03........ etc.
and so on in hex, each number depends on which pushbutton are pressed there are 4 pushbutton so 16 different possibilites. When a pushbutton is pressed it will correspond to the leds on the myrio so if i get the hex value 07 then led 0,1,2 will turn om, 08 hex led3 will turn on and so on. I have done the following to read the text file and use a for loop to read each line into a array. now i want to covert the hex value to binary format for the leds and also not sure which vis can read each number at a time correspond it the leds.
08-09-2016 04:41 PM
Hi muscles,
how do you save the text file?
What is the reason to use a FOR loop set to iterate just once?
Why do you read 100 lines at once?
You end up with a 2D array of numbers: when you want single elements you should use ArrayIndex…
08-09-2016 04:48 PM
08-09-2016 05:05 PM
08-10-2016 01:09 AM
08-10-2016 10:35 AM
Okay i attached the txt document and as you can see there are only a few lines but as i said the lines depend on how long im pressing the push buttons in my app. But they send hex values that should correspond to the leds on the myrio.
08-10-2016 12:18 PM
08-10-2016 01:42 PM
thank you cant believe it was that easy i guess i was over thinking it.
I have a problem though it doesnt seem to wanna work on the myrio leds or anything when i run it. When i press run all that happens is that the deploy box shows up dowloands and says it was a sucess and that it then the program stops.
Its works though when not using a myrio target vi.
Also when i use run example programs on the myrio to test it working they work but not my program.
See attached how i set up
08-10-2016 02:05 PM
Is the file actually on the myRIO? You need to think of the myRIO as another computer. Therefore it does not have access to your computer's harddrive. You need to use WebDAV or FTP to put the file on your myRIO and then make sure the file control is looking in the right place.
08-10-2016 02:14 PM
Hi muscles,
says it was a sucess and that it then the program stops.
Basic LabVIEW knowledge: when a function provides an error output you should (have to!) check it.
You did not check the error output of the ReadText function. Please do so!