08-15-2014 01:00 PM - edited 08-15-2014 01:01 PM
Check for a certain amount of samples, then stop logging.
Possible? Good idea?
08-15-2014 02:04 PM
Sure its possible. I haven't ran into the situation where it made a lot of sense. I normally just stop my logging when my testing was complete. As always, it just depends on what your specifications are.
08-15-2014 02:06 PM
My card has two counters, CTR0 and CTR1. If I am understanding correctly, I can use either one to run a pulse train to trigger my relay off and on? What example can i use to do this..?
08-15-2014 09:51 PM
You can in theory use counter outputs to trigger relays. However, practically there is the question of whether the ouputs can handle the current required to energize the relays.
Mike...
08-16-2014 08:39 AM
@mikeporter wrote:
However, practically there is the question of whether the ouputs can handle the current required to energize the relays.
That's a concern with normal Digital Outputs. There are cards out there that can handle the current, but I find you are better off having digital buffers anyways to make sure the current is not an issue.
08-16-2014 09:59 AM - edited 08-16-2014 10:01 AM
Good point,
External buffers also offer a level of protection from something unexpected happening, like somebody in advertently hooking up something wrong. Better to fry a cheap buffer than an expensive counter.
Mike...
08-19-2014 09:00 AM
Could someone explain "digital buffers" ?
Also, as I currently have it wired, my relay is triggered on Port 0: Line 4.
Thanks to this forum, I've figured out how to start my acquisition/logging to start via a trigger when the relay goes low (on the falling edge).
I would like to use CTR0 or CTR1 to 'count' (?) time elapsed and stop the acquisition/logging..I need to be able to have the relay stay on for a certain amount of time, then turn off and stay off for a certain amount of time (During which the acquisition and logging occurs)
Any guidance? Thank you!
08-19-2014 11:25 AM
08-19-2014 11:30 AM
That is the unanswered question, at current.
On my test setup, I am using a JZC-11F (specs: https://www.sparkfun.com/datasheets/Components/General/JZC-11F-05VDC-1Z%20EN.pdf ) but the lab setup, I am not sure what their relay specs are. That is what I will be finding out.
I suppose one way to go about this is, use a counter to do the pulse train, and send a trigger to whichever channel I use to turn relay on off?
08-19-2014 11:40 AM
Your relay wants 12V for the coil, which one of your counters can't deal with directly. And the coil looks like it will want around 37mA to turn on (12V/320 Ohms = 37.5mA). What I have typically done in these situations is use a 2N2222 transistor to cause the current from a 12V source to go through the coil and through the transitor to ground. When you apply 5V to the base, the current can flow. When you apply 0V, the transistor will be "off" and the current won't be able to flow. When current can flow through the coil, the relay will turn on. When current does not flow through the coil, the relay is off. And you will also want a protection diode in there to allow current to go from the negative side of the coil to your 12V (the coil will hold a charge).