// Устройство
int _tmain(int argc, _TCHAR* argv[])
{
string ok;

cout<<"type dev"<<endl;
cout<<"wait event all_loaded"<<endl;//
cin>>ok;

cout<<"event started"<<endl;
cout<<"wait event all_started"<<endl;//
cin>>ok;

int value=0;
while(true)
{
{
Sleep(1000);
// Чтение физического устройства
}

ok="";

cout<<"get call get 0"<<endl;//
cin>>ok;
if(ok=="ok")
{
value++;
cout<<"ret ok"<<endl<<value<<endl<<endl;//
}

if(ok=="")
return -1;
}

return 0;
}
// Лабораторная
int _tmain(int argc, _TCHAR* argv[])
{
string ok;

cout<<"type lab"<<endl;
cout<<"wait event all_started"<<endl;
cin>>ok;

while(true)
{
int measure_count=5;

ok.clear();

for(int i=0; i<measure_count; i++ )
{
int v1;
int v2;

cout<<"call get v1"<<endl<<endl;//
cout<<"wait getret 1"<<endl;//
cin>>ok>>v1;

cout<<"call get v2"<<endl<<endl;//
cout<<"wait getret 1"<<endl;//
cin>>ok>>v2;

{
cout<<"get event ui_stop"<<endl;//
cin>>ok;
if(ok!="no")
break;
}

Sleep(500);
}

if(ok=="")
return -1;
}

return 0;
}