06-27-2019 10:20 PM - edited 06-27-2019 10:21 PM
Dear all,
After my basic question (https://forums.ni.com/t5/Counter-Timer/Basic-Buffered-Edge-Counting/m-p/3941541#M14321) was solved (thanks again Kevin), I have another question (this time less basic, I think)
A quick reminder if what I am trying to do:
Timestamp some incoming TTL signals, for this I am counting edges using:
"Input Terminal"=>: /Dev1/100MHz Timebase
"Timing Settings: Sample Clock Source'"=> /Dev1/PFI8 (the signal I want to timestamp, with the 100MHz timebase).
I have added a reset trigger signal at /Dev1/PFI9. (This is well documented and I know how to do it)
So far so good.
However: I need to treat the data that came between two reset trigger signals, but how to get that information?
I am running a loop, with the acquisition set at "continuous" and reading "All available", but how to trigger an action upon the rising edge of the PFI9, which is used as a reset signal?
Any ideas?
Regards
06-29-2019 02:44 PM
I can't clearly understand what you're looking to do with the PFI9 signal that you call a "reset trigger." That's not a standard DAQmx term. I don't know if you want to re-trigger your task or reset your count value. I need some more clarity before I know what kind of advice to give.
You say you want "to treat the data that came between two reset trigger signals". Treat it how exactly?
You say you want "to trigger an action upon the rising edge of PFI9." What kind of "action"? Something that the hardware does on its own or something you can notice and respond to in software?
-Kevin P
06-29-2019 08:06 PM
Hi Kevin,
I have been working lately with Arduino, so my post may sound a bit Arduino like...
What I call "reset trigger" is a signal that puts the counter clock register back to 0, so the timestamp is done respect such signal. This part is under control.(I think, not time to test it yet) I attached a figure.
But on top of putting the clock register back to 0, I need to do some analysis on the data is taken between two rising pulses of the reset signal. I could do it in post analysis, and just save all the data but it would be a pity...
What I was thinking is that the only way I have is to split the signal in two: one to the PFI9 for the Reset Singal and another send to a digital line that I monitor for a change of low high.
Do you think the above would work?
Regards,
07-01-2019 09:28 AM
I suspect you'll actually be better off doing this kind of thing with software processing. To do it in near-real-time, set up a "producer / consumer" pattern to move the processing off into its own independent loop that won't slow down the data acq loop.
Alternately, it's conceivable you could register the PFI9 signal as a dynamic DAQmx Event by making another task on your board for that purpose. I can't offer up a lot of details as I haven't actually done a lot of this, but there's a lot of info to be found around here about DAQmx Events.
Looking briefly, I might make another counter task that does retriggerable single pulses with PFI9 as a trigger signal. The pulse params would be minimal low and high times. And then I'd register this task's "counter output event.." It'll pulse once for each specified edge of PFI9, after a minimal delay, and fire an event that you can react to.
Overall though, I think the producer/consumer approach with software processing will end up being a more straightforward implementation.
-Kevin P