Possilbe to capture a 5ms Pulse with a Micrologix?

Join Date
Jul 2007
Location
Kiruna
Posts
600
Hi Guys,

I have a device which is programmable to give an output pulse between 5 and 150ms.

I need to program 3 of these so im thinking 100, 125 and 150ms.

Do you think a Micrologix input (or any PLC for that matter) can capture these pulses reliably?

Would a HSC be necessary?

Thanks,
 
Look at the HSC on the 1400. I don't have anything with me But for some reason I think it has 4 inputs that can be comfigured for HSC.
 
Hi Jeff,

Thanks for your reply.

I was hoping to use one input. The PLC should be able to differiate the input type based on the pulse duration input.
 
All SLC and MicroLogix controllers have a discrete event interrupt function; in the SLC it's called a DII, in the MicroLogix it's an Event Interrupt.

I use them regularly to capture short-duration input pulses that might be missed by the normal I/O scan.

But being able to measure a pulse accurately is an interesting challenge.

Maybe you could wire the pulse to two inputs, and configure one for a leading-edge interrupt and the other for a trailing-edge interrupt. Use the internal microsecond clock to calculate the duration.
 
Thanks for your input Ken. That was my fear, I dont really need to measure the pulse duration accurately though. I just need to be able to distinguish each pulse from one another.

If I set the pulse outputs from device to be 50 100 & 150mSecs then I dont care if the I/O Scan etc effects the timing as long as I know which one it is.

Does this make sense? Failing this have you any idea of some other "off the shelf" solution to capture these pulses and then interface with PLC? I dont really fancy going down the road of microcontrollers etc...
 
Connect the pulse to two inputs.
Assign rising edge interrupt to one of them and falling edge interrupt to another.
In the rising edge interrupt store the value of free running clock word S:4.
In the falling edge interrupt calculate the difference between the stored value and actual S:4 value, that is the signal duration.
Respect wrap of S:4 from maximum to zero in your calculations, and create some kind of timeout error detection in the main program.
 
To get a really precise measurement, the technique that Sergei and I have suggested is necessary.

The S:4 clock increments every 0.1 milliseconds, so you could get a very precise time measurement on the pulse.

But since the difference between pulses can be as large as 50 milliseconds, all you need is a PLC scantime faster than 25 milliseconds. The MicroLogix family controllers can do that easily. You could even use the Selectable Timed Interrupt function to run a routine to check those inputs every ten milliseconds or so.
 
The high speed counters on a Micrologix 1400 are 100KHz so you can get way beyond the accuracy you need. 10mS scan times are easily achievable - you can read the changing values every scan. With those scan times, as stated earlier, you can skip the high speed counters - without the high speed counters, just be sure to remember the Nyquist criteria and sample at least twice as fast as the the duration of the signal you're sampling. That is, with a 10mS scan time on a digital input, you need the input to pulse (high or low) at least 20mS duration - and longer is better since Nyquist is really about analog frequencies. And note that the duration of the input is the key (rather than the frequency).
 

Similar Topics

Hi All I have a very simple logic with some light sensors and RFID reader, which are providing start and stop events for capturing some short...
Replies
10
Views
2,733
Working on a project using MQTT and an Automation Direct Click Plus. Have the bidirectional communication pretty much figured out. One of the...
Replies
1
Views
1,453
Is there anyway to replay the capture file from a PC to simulate traffic on a network. This would be to allow testing of some sensors and check if...
Replies
1
Views
1,060
Hi all, Let's say we have a nice real (analog) value that has already been scaled with an SCP in Studio5000. Is there a slick method to...
Replies
6
Views
1,579
Hi, I want to capture a value from variable A (e.g Temperature) when certain conditions are met and write this value to another variable B...
Replies
2
Views
1,510
Back
Top Bottom