//Do some code of sending command file
//Wait until answer file received
while(!_answerFileReceived){}
//Process answer file and return Invoice number
_answerFileReceived = true;