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?
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.
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.