This shows you the differences between two versions of the page.
jvs:cigal:manual:chapter6:r_await [2011/03/31 14:49] 127.0.0.1 external edit |
jvs:cigal:manual:chapter6:r_await [2023/02/23 18:43] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | **CIGAL Reference Manual, Chapter 6 (RealTime): r_await** | ||
- | ===== r_await -- Wait for an analog input value ===== | ||
- | **usage: r_await | ||
- | |||
- | R_AWAIT is a REALTIME operator that waits for a change in an analog input | ||
- | channel. | ||
- | operation waits until the value of the specified channel crosses the value | ||
- | specified by WAITVAL. | ||
- | by WAITFLG, which is a bitflag with the following meanings: | ||
- | |||
- | WAITFLG = 1 - terminate on a rising transition | ||
- | 2 - terminate on a falling transition | ||
- | 4 - suspend all other operations until the wait is satisfied | ||
- | (or the operator presses a key or mouse button). | ||
- | R_AWAIT only suspends operations in its own timer or | ||
- | repeat loop. | ||
- | 10o - terminate on relative min/max | ||
- | 20o - terminate on relative zero cossings (midpt bet max & min) | ||
- | 40o - take data from parallel read calls (more efficient) | ||
- | 100o - use previous values to initialize the range | ||
- | 200o - use previous values for range and state | ||
- | | ||
- | Note: 10o, 20o, 100o & 200o are for analog only and are combined with the | ||
- | " | ||
- | |||
- | TIMEBUF can be used to specify a long array to store the time that the wait | ||
- | terminated. | ||
- | TIMEBUF will also be incremented after storing the timestamp. | ||
- | |||
- | If WAITFLG has the 10o or 20o bit set the R_AWAIT operator does not simply wait | ||
- | for the analog signal to cross some absolute value; instead it monitors the shape | ||
- | of the analog waveform and tries to identify a relative trigger point, regardless | ||
- | of absolute signal intensity. | ||
- | parameter; the signal must change by more than this amount to be considered a | ||
- | true change. | ||
- | |||
- | MIN_T specifies the minimum time setting; at least MIN_T time must pass since the | ||
- | last R_AWAIT was satisfied before the current R_AWAIT will terminate. | ||
- | DEL_T can be used to specify the sampling frequency (this is ignored if the 40o bit | ||
- | is set in WAITFLG). TMAX can be used to specify an absolute time limit by which the | ||
- | R_AWAIT must terminate; if this time is reached the value -32767 is returned in | ||
- | DATABUF. | ||
- | the beginning of REALTIME). | ||
- | |||
- | Note: MIN_T DEL_T and TMAX are all long values. | ||
- | |||
- | **See Also:**\\ | ||
- | [[jvs: | ||
- | [[jvs: | ||
- | [[jvs: | ||
- | [[jvs: | ||