LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Formatting Pipe Data, Losing Character Every Loop Read, Linux

I'm reading from a command pipe continuously in Linux and the data is comma delineated. The issue is every loop read offsets the characters by one so my array is not correct, only once in a while and causing data loss in the columns. I have tried all kinds of string formatting including termination and It still doesn't work. If I add a shift register to grab the previous string I can concatenate them and it works for only one loop iteration.   Any help would be greatly appreciated. I have attached a screen shot. 

Thanks!

Tom

0 Kudos
Message 1 of 4
(742 Views)

I am having a similar, maybe even same issue.  The problem I seem to be experiencing is not being able to read the strings one line at a time.  It seems we need to have some sort of Read Line function similar to what you find in other programming languages.  I have been messing with things such as buffer size but the problem seems to be no matter what the string coming out of my pipe is just the amount of string to fill the buffer.  The problem is like almost all command line programs, the data being printed to the terminal will likely vary in length.  If I were able to set the buffer for each iteration of the loop to whatever size it is to the end of the line \n char as a buffer i might be ok.  But that seems like a lot of work and I don't see a path with the functions available.  Sorry, not trying to hijack your post but I am currently in the same situation.  I will follow your post.  I have one hell of a mess i got to get back to cleaning up here.  Gonna need one hell of a broomstick for this disaster I have going on.  Good luck!

0 Kudos
Message 2 of 4
(696 Views)

Please attach your actual VI(s) -- we can tell a lot more from "actual code" than we can from "pictures of code" (plus we can even "try it ourselves").

 

Bob Schor

0 Kudos
Message 3 of 4
(667 Views)

I have uploaded the VI. Unfortunatly the command program is to large to send so I am not sure if you can replicate the behavior. I can tell you that have have tried reading any command program that prints to stdout and I do get the same behavior. See attached and thank you. 

0 Kudos
Message 4 of 4
(655 Views)