LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read and write simultaniously

I need to write a '/' to the device connected to com1 and then wait for a '/ok' from this device. I realised a program that does this exept for the part where it write's. the reson for this is that, before I can write, I first have to clear some sort of read-buffer.

for example: (I used the terminal to test this)
I used a 3 byte read buffer (bytes to read) and send a '\0xA(=\n)' with the program then I type '123' in the terminal screen. the program displays these numbers and writes the '\' to the screen. my conclusion is that the action I want to perform is done in reverse.

is it possible to close or stop the reading before the 'bytes to read'-value has been reached?

memmo
0 Kudos
Message 1 of 8
(2,908 Views)
I'm not sure I fully understood what you're doing. If you run a read VI with an input of 3 bytes to read, it will read the 3 bytes and only then the code will continue execution. If you want to clear the buffer, you can use the Bytes at Serial port node followed by a Read VI. I suggest you post your code here so we can have a look.

___________________
Try to take over the world!
0 Kudos
Message 2 of 8
(2,897 Views)
how do I post code :$...
0 Kudos
Message 3 of 8
(2,892 Views)
When you write a message, you can find an attachment section under the section where you write the post. You can upload one file by clicking the Browse button. Browse to your VI, or if you have a number of VIs, save them in a zip file and upload that file.

___________________
Try to take over the world!
0 Kudos
Message 4 of 8
(2,889 Views)
this is it. I just added some sort of Flush IO Buffer but it didn't work.
0 Kudos
Message 5 of 8
(2,882 Views)
If I understand you want to write / and recieve /OK. If so, you simply need to do something like this:

___________________
Try to take over the world!
0 Kudos
Message 6 of 8
(2,853 Views)
I tried what you suggested unfortunatly unsuccesfull.
This is what I did. (three jpg's)
0 Kudos
Message 7 of 8
(2,842 Views)
YAHOO!!! I used your idee to combine it with mine and it worked.

Thanks!!
0 Kudos
Message 8 of 8
(2,833 Views)