LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can an event of data arriving at serial port can be automatically triggered?(without using a while loop)

Hi All
 
I want my application to read data from serial port every time it arrives.
 
I dont want to use a while loop.I just want to execute the event like an interrupt which is automatically fired.
 
That is,if in event time out the code will be automatically executed without any user interaction.And it can work without a while loop also.
Like that without using a while loop i would be able to execute my code each time there are some byte in the serial port.
Is it possible?
 
Thanks in advance.
 
 
0 Kudos
Message 1 of 3
(2,630 Views)

Put the communication in its own state machine. states = initialize port, read and close port.  the read state can cait until enough bits or a termination character is found and timeouts can be cleared (since the arival rate is unknown.)  this loop will run only as fast as the arivat of messages, when a message is recieved queue it over to a handler loop.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 2 of 3
(2,613 Views)

Take a look into the shipped examples....

Detect Break Event.vi is one whitch should be easely adapted to your needs.

 

 

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 ǝɥʇ'


Message 3 of 3
(2,611 Views)