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

No attribute WriteAnalogScalarF64 #58

Open
marcodeltutto opened this issue Feb 26, 2020 · 2 comments
Open

No attribute WriteAnalogScalarF64 #58

marcodeltutto opened this issue Feb 26, 2020 · 2 comments

Comments

@marcodeltutto
Copy link

Hello, I am on macOS with python3, and if I try to run example2.py I get the following error:

Traceback (most recent call last):
  File "PyDAQmx/test.py", line 20, in <module>
    task_out.WriteAnalogScalarF64(1,10.0,value,None)
AttributeError: 'Task' object has no attribute 'WriteAnalogScalarF64'

Any suggestions on how to fix it? Thank you!

@clade
Copy link
Owner

clade commented Feb 27, 2020

On macOS, you are using the nidaqmxbase driver and not the nidaqmx one. Only a subset of functions are available, and WriteAnalogScalarF64 is not. In your case you should probably put your value in an array and use task.WriteAnalog64

import numpy as np
data = np.array([value])
n=1
sampsPerChanWritten=int32()

task.WriteAnalogF64(n, 0, 10.0, DAQmx_Val_GroupByScanNumber, data, 
     byref(sampsPerChanWritten), None)

@marcodeltutto
Copy link
Author

Thank you, it works!

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

2 participants