The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Keyboard input
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

gilles wat

France
20 Posts

Posted - 01/22/2004 :  11:41:36 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,
When a origin C programm runs, the mouse or the keyboard are disable.
During an acquisition from a GPIB port, I cannot change, for exemple, a gain scope without breaking the process.
How can I read a character from the console ( in MSN C++ _getch) or use a click on a UIM radio button.
(Origin 7 SR4)
Thank you
Gilles

cpyang

USA
1406 Posts

Posted - 01/22/2004 :  5:23:27 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This is tough, multithreading support for Origin C would be required to do what you want. Until then, you can insert the LabTalk wait command to allow Origin to run during that wait time. The follow code shows how the DataDisplay bar will continue to be updated until you type

junk=1;

into the script window.




void test(int nMax = 100000)
{
string str;
for(int ii = 0; ii < nMax;ii++)
{
str.Format("%d:Please set Junk to 1 to stop", ii);
SetDataDisplayText(str);
double vv;
LT_get_var("junk", &vv);
if(vv > 0)
break;

LT_execute("sec -p 0.2"); // wait 0.2 sec to let Origin run/process its messages.
}
if(ii < nMax)
out_str("user has stopped the loop from LabTalk");
}





CP


Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000