NI-SCOPE Programming Flow

NI-SCOPE provides the same functionality in two formats:

  • In LabVIEW as VIs
  • In traditional programming languages as functions
Note   If you are new to NI-SCOPE, read Getting Started with NI-SCOPE (Tutorial) before you read this section.

The following diagram illustrates the basic programming flow for using NI-SCOPE functions in your own digitizer applications. Click the VIs in the diagram for more detailed programming information.

1378

For any application you write, you must open a session to establish communication with the digitizer(s) by using niScope Initialize or niScope Initialize With Options. When your program finishes, you must close the session with niScope Close.

Initialize functions set the driver and digitizers to a known state. This function may take a significant amount of time compared to all other NI-SCOPE functions, so you should not include it in a loop when repeatedly acquiring data. Ideally, your program should call an Initialize function one time. If the reset device parameter is set to TRUE, the digitizer resets to the default state, which may include resetting relays and resetting time stamp counters.

Caution   Resetting digitizers may cause wear on the relays, so you should reset only when necessary.

niScope Close is essential for freeing resources, including deallocating memory, destroying threads, and freeing operating system resources. You should close every session that you initialize, even if an error occurs during the program. While debugging your application, it is common to abort execution before you reach Close. Though aborting the execution should not cause problems, NI does not recommend doing so.

Examples

All NI-SCOPE examples include niScope Initialize or niScope Initialize With Options, niScope Close, and Error Message (except for LabVIEW). The Getting Started example is a good choice to start with if you are inexperienced with NI-SCOPE because it is the simplest example.