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.
08-26-2014 02:21 PM
I hope 're-trigger' is the correct term for this..
I have a pulse train that, on falling edge, triggers analog acquisition.
The issue I am having is that once I press 'relay power' the second time, no data is acquired. The trigger seems to work only the first time.
What am I missing? I am using a PCI-6035E board.
The DAQmx Property - Retriggerable gives me an error, I understand my board does not support that..
Code below:
08-26-2014 03:08 PM
First, move the initialization to before the interface loop.
Have Relay Power event stop the task (just in case it was still running) and start it. It will remember its other settings.
That should handle the main issue. But also...
Put a small delay in your interface loop so it doesn't hog the system.
Move the Delay (s) down to where its local variable is read, and get rid of the local variable.
Avoid having wires move data to the left unless using a feedback node (you aren't).
There are some other things I'd change, but those are what jumped out at me.
08-26-2014 03:21 PM
Hm well, ideally, relay power just starts the whole process, which repeats, until user presses relay power to turn it off.
What I have not implemented yet is a 'Injection Mode' toggle, which would be either single (1 pulse train, acquire/log, stop) and the relay power button goes off, and a continuous, which does all what I mentioned until the user presses relay power to stop everything.
How would I get the "relay power" button to start the task and stop it?
08-26-2014 05:05 PM
In that case what you want is a loop that monitors the task with "task done?" and if it's done, starts it over again. Give this one a short timeout if triggers occur often.
08-26-2014 06:40 PM
08-27-2014 07:04 AM
What I want to happen is that the acqusition stops when N samples have been acquired.
Example: Delay is set to 1000ms. The acquisition loops stops when 1000 samples have been acquired.
08-27-2014 08:28 AM
Rest of the loop. The 'task is done?' does not work, Guess the task never finishes?
Currently the initialization of the task and Start Task occur outside of the loop, as soon as the program is run. I need the task to start only when 'relay power' is pressed.
I also am not sure how the best way to go about stopping all of the loops when all is completed, I am thinking I create a local variable for the 'quit' button and link up all the while loops to stop when that is True.
08-27-2014 08:37 AM
Do I want 'continuous' or 'finite' acquisition?
Depending on what the 'delay' is, I know how many samples to expect.
I guess I still need continuous since I want to gather 100 at a time, up until the expected amount is met?
08-27-2014 08:47 AM
08-27-2014 09:57 AM
Dennis, the front panel boolean starts the pulse train, the acquisition is supposed to be dependent on the pulse train.
On falling edge of the pulse, acquisition starts.