07-12-2012 03:11 AM
I am using a Campell data logger to send a 5mV pulse to my daq to trigger logging of some accelerometers. I would also like the code to cease aquisition when another pulse is sent, currently the code has a predefined sampling time how would I change this.
Many thanks
Solved! Go to Solution.
07-12-2012 03:22 AM
I just wanted to add how would I set it so that the logging would stop when another digital pulse is sent?
07-13-2012 11:20 AM
Hi echelon101,
Are you able to trigger your device successfully to start acquisition from the 5mV signal?
Assuming that you can then there are a couple of examples that you can use to implement this. The first is here (DAQmx Stop Trigger) which shows you that you can use a "Reference Trigger" to stop acquisition. The VI continuously acquiring samples until the trigger occurs.
The second is here (Start Trigger and Stop After n Pulses for Continuous Analog Input with DAQmx) which shows using both a "Start" and "Reference" trigger in the same task. You can use the same source and edge for both triggers which should perform the resired action for you.
Please let me know how you get on.
Best regards,
Ali Bailey
National Instruments
07-13-2012 11:25 AM
Ali, I have emailed support and someone is looking into it.
The issues are that:
- I want to visualise the continuously stream data
- I want to be able to carry on sampling forever if the stop signal is not received.
I was given this as a comparison
NI-DAQmx: Continuous Analog Input with Both Start and Reference (Stop) Triggers http://zone.ni.com/devzone/cda/epd/p/id/908
07-13-2012 11:44 AM
Hi echelon101,
Who are you speaking to in support?
From that example I can see that that implements exactly what I was thinking. There are a couple of small differences but it is the same in essence.
Are those issues that you mention issues with the example or with your current code?
With the example you could change the display to a chart to show the historical data too and it will continuously run, I just tested it.
Best regards,
Ali Bailey
National Instruments
07-13-2012 01:08 PM
James Sullivan, he is "having a play with some of our DAQ hardware to explore the different options there are for achieving what you are after. I will let you know once I have explored them and we can see which we think will be most appropriate." Which is fair enough.
I'll look in to it tomorrow then update.
07-16-2012 09:28 AM
Have you had any success at all?
Thanks,
Ali Bailey
National Instruments
07-16-2012 03:25 PM
I have not had a chance to get on the Daq since I am now at my construction site. James is still help though.
07-26-2012 03:07 AM
This was the vi created which worked
07-26-2012 04:37 AM
I am glad it worked. Did you not get on with the other examples?
There is a slight difference between the initial ones and this one. The one you have just posted checks for the stop trigger in software rather than in hardware so you will be limited to checking the digital line at the same time as you take more analog samples. If that works for you though then that is fine.
One thing I would recommend is a stop button so you can stop the loop if you need to without having to abort the program. It will make sure that you clear resources etc.