07-24-2008 01:23 PM
07-25-2008 03:40 PM
Hi BattelleV,
Instead of discussing how to get you implementation to work, I'd like to know exactly what your application is expected to do. I mean this from a higher level perspective.
Are you looking to press a button with your mouse which will in-turn start an analog acquisition? When this happens, are you also looking to output on a digital line? If this is the case, I would go about this a bit different. First off, I would only create an analog input task and not worry about the digital task. Since clicking a button in software is a software trigger, I would just monitor that control via a callback and then start your analog acquisition. I would also have my ai/starttrigger exported to a PFI line. This way when your analog input begins, this PFI line will output a high which you can read with your external device.
I hope this is helpful.
07-25-2008 04:16 PM
I have multiple sources from which I expect to acquire data.
One is attached to the DAQ, the other is RS232 based. It is vital that the data collection during this period be synchronized. fortunately the RS232 based source accepts a trigger.
In order for this synchronization to occur, I plan on sending the trigger using the DAQ to the RS232 based source as well as to the DAQ to start reading the analog input.
There are no mouse clicks or user interaction to start data collection, this is an embedded device with a scheduler loop that will command both devices to collect data and parse the data.
07-28-2008 03:59 PM
Hi BattelleV,
I believe this setup will still work for you. If you export the ai/starttrigger trigger pulse via a PFI line, this will synchronize your two operations. When you call the DAQmxStart function for your analog task, the ai/starttrigger will be asserted and your RS232 device will receive the pulse at this moment. Thus your RS232 device will know when your analog acquisition begins.
You will not have synchronization by starting a digital task and then sending a 'T' to be written to a digital task who's output is wired to a PFI line that your analog task monitors in order to trigger the acquisition. This has inherit software delays and is non-deterministic. Simply set up a single analog task that outputs a pulse when the acquisition starts.
07-31-2008 02:52 PM
PBear,
Can you elaborate on the following:
You will not have synchronization by starting a digital task and then sending a 'T' to be written to a digital task who's output is wired to a PFI line that your analog task monitors in order to trigger the acquisition. This has inherit software delays and is non-deterministic. Simply set up a single analog task that outputs a pulse when the acquisition starts.
I don't see what the software delays are, aren't the digital tasks and the analog tasks sharing a commong timebase (clock?)?
My goal essentially is to have the following,
a scheduler thread in a process (process 1) which calls an operation in another process (process 2 ) to setup the RS232 Device to start collecting data when it sees a trigger high.
The same thread then calls another operation in process 2 to start a task on the DAQ analog input (say collect x number of samples after a digital trigger)
Process 1 now calls another operation in process 2 to start the trigger (assert a 1 for X seconds).
Process 1 now calls an operation in process 2 to see if the trigger has finished asserting.
Process 1 calls a read operation in process 2 on the RS232 Device to see what data it recieved while the trigger was high.
Process 1 calls a read operation in process 2 on the DAQ task to see what data was read.
Process 2 clears the analog and digital tasks.
08-01-2008 04:15 PM