LabVIEW

cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

write and read serial port

Hi there,

please help me..i want to read my gsm inbox using com port. i write a code to read the inbox msg to the serial port, wait for 250ms and read the serial port to read the inbox. my problem is, my msg in the inbox will be seperated into two msg which means that the msg was not in one line. my program will detect the msg is error. then i try to add the break length and use the defult value(250). Then, the received msg become correct, when i try to read the second msg received, the msg break up into two msg again and make the msg error. so i have no idea i should i do. is it about the buffer? how can i set the buffer? please help..i need the answer asap...thanks...
Download All
Message 1 of 4
(2,959 Views)
Hi gdah,
to set the buffer size you can use the "Set I/O Buffer Size" function. If you receive both message seperatly, then you can use a shift register to store your data from iteration to iteration and check if your message is complete.

Hope it helps.
Mike
0 Kudos
Message 2 of 4
(2,951 Views)
I currently can't look into your code,
however, common pitfalls with RS232:
- termination characters: in your case , are they deaktivated for read?
- timeout: does your read time out?
- something left in the buffer: flush the buffer before requesting data.


Greetings from Germany
Henrik

LV since v3.1

ā€œgroundā€ is a convenient fantasy

'˙˙˙˙uıɐʃɐ lɐıp puɐ °06 ĒuoÉ„d ɹnoŹŽ uɹnʇ ĒsÉĒld 'ŹŽÉ¹Éuıƃɐɯı sı pĒlɐıp ĒŹŒÉÉ„ noŹŽ É¹ĒqÉÆnu ĒÉ„Ź‡'


0 Kudos
Message 3 of 4
(2,934 Views)
Hi gdah,
don“t open the Visa connection inside a loop. Open it ones, work with it inside the loop and close it after the loop.
Mike
0 Kudos
Message 4 of 4
(2,932 Views)