T O P I C R E V I E W |
gilles wat |
Posted - 09/24/2003 : 12:25:26 PM Does anybody know how insert a time out in a loop. thank you gilles |
6 L A T E S T R E P L I E S (Newest First) |
cpyang |
Posted - 10/20/2003 : 05:38:49 AM It is better to write
#pragma dll(msvcrt, system)
to avoid hard coded path to your msvcrt dll.
CP
|
gilles wat |
Posted - 09/29/2003 : 11:20:29 AM Thank you for all. I am added the function time to Origin C with the header:
#include <common.h> #pragma dll(c:\WINNT\SYSTEM32\Msvcrt) typedef long time_t; typedef long* ptime;
int __cdecl _inp(unsigned short port); int __cdecl _outp(unsigned short port, int value); time_t __cdecl time(ptime temps);
|
cpyang |
Posted - 09/25/2003 : 8:01:09 PM You can test time by using GetTickCount, and use either
Sleep(N);// Origin will wait, nothing can be done in Origin
or
LT_execute("set -p 0.5"); // you can still do other things in Origin while waiting
CP
|
Mike Buess |
Posted - 09/25/2003 : 08:59:05 AM Hi gilles,
Can't you use Sleep in a do or while loop and require a status change to exit the loop? Something like this...
do { Sleep(100); } while (//-no status change-);
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 09/25/2003 09:01:44 AM |
gilles wat |
Posted - 09/25/2003 : 08:30:37 AM Hi Mike I wait a change on a status line during a data acquisition. If no change occures the loop does not finish. In C++ the function TIME() allows solving this problem with a test on time. This function is not in Origin C. Thank you |
Mike Buess |
Posted - 09/24/2003 : 2:16:41 PM Hi gilles,
I'm not sure what kind of time out you need, but this LabTalk command
sec -p n;
pauses script execution for n seconds. In Origin C you can use
Sleep(N);
where N is in milliseconds.
Mike Buess Origin WebRing Member |