LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Read unknown bytes no termination character

Solved!
Go to solution

Thank you for all the input I've gotten. I now know that I should be more consistent with the information that I give, and try to be even more detailed from the start.

 

Bob_Schors solution was in my mind the simplest and it took me ~2 minutes to implement and works beautifully, so I will go with this for now. 

 

Thanks again

 

//Marcurah

0 Kudos
Message 11 of 14
(460 Views)

First a shameless plug: VIWeek 2020/Proper way to communicate over serial

 

Secondly, this sounds a lot like (Linux) terminals I have to deal with all the time.  You send a command, it echos the command, and then sends the result.  So what I have done is create a loop that just continuously reads.  I will use Bytes At Port to see if there is anything to read, and then read a full line if there is.  I can then send this data through a queue for somebody else to process.  The other side just needs to know how many lines it wants in order to process.  My terminal library is actually a lot more involved than that (I have logging, filtering for which lines to be returned through which queue, etc), but those are the basics.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 12 of 14
(452 Views)

Reading this entire thread makes me believe that you don't understand what your device does and what you expect from it. That's not a knock against you. It's just getting familiar with your device is all.

 

Do you have any documentation on the device? If you attach that, we could probably help you MUCH better.

0 Kudos
Message 13 of 14
(448 Views)

@crossrulz wrote:

First a shameless plug: VIWeek 2020/Proper way to communicate over serial

 

Secondly, this sounds a lot like (Linux) terminals I have to deal with all the time.  You send a command, it echos the command, and then sends the result.  So what I have done is create a loop that just continuously reads.  I will use Bytes At Port to see if there is anything to read, and then read a full line if there is.  I can then send this data through a queue for somebody else to process.  The other side just needs to know how many lines it wants in order to process.  My terminal library is actually a lot more involved than that (I have logging, filtering for which lines to be returned through which queue, etc), but those are the basics.


Thank you to @crossrulz for suggesting using Bytes At Port. Because of the "rule" never use Bytes At Port, most people avoid using it for any circumstance, even when it is the best method. Globals, Locals, and Bytes At Port all have their use cases. Yes they can be abused and overused, but there are correct use cases. Personally I believe that Bytes At Port is appropriate for the OP for their use case. (Yes I know I will be down voted for this.) To the OP, turn off Termination characters to use the VI.

 

Below is an example, 2015 version attached.

 

mcduff

 

snip.png

 

 

0 Kudos
Message 14 of 14
(436 Views)