LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-DAQ Digital Edge Start Trigger

Hi -
 
I have a digital input line that I would like to use as a trigger in order to collect 1 data sample of 31 analog input lines.  How do I configure this task?  I have been getting all kinds of error messages and am assuming there must be a simple way to go about it.
 
Thanks,
Dave
0 Kudos
Message 1 of 8
(4,569 Views)

Hi Dave,

First you need to create an analog input task by selecting only one channel from your device. (Create New Daqmx Task >> Analog Input >> Voltage >> Channel >>Name). Once you get to the task configuration window under "Task Timing" specify "1 sample (on Demand)" mode. Under the "Task Triggering" tab specify Trigger type as "digital edge"; and trigger source will be the PFI pin that you have physically connected you digital line to.

After this, you can add more channels to this task by selecting the "+ Add Channel" tab on the very top of the config window. This can be channels from the same daq card or other ones that you might have ..... depending on how are you acquiring the data.

I hope this helps.

 

Regards,
Natasa
0 Kudos
Message 2 of 8
(4,555 Views)
Natasa -
 
I tried doing what you said but I got an error message:
Error -200262 occurred at DAQ Assistant

Possible Reason(s):


An attempt has been made to configure a trigger without configuring the appropriate sample clock properties or when Sample Timing Type was set to On Demand.

Configure the sample clock type to something other than On Demand to use a trigger.

Property: Start.TrigType
Corresponding Value: Digital Edge

Property: SampTimingType
Corresponding Value: On Demand

0 Kudos
Message 3 of 8
(4,541 Views)

Hi Dave,

I apologize, that was error on my part. You need to select 1 sample (HW timed) instead, because your acquisitions will be based on the external trigger. The error you got was because “on demand” mode is software timed acquisition and we were trying to combine it with hardware timer/trigger.

Also, what daq card are you using?

 

 

Regards,
Natasa
0 Kudos
Message 4 of 8
(4,536 Views)
Hi Natasa -
 
I am using the PCI-6225. I changed to "1 Sample (HW Timed)" but now I get the following error:
--
Error -2147220733 occurred at DAQ Assistant

Possible Reason(s):

--
 
There is no explanation, just the error number.
 
Dave
0 Kudos
Message 5 of 8
(4,532 Views)

Hi Dave,

 

I think there is a problem either with your configuration files in MAX or the driver. Try renaming the MAX Data folder located at C:\Program Files\National Instruments\MAX. Also, you can try exporting your MAX configuration to preserve what you already have and then start fresh by creating new task. This will create a new MAX configuration and new Data folder when you create a brand new task.

 

I have searched for the -2147220733 error but I can't find any documentation on it even internally. Do you have another machine where you can try to create/test the task? Does the error appear in MAX or in LabView when you try to run your application? Do you have problem setting up tasks with any other cards in the computer? Does the error occur only when you have one channel in the task or all 31?

 

Selecting "1 sample HW timed" should definitely work.

Regards,
Natasa
0 Kudos
Message 6 of 8
(4,521 Views)

Natasa -

Deleting the old Data directory did the trick.  I now have the task implemented.  What blocks do I need to wire this with to make it function properly?

Thanks,
Dave

0 Kudos
Message 7 of 8
(4,508 Views)

Hi Dave,

 

I'm glad that your error was fixed. For proper implementation of your task you can reference shipping examples that are included under Help >> Find examples in your LabView installation. In the Example Finder select Hardware Input and Output >> DAQmx >> Analog Measuremen >> Voltage. The example that will work best for you is Acq&Graph Voltage - External Clk. However, you'll need to modify this by removing the DAQmx Create Channel vi and DAQmx Timing vi (since you have already set this up in your task) and simply just wire a task constant with you task name to the DAQmx Start task.

 

Feel free to look at other examples if you'd like to expand your code.

Regards,
Natasa
0 Kudos
Message 8 of 8
(4,501 Views)