11-14-2017 03:01 PM
Hi Folks,
I'm trying to figure out how to create pulses on a digital output line on my PXIe-6535. I'm painfully new to this sort of thing. I'm trying to figure out how to do this programmatically via python using ni-daqmx. I need to be able to control the frequency of the pulse to within a msec...
Can someone point me in the right direction?
Thanks!
11-15-2017
05:44 PM
- last edited on
07-11-2024
08:54 AM
by
Content Cleaner
Hi sidrew,
Are you new to the PXIe-6535 hardware, programming NI hardware with Python, or both?
I recommend you check out this White Paper: Python Resources for NI Hardware and Software. This includes some great getting started videos and information on how you prefer to program Python into your application. Otherwise, the NI Digital Waveform Generator/Analyzer Help will give you more insight on the device itself, including fundamentals for high speed digital I/O, programming, features, etc.
If you haven't already found this additional resource, here is the download and GitHub page for NI-DAQmx Python Documentation also linked within the first article above.
11-16-2017 09:07 AM
Thanks for the response... I'm painfully new to both, sadly. I've dabbled in some basic digital line control via python, but, I'm tasked with putting together something a little more advanced that necessarily needs to involve the clock on the PXIe-6535, I think.
I appreciate the docs... I've already read some of these, but will dig through the docs for the waveform generator. I'm not an EE... so I have a bit of learning to do, methinks.
11-16-2017 09:33 AM
Specifically, I think I need to create a task that sends a "pulse" ... that is... it sets a digital line high for a certain length of time... then low again... and I need to be able to finely control the periodicity of the pulse... which, I can try to do just via python... but, I get the impression the resolution/precision of the leading edge can't be controlled reliably just in software. So... I'm trying to figure out how this is done via the hardware.
11-17-2017
10:24 AM
- last edited on
07-11-2024
08:56 AM
by
Content Cleaner
Hi sidrew,
If you're looking to manipulate the timing, you can do that a few different ways. There are different clocking sources to choose from based on your timing & sync needs. This includes sample clock, reference clock, and static timing. The NI-HSDIO driver includes functions that can be called to configure this timing. Choosing one of these clocks, you can trigger the pulse to start based on the chosen clock.
More details on timing & sync can be found here: HSDIO Generation and Acquisition Synchronization and here: Synchronization Explained
Hope this helps!
11-27-2017 09:14 AM
I'm thinking I might be missing something more basic. Since I'm trying to do all of this via python... I'm curious to know if creating such a task is even possible via the python API... or do I need to create a virtual instrument in something like LabView... I'm trying to understand the very basic workflow.
11-28-2017
12:59 PM
- last edited on
07-11-2024
09:00 AM
by
Content Cleaner
Hi Sidrew,
Programming with NI-DAQmx: https://www.ni.com/docs/en-US/bundle/ni-daqmx/page/getting-started-with-ni-daqmx.html
Along with this, the NI-DAQmx Python Documentation has the procedure for installing DAQmx for use with python, as well as some examples of creating tasks and configuring them. I have posted this below as well.
NI-DAQmx Python Documentation: http://nidaqmx-python.readthedocs.io/en/latest/
This also contains links to the different API references you can call with DAQmx in Python. Following the program flow in the first link and using the appropriate API calls in the second link should provide a good starting point!