Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Cannot overwrite custom scales

Đang mở
#670 5 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
api

Hướng nghiên cứu

Bắt đầu với nidaqmx/scale.py tại create_lin_scale và save, sau đó theo dõi các lệnh gọi tương ứng trong nidaqmx/_library_interpreter.py. Chạy lại mẫu được cung cấp với một scale NI MAX hiện có và truy vết nơi quá trình tạo bị lỗi trước khi overwrite_existing_scale được áp dụng. Hoàn thành khi việc lưu custom scale có cùng tên thành công với overwrite_existing_scale=True.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

When saving a custom scale, I receive a DaqError if the scale already exists in NI MAX even when using overwrite_existing_scale=True. The example below will run fine the first time when creating the scale, but will fail If I try to run it again now that the scale exists in NI MAX.

Windows 10
NI MAX 2024 Q4
NI-DAQmx 2024 Q4 (24.8.0)
Python 3.11.11 running in Spyder 6.0.1 (conda)
nidaqmx 1.0.2

Sample code:

import nidaqmx
from nidaqmx.constants import UnitsPreScaled

scale = nidaqmx.scale.Scale.create_lin_scale('ch1_V',
                                     10, # slope
                                     0, # intercept
                                     pre_scaled_units=UnitsPreScaled.VOLTS,
                                     scaled_units='V')
scale.save(author="Me",
           overwrite_existing_scale=True,
           allow_interactive_editing=True,
           allow_interactive_deletion=True)

Error message:

Traceback (most recent call last):

  File ~\.conda\envs\env_gui\Lib\site-packages\spyder_kernels\customize\utils.py:209 in exec_encapsulate_locals
    exec_fun(compile(code_ast, filename, "exec"), globals)

  File c:\users\me\untitled0.py:24
    scale = nidaqmx.scale.Scale.create_lin_scale('ch1_V',

  File ~\.conda\envs\env_gui\Lib\site-packages\nidaqmx\scale.py:338 in create_lin_scale
    scale._interpreter.create_lin_scale(

  File ~\.conda\envs\env_gui\Lib\site-packages\nidaqmx\_library_interpreter.py:1764 in create_lin_scale
    self.check_for_error(error_code)

  File ~\.conda\envs\env_gui\Lib\site-packages\nidaqmx\_library_interpreter.py:6412 in check_for_error
    raise DaqError(extended_error_info, error_code)

DaqError: Custom scale cannot be created. A saved scale with this name already exists.

Scale Name: ch1_V

Status Code: -200356
Ngôn ngữ chính
Python
Star
590
Fork
199
Merge trung bình
1 ngày 20 giờ
Pull request đã merge (30 ngày)
10

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ni/nidaqmx-python

Tất cả issue của ni/nidaqmx-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.