01-26-2018 06:27 AM
Hi all,
I'm new with LABVIEW and currently I'm doing write and read serial simultaneously in two separated while loop (read and write).
The first while loop (read serial) is working fine where it will continue read serial without condition.
The second while loop (write serial) will send serial write only when i send boolean true (1).
My problem now is whenever I send a string through serial write, it will read twice for what i have sent.
For example, I try to send "Hello" through serial write but it come out as "HelloHello" in read serial.
I want the serial read the exactly string i had sent through serial write.
Can any LABVIEW PRO help me??
Thanks.
Solved! Go to Solution.
01-26-2018 06:34 AM
Can't troubleshoot your code without the code. Post your VI.
01-26-2018 07:18 AM
Hi Crossrulz,
Thank you for the fast reply. I have attached the VI.
My problem:
If i send a string "Hi" through the control string (SEND COMMAND). it will hold until i press the (SEND) boolean button.
I should receive "Hi" from the read indicator (READ) instead of "HiHi".
Thanks.
01-26-2018 07:25 AM
Sorry, let me update my VI.
thanks
01-26-2018 08:04 AM
Looks like you have a race condition.
1. Change the mechanical action of the Send to be a Latch When Released. This will cause it to be reset when the terminal is read.
2. Get rid of the Reinit To Default. If you follow 1, they are not needed.
3. No need for that loop inside of your write loop. That can cause an infinite loop. Even better would be to replace it with an Event Structure. Then you can detect the Send button's value changing and only send in that case.