Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-DAQmx base 2.1 on Mac OS X: newbie needs help!

Hi Folks:

I'm relatively new to NI-DAQ but not to real-time A/D programming. I'm using NI-DAQmx base 2.1 on Mac OS X 10.4.11 with a M6251 card. I use the C API with Xcode 2.4. I'm able to compile and run many of the C examples with no problem.

My big problem is the lack of clear documentation on how to do anything but the simplest task. Specifically:

1) I want to route PFI0 to counter 1 input so it can measure a pulse width (as in the pulseWidth.c example). Nowhere can I find info on how to route signals to/from the PFI lines.

2) I want to acquire n A/D samples while at the same time synchronously generating a pulse with one of the counters. No info on how to perform more than 1 simultaneous task.

In general, other than the example programs, and the C Function Reference html documents, which tell you how to call these functions but not really when to use them and when, I can't find complete docs that would teach me how to do this so I don't have to waste people's time on this forum.

Any specific info on how I can do what I need to do, or better yet, a pointer to complete docs, would be most appreciated.

Thanks in advance,
Peter.
0 Kudos
Message 1 of 2
(3,175 Views)

Hi Peter,

Welcome to the forums! As I understand it, you have two questions. The first is how to route the input of PFI0 to the Gate of your 6251 card’s Counter 1 so that you can perform a single pulse width measurement. The second is how to perform simultaneous analog input and pulse generation tasks. Is my understanding correct, I made some assumptions?

The Knowledge Base Document ID 3STFET46: Synchronizing Tasks in DAQmx Base - ANSI C addresses both of these questions. You will not be able to route a signal from PFI0 to the counter, but I might suggest using PFI4, which is the Coutner 1’s Gate input. With regards to your second questions, while you will not be able to share a sample clock between tasks to truly synchronize the tasks, the suggested work around is to start the tasks that you want to be synchronized with a trigger and to make the trigger for both tasks come from the same source.

I hope this explanation helps. Good Luck, Mallori M.

Mallori M
National Instruments
Sr Group Manager, Education Services

ni.com/training
0 Kudos
Message 2 of 2
(3,157 Views)