02-18-2021 08:03 AM
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
02-18-2021 08:57 AM
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.
02-18-2021 09:26 AM
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.
02-18-2021 10:54 AM
@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