Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Board Number #37

Open
matt454357 opened this issue Jan 6, 2023 · 5 comments
Open

Invalid Board Number #37

matt454357 opened this issue Jan 6, 2023 · 5 comments

Comments

@matt454357
Copy link

matt454357 commented Jan 6, 2023

I get an error when running a simple test:

Environment:

  • Model = USB-2533
  • Windows 10
  • Python version = 3.10.9
  • MccDaq.dll version = 3.73
  • mcculw version = 1.0.0
from mcculw import ul

value = ul.a_in(0, 6, 1)
print("Raw Value: " + str(value))

Returns the following:

Traceback (most recent call last):
  File "C:\Users\mtaylor\Documents\dev\mcc_test2.py", line 3, in <module>
    value = ul.a_in(0, 6, 1)
  File "C:\Users\mtaylor\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\mcculw\ul.py", line 85, in a_in
    _check_err(_cbw.cbAIn(
  File "C:\Users\mtaylor\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\mcculw\ul.py", line 6128, in _check_err
    raise ULError(errcode)
mcculw.ul.ULError: Error 1: Invalid board number.

It is working in C#:

using MccDaq;

MccDaq.MccBoard DaqBoard = new MccDaq.MccBoard(0);

MccDaq.ErrorInfo ULStat;
System.UInt16 DataValue;

ULStat = DaqBoard.AIn(6, MccDaq.Range.Bip10Volts, out DataValue);
Console.WriteLine("Value=" + DataValue.ToString());

Returns the following:
Value=32766

@matt454357
Copy link
Author

It also works with C:

#include <stdio.h>
#include "..\cbw.h"

int main(void)
{
    int	ULStat = NOERRORS;
    USHORT DataValue = 0;

    ULStat = cbAIn(0, 6, 1, &DataValue);
    printf("Value=%d\n", DataValue);
    return 0;
}

Value=32764

@matt454357
Copy link
Author

Here's a lower level test:

from ctypes import *

_cbw = WinDLL("./cbw64.dll")

data_value = c_ushort()
err_val = _cbw.cbAIn(0, 6, 1, byref(data_value))
print(f"Error code={err_val}")
print(f"Value={data_value}")

Which returns the following:

Error code=1
Value=c_ushort(0)

Where cbw64.dll has:

  • File Version = 1.93
  • Product Version = 6.73

@angel6700
Copy link

Hello,

did you ever found a solution to this?
I'm facing the same issue.

Thank you.

@matt454357
Copy link
Author

No. I gave up and used C#.

@yusaku-m
Copy link

yusaku-m commented Mar 5, 2024

I faced similar situation.
Fortunatry, I had two PC which can use mcculw in 6 PC.
I think this error occured by Python version.

My test result as show belows,

Environment:
Model = USB-1616-HS-BNC
Windows 11
InstaCal version = 6.74
mcculw version = 1.0.0

Test results for Python version,

  • NG Python 3.8.10 - May 3, 2021
  • OK Python 3.10.4 - March 24, 2022
  • OK Python 3.10.6 - Aug. 2, 2022
  • NG Python 3.10.11 - April 5, 2023
  • NG Python 3.11.8 - Feb. 6, 2024
  • NG Python 3.12.2 - Feb. 6, 2024

In addition, I try re-install Python 3.10.6 to PC that failed test, all pc can use mcculw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants