64
3 DETAILS OF FUNCTION
3.1 C Intelligent Function Module Dedicated Functions
CITL_WaitYEvent
This function waits for the output signal (Y) interrupt event notification.
■ Format
short CITL_WaitYEvent (short* psYNo, unsigned long ulTimeout, unsigned short* pusSetEventNo)
■ Argument
• The specification method of the output signal (Y) number is as follows:
• The occurred output signal (Y) event (pusSetEventNo) is stored as follows:
■ Description
• This function waits for an interrupt event specified to the output signal (Y) number (psYNo) for the time specified to the
timeout value (ulTimeout).
• When multiple interrupt events occur, the interrupt events are notified in ascending order of the output signal (Y) number.
• If an interrupt event has already been notified at the time when this function is called, this function returns immediately.
When a reset operation is performed, any interrupt event that occurred prior to reset is discarded.
• If multiple interrupt events have been notified for the same interrupt event number (the output signal (Y) number) at the time
of calling the CITL_WaitYEvent function, it is treated as a single interrupt event notification.
• Set the output signal (Y) number without duplication. Otherwise, an error will be returned.
• The specified timeout value is rounded to the tick unit. Specify a timeout value of one tick or more.
• Design a program so that this function is not called simultaneously by specifying the same interrupt event (output signal (Y)
number) from multiple tasks. Otherwise, the execution of the interrupt event notified task is unpredictable.
• The output signal (Y) interrupt event notification wait function (CITL_WaitYEvent function)and the function executing
interrupt routine when output signal (Y) interrupts (Defined by CITL_EntryYInt/CITL_EnableYInt/CITL_DisableYInt function)
operate independently. These functions operate independently even if interrupt occurs by the same output signals (Y).
■ Return value
Argument Name Description IN/OUT
psYNo Output signal (Y) number Specify the output signal (Y) number. IN
ulTimeout Timeout value Specify the timeout value in ms units (0H to FFFFFFFFH).
(When FFFFFFFFH is specified, the function waits for an event infinitely.)
IN
pusSetEventNo Occurred output signal (Y) event Stores the occurred event.
(Stores the output signal (Y) number of the notified interrupt event.)
OUT
Storage position Description
psYNo[0] Number of interrupt event settings (1 to 16)
psYNo[1] Output signal (Y) number of the first interrupt event (0x10 to 0x1F)
psYNo[2] Output signal (Y) number of the second interrupt event (0x10 to 0x1F)
psYNo[8] Output signal (Y) number of the 8th interrupt event (0x10 to 0x1F)
Storage position Description
pusSetEventNo[0] Output signal (Y) number of the notified interrupt event
Return value Description
0 (0000H) Normal
Other than 0 (0000H) Error
For details on the error, refer to the following chapter.
Page 108 ERROR CODE LIST