Exemplo n.º 1
0
    # Initialize the scope
    init_result = scope_service.InitWithOptions(
        niscope_types.InitWithOptionsRequest(session_name="demo",
                                             resource_name=resource,
                                             id_query=False,
                                             option_string=options))
    vi = init_result.vi
    CheckForError(vi, init_result.status)

    # Configure Vertical
    vertical_result = scope_service.ConfigureVertical(
        niscope_types.ConfigureVerticalRequest(
            vi=vi,
            channel_list=channels,
            range=10.0,
            offset=0,
            coupling=niscope_types.VerticalCoupling.
            VERTICAL_COUPLING_NISCOPE_VAL_DC,
            enabled=True,
            probe_attenuation=1))
    CheckForError(vi, vertical_result.status)

    # Configure Horizontal Timing
    config_result = scope_service.ConfigureHorizontalTiming(
        niscope_types.ConfigureHorizontalTimingRequest(vi=vi,
                                                       min_sample_rate=1000000,
                                                       min_num_pts=1000,
                                                       ref_position=50,
                                                       num_records=1,
                                                       enforce_realtime=True))
    CheckForError(vi, config_result.status)
Exemplo n.º 2
0
    # Open session to NI-SCOPE module with options.
    init_with_options_response = client.InitWithOptions(
        niscope_types.InitWithOptionsRequest(resource_name=resource,
                                             id_query=False,
                                             option_string=options))
    vi = init_with_options_response.vi
    CheckForError(vi, init_with_options_response.status)

    # Configure vertical.
    voltage = 10.0
    CheckForError(vi, (client.ConfigureVertical(
        niscope_types.ConfigureVerticalRequest(
            vi=vi,
            channel_list=channels,
            range=voltage,
            offset=0.0,
            coupling=niscope_types.VerticalCoupling.
            VERTICAL_COUPLING_NISCOPE_VAL_AC,
            probe_attenuation=1.0,
            enabled=True))).status)

    # Configure horizontal timing.
    samples = 1000
    CheckForError(vi, (client.ConfigureHorizontalTiming(
        niscope_types.ConfigureHorizontalTimingRequest(
            vi=vi,
            min_sample_rate=50000000,
            min_num_pts=samples,
            ref_position=50.0,
            num_records=1,
            enforce_realtime=True))).status)