GetStatus()

Returns the status about the background operation currently running.

Member of the MccBoard class.

Function Prototype

VB .NET

Public Function GetStatus(ByRef status As Short, ByRef curCount As Integer, ByRef curIndex As Integer, ByVal functionType As MccDaq.FunctionType) As MccDaq.ErrorInfo

C# .NET

public MccDaq.ErrorInfo GetStatus(out short status, out int curCount, out int curIndex, MccDaq.FunctionType functionType)

Parameters

status

Status indicates whether or not a background process is currently executing.

curCount

The curCount parameter specifies how many points have been input or output since the Background process started. Use it to gauge how far along the operation is towards completion. Generally, curCount returns the total number of samples transferred between the DAQ board and the Windows data buffer at the time GetStatus() was called.

When you set both the Continuous and Background options, curCount's behavior depends on the board model. Refer to the board-specific information in the Universal Library User's Guide for the behavior of your board.

With recent MCC DAQ designs, the curCount parameter continually increases in increments of the packet size as Windows' circular data buffer recycles, until it reaches 231. Since the count parameter is a signed integer, at 2,147,483,647 + 1, the Count parameter rolls back to a negative number (-2,147,483,647). The count parameter resumes incrementing, eventually reaching 0 and increasing back up to 2,147,483,647.

The curIndex parameter is usually more useful than the curCount parameter in managing data collected when you set both the Continuous and Background options.

curIndex

The curIndex parameter is an index into the Windows data buffer. This index points to the start of the last completed channel scan that was transferred between the DAQ board and the Windows data buffer. If a scan is running but no points in the buffer have been transferred, curIndex equals -1 in most cases

For Continuous operations, curIndex rolls over when the Windows data buffer is full. This rollover indicates that "new" data is now overwriting "old" data. Your goal is to process the old data before it gets overwritten. You can keep ahead of the data flow by copying the old data out of the buffer before new data overwrites it.

The curIndex parameter can help you access the most recently transferred data. Your application does not have to process the data exactly when it becomes available in the buffer – in fact, you should avoid doing so unless absolutely necessary. The curIndex parameter generally increments by the packet size, but in some cases the curIndex parameter can vary within the same scan. One instance of a variable increment is when the packet size is not evenly divisible by the number of channels.

You should determine the best size of the "chunks" of data that your application can most efficiently process, and then periodically check on the curIndex parameter value to determine when that amount of additional data has been transferred.

Refer to the Universal Library User's Guide for information on your board, particularly when using Pre-Trigger.

functionType

Specifies which scan to retrieve status information about. Set it to one of the constants in the functionType parameter values section below.

Returns

functionType parameter values

AiFunctionSpecifies analog input scans started with AInScan() or APretrig().
AoFunctionSpecifies analog output scans started with AOutScan().
DiFunctionSpecifies digital input scans started with DInScan().
DoFunctionSpecifies digital output scans started with DOutScan().
CtrFunctionSpecifies counter background operations started with CStoreOnInt() or CInScan().
DaqiFunctionSpecifies a synchronous input scan started with DaqInScan().
DaqoFunctionSpecifies a synchronous output scan started with DaqOutScan().