Running into a weird issue with my serial receive data routine. Device is chatty and I sometimes get two complete response messages in a single logic wave. When this occurs, the second message is not sent to the S# object until the next message comes into the buffer from the device. I need it to recognize that there is a second message waiting in From_Device and process immediately.
In the example code below, From_Device is a buffer_input, MyDevice is a S# class. Issue occurs regardless of whether or not I use the while (1) or the while (len(from_device) model.
Code:
threadsafe change From_Device
{
string rx[1024];
while( len( From_Device ) > 0 )
//while (1)
{
rx = gather( "\n", From_Device );
print("Sending RxData: %s", rx);
myDevice.ReceiveData( rx );
}
}
Anyone have any ideas on this one? Any help would be appreciated.
erik