niDCPower_WaitForEventWithChannels
- Updated2025-10-06
- 2 minute(s) read
Waits until the specified channel(s) have generated the specified event.
Syntax
ViStatus _VI_FUNC niDCPower_WaitForEventWithChannels(ViSession vi, ViConstString channelName, ViInt32 eventId, ViReal64 timeout)
Remarks
The session monitors whether each type of event has occurred at least once for the specified channel(s) since the last time this function or the niDCPower_InitiateWithChannels function were called. If an event has only been generated once and you call this function successively, the function times out. Individual events must be generated between separate calls of this function.
This function should only be called when the specified channel(s) are in the Running state.
When setting the timeout interval with timeout, ensure you take into account any triggers so that the timeout interval is long enough for your application.
Refer to Supported Functions by Device for more information about supported devices.
Related topics:
Parameters
| Name | Direction | Type | Description | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| vi | [in] | ViSession | Identifies a particular instrument session. vi is obtained from the niDCPower_InitializeWithIndependentChannels function. | |||||||||||||||||||||
| channelName | [in] | ViConstString | Specifies the channel(s) to use. Specify the channel(s) using the form PXI1Slot3/0,PXI1Slot3/2-3,PXI1Slot4/2-3 or PXI1Slot3/0,PXI1Slot3/2:3,PXI1Slot4/2:3, where PXI1Slot3 and PXI1Slot4 are instrument resource names and 0, 2, and 3 are channels. If you pass "" for this control, all channels in the session are used. | |||||||||||||||||||||
| eventId | [in] | ViInt32 | Specifies which event to wait for. Defined Values:
| |||||||||||||||||||||
| timeout | [in] | ViReal64 | Specifies the maximum time allowed for this function to complete, in seconds. If the function does not complete within this time interval, NI-DCPower returns an error. |
Returns
Reports the status of this operation. To obtain a text description of the status code, call niDCPower_error_message. To obtain additional information concerning the error condition, call niDCPower_GetError. The general meaning of the status code is as follows:
Value | Meaning |
|---|---|
0 | Success |
Positive Values | Warnings |
Negative Values | Errors |