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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop logging loop when number of samples is written?

Check for a certain amount of samples, then stop logging.

 

Possible? Good idea?

0 Kudos
Message 1 of 11
(2,861 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 11
(2,848 Views)

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..?

0 Kudos
Message 3 of 11
(2,846 Views)

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...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 11
(2,822 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 11
(2,803 Views)

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...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 11
(2,788 Views)

Could someone explain "digital buffers" ?

 

Also, as I currently have it wired, my relay is triggered on Port 0: Line 4.Relay_trigger.PNG

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!

0 Kudos
Message 7 of 11
(2,728 Views)
A digital buffer is an integrated circuit (IC) like the 7407 that can sink more current than a standard TTL output. These buffers are often open collector, but don't have to be.

Specifically, what relay are you using? That will tell you how much current you need to be able to sink, and at what voltage.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 8 of 11
(2,713 Views)

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?

0 Kudos
Message 9 of 11
(2,700 Views)

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).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 11
(2,694 Views)