07-27-2016 08:07 PM - edited 07-27-2016 08:11 PM
Hello. I'm using the Continuous Serial Read and Write.vi example in LabVIEW, and I want to modify it so that I only write a single message rather than having it write continuously. How can I do this? I've been trying to figure out how to do it but the problem is I'm having very inconsistent results with reading back what I send, so I have no idea what's actually working and what isn't. What I think works is setting the Write switch mechanical action to Latch When Released, which seems to work most of the time...but sometimes when I click Read I don't get anything after writing.
Solved! Go to Solution.
07-27-2016 08:23 PM
Don't use a switch or a case structure at all for the read. Just let it read.
You are best off putting the write and read in the same case structure for the write button. You click the button, it writes. It reads, if you don't get anything back within the timeout period, it would certainly be a problem with your device or cable rather than with LabVIEW.
07-27-2016 08:27 PM
The Write and the Read buttons should be set to Latch When Released.
Are you using a loopback cable for your testing here? Or are you trying to program a microcontroller that just does sends the same thing back to you? I'm just looking for other things that could be wrong. It might also help us give you better advice if you explained what your end goal is here.
07-27-2016 08:28 PM - edited 07-27-2016 08:36 PM
Wow I didn't even consider that at all. Thanks, I'll give that a shot!
edit: Yes, I am just sending messages to an Arduino which sends it back. I had tried sending the Read button to latch when released but that didn't seem to work. However, putting the read operation directly after the write without having a separate button did the trick.