Hello!!
MMM!!! y have problems tryng to programm the serial port. That is the trouble: Im programming a protocol emulator of a gauge measurement system from Mitutuyo (digimatic) this allows PC to acquire data from attached to Rs232 measurement gauges in two ways, first the PC sends command through the port and the gauge receives it and sends back the current measurement value, the second one is from the gauge, this has a button that sends the data to the PC through the same serial port.
Well my problem is that I improve afuntion that starts the measurement process but i need to listeng for incoming data or wait for a command from the user to request data from the gauge. I started a thread in wich I read the port for d
ata, if ther's data available then the routine process it, I set the comtime to 0.01, each time the data goes it just reads part of the chain data, but if i set the time greater or equal to 0.01 the program becomes to slow.
I use a thread safe variable for process the data, but i want to block the listening proces when the user sends a request command, and when finish, resume the listeing process without making user interface slow
How I can make for perform the two actions at almost the same time blocking the listening process when the user request data from the PC?