From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-28-2017 02:39 PM
Hello,
I am using the NI USB X Series (specifically the NI USB-6343) and programming in Visual studio 2010 with C# .NET . What I have been trying to do is use an external Digital trigger on Port 1 (PFI0) and reading the input from Port 0. When there is a rising edge on the digital trigger line (PFI0) I want that trigger a read from the input port (port 0) just once next I want it to be retriggerable so it is ready for the next trigger again without the user needing to do anything (like press a button to start looking for the trigger again).
I tried creating my task, and using the configure trigger function on the same task, but my code doesn't seem to wait for a trigger it just reads the input data from port 0 regardless of whether there was a trigger or not.
Have I misunderstood how the trigger works? What am I missing?
Thank you and I appreciate the help.
07-31-2017 04:23 PM
Hi,
Have you tried including the triggering in the task in NI-MAX? This would be a good initial test to be sure that you are able to get a simple trigger case working.
If you have LabVIEW, try using the "Voltage - Finite Input" example. This should be a good starting point for building your C# code.
Also, have you verified your trigger signal with a loop back test?
Matthew C
NI | AE
08-01-2017 01:33 PM
Hello Matthew,
I have tried using MAX and configured a task to read Port 0, however I want to only read 1 sample when there is a trigger. The only option in which I can configure a trigger is: 1 sample (Hardware Timed) acquisition mode. However, when I run the program from MAX I get
Error -200077 occurred at DAQ Assistant
Possible Reasons:
Requested value is not a supported value for this property
Property: SampQuant.SampMode
You have requested: Hardware Timed Single Point
You can Select: Finite Samples, Continuous Samples
The only other 1 sample read is "on demand" which does not have the option to use a start trigger.
I wanted to try the N samples option, however it requires a minimum of 2 samples to work.
Is there any other way around this?
Thanks,
Mulan
08-02-2017 04:47 PM
Hi Mulan,
USB devices like the USB 6343 are not able to use hardware timed single point sampling because the data transfer is non-deterministic.
Which devices can use Hardware-Timed Simple Point Sampling
Also, you're correct that on-demand sampling will not work with a trigger.
Without changing your hardware, you're remaining option would be to use finite sampling with 2 samples and then either store or throw away the extra sample.
Matthew C
NI | AE
08-03-2017 12:29 PM
Have you considered configuring the task to use the PFI0 signal as an external sample clock? It sounds to me like that's the kind of behavior you're after -- each active edge on PFI0 would cause one sample to be A/D converted instantly and stored in a buffer for later retrieval.
I only program LabVIEW though, so I'm no help on the C#.NET syntax. I also don't think MAX allows you to configure an external signal as a sample clock.
-Kevin P
08-03-2017 01:12 PM
Hi Kevin,
That does sound like what I am looking for, however you mentioned one sample will be read on each active edge. Do you mean both rising and falling edge, because I am looking to collect a sample on the falling edge. Is is possible to read data on the falling edge of a signal or only a rising edge?
Sincerely,
Mulan
08-03-2017 01:18 PM
DAQmx Timing.vi lets you configure which edge is the "active" edge for sampling. There's an input terminal you can right-click and create a constant (or control) to define which edge to use.
-Kevin P