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.

Note

This function should only be called when the specified channel(s) are in the Running state.

Note

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.

Note

Refer to Supported Functions by Device for more information about supported devices.

Related topics:

Programming States

Parameters

NameDirectionTypeDescription
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:

Name

Value

Description

NIDCPOWER_VAL_SOURCE_COMPLETE_EVENT

1030 (0x406)

The Source Complete event.

NIDCPOWER_VAL_MEASURE_COMPLETE_EVENT

1031 (0x407)

The Measure Complete event.

NIDCPOWER_VAL_SEQUENCE_ITERATION_COMPLETE_EVENT

1032 (0x408)

The Sequence Iteration Complete event.

NIDCPOWER_VAL_SEQUENCE_ENGINE_DONE_EVENT

1033 (0x409)

The Sequence Engine Done event.

NIDCPOWER_VAL_PULSE_COMPLETE_EVENT

1051 (0x41b)

The Pulse Complete event.

NIDCPOWER_VAL_READY_FOR_PULSE_TRIGGER_EVENT

1052 (0x41c)

The Ready for Pulse Trigger event.

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