From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading the first character in every row

Solved!
Go to solution

The numbers in the file is a bit random, when running the whole system we will send one 4-bit number at a time. (Corresponding to 1-F so 16 different numbers in total.)

So for example if we sent 3, the input file would be lots of zeros then 0,0,1,1. We will probably implement another 1 before the number as well so the computer know when to "start recieving". (We are supposed to send from one computer and recieve with another so we would have to do something like that.)

This looks really close to a solution though, the only problem left would be to make it "start reading" when it recieves the first 1. (And also to not include that one in the number displayed..) Thanks alot! 🙂

0 Kudos
Message 11 of 15
(784 Views)

Okay so I think Ive almost figured it out now with the help from you guys! 🙂 Just one last thing:

vi2.png

Does anyone know if its possible to put all the values on one row instead of one on each somewhere in the process? That would solve the entire thing for me! 

Thanks 🙂

0 Kudos
Message 12 of 15
(759 Views)

Tobf wrote:

Does anyone know if its possible to put all the values on one row instead of one on each somewhere in the process? That would solve the entire thing for me! 

Thanks 🙂


Your program makes very little sense.

 

Why don't you read it as integers since you are throwing away the decimal digits anyway?

Now you have an array of single digit strings (0 or 1) that you can concatenate into a string of 0, 1, for example.

Message 13 of 15
(749 Views)
Solution
Accepted by topic author Tobf

It should be pretty easy to place them all on one line, simply remove the EOL or equivalent from the string. It may take some fiddling to get the correct delineator (EOL, CR or NL) but shouldn't be too hard.

Replace.png

Of course the easier way would be to simply write all of your data to the file as a single long string or use a binary data file.

 

Might I recommend the "Write Binary File.vi" and "Read Binary File.vi" examples in example finder (Help->Find Examples)

 

Message 14 of 15
(748 Views)

Working as intended now with this fix! Big thank you for the help guys 🙂

0 Kudos
Message 15 of 15
(709 Views)