DioStep

Applies To

GC5050, GX5050, GX5055, GX5150, GX5280, GX5290, GX5290e, GX5295

Purpose

Executes the specified Master board state for given number of steps.

Syntax

DioStep (nMasterHandle, dwSteps, pnStatus)

Parameters

Name

Type

Comments

nMasterHandle

SHORT

Master board handle.

dwSteps

DWORD

Number of steps to execute.

pnStatus

PSHORT

Returned status: 0 on success, negative number on failure.

Comments

STEP mode is similar to having a breakpoint in a program: when the program breaks at that line, the step is not yet executed. While issuing a STEP command, the board will pause after dwSteps are executed. However, at that point the current step number is not yet executed. Only after issuing a STEP, TRIG or RUN commands will the current step be executed.

The board must be in a PAUSE state or the function returns an error.

Each step is executed by changing the board state from PAUSE to RUN, then back to PAUSE.

This function is useful for debugging purposes.

Example

The following example will step the board through 10 steps and stop:

SHORT nStatus;

DioArm (nMasterHandle, &nStatus);

DioStep (nMasterHandle, 10, &nStatus);

 

See Also

DioPause, DioTrig, DioReadProgramCounter, DioSetupTriggerXEventSource