05-29-2015 01:26 AM
Hi,
using the shift register helped, thank you for that
I also deleted the wait and the byte at serial port, and the programm is still working.
Thank you all
05-29-2015 09:10 AM
Glad we could help.
05-29-2015 09:52 AM
As we have said, the idea of the Wait and Bytes at Port came from NI's example. If you don't want to use Bytes at Port to handle the case where no data is received (cable unplugged, instrument off, wrong baud rate, etc.), you will have to handle the timeout error which will occur in that case. Are you doing that?
You can try it with my example. If you wire up a large number to the byte count of the VISA Read and disconnect or power off your serial instrument, you will get this error message when you click the Stop button, as I do:
If you wire Bytes at Port to byte count, you won't get the error because you told the VISA read there was nothing to read, so it returns (continues) gracefully.
I modified my vi by adding a Boolean control which, if True, wires 0 to the Wait and 1000 to the byte count. If False, Bytes at Port is connected to byte count. That way I can test both methods easily. I call that control "Max Speed Test" because it runs "open loop" as fast as the instrument can respond.
03-04-2020 08:14 PM
Thanks for sharing the .vi file. I was looking for it and couldn't find it anywhere.
03-05-2020 11:51 AM
Atapour,
Glad it helped. (This is the first addition to this forum thread in 5 years!)
(On page 1 of this thread Dennis said, "Shift registers are a basic concept and are shown in numerous examples and tutorials." Yes, that is true, but I haven't seen anywhere that this is applied specifically to NI's Serial Write and Read type example. As I said, I got it from a NI phone tech support person (who himself had to research it internally) when I first started using LabVIEW. I also agree that NI (if you are listening) need to update serial examples. But I haven't checked in a while so I don't know where this stands. But since Atapour asked this question, I assume he did research this and found only this post.)
Cheers!
Ed