Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: EDurako on September 04, 2019, 01:15:25 PM
-
Hello,
Looking to implement a BX-DM1E-36ER3-D. I know that this unit supports up to 3 high speed counters (at a slower refresh rate than the HSIO).
Is there a eloquent way to have one of these timers pull double duty?
I have 4 flow meters. Only a combination of 2 of those 4 flow meters can be on simultaneously. So I really only need to run 2 high speed counters at the same time.
I'm sure I'm just missing it, otherwise there would be no reason to have 10 high-speed inputs on this PLC if only 3 could be used.
Please help, this is my first high speed input application.
-
I too needed to collect data from 4 flow meters. Ours are Seametrics and the maximum pulse rate is only 550 Hz, just a bit too fast for a regular counter. So I read the high speed input using an interrupt and divided the count by 10 in the interrupt service routine. Then fed that pulse to a standard counter. Works great for us. First time I used an interrupt in a PLC!
-
I'm sure I'm just missing it, otherwise there would be no reason to have 10 high-speed inputs on this PLC if only 3 could be used.
There are 10 fast inputs. Fast inputs can be used for high speed counter/timers, as well as interrupt triggers and immediate I/O.
There are only 3 high speed counters because they consume critical FGPA resources, and having more would require removing other things.
-
I'm sure I'm just missing it, otherwise there would be no reason to have 10 high-speed inputs on this PLC if only 3 could be used.
There are 10 fast inputs. Fast inputs can be used for high speed counter/timers, as well as interrupt triggers and immediate I/O.
There are only 3 high speed counters because they consume critical FGPA resources, and having more would require removing other things.
So there is not a way to share a high speed counter between 2 inputs? Acknowledging the fact that if the logic is wrong I could find myself in a ton of hot water (see what I did there? the flow meters are for 185 degree water fill nozzles)
-
So there is not a way to share a high speed counter between 2 inputs? Acknowledging the fact that if the logic is wrong I could find myself in a ton of hot water (see what I did there? the flow meters are for 185 degree water fill nozzles)
Lol. No, sorry.
How fast are the pulses?
-
Man that is a real kick in the rear.
We pulse 100 times every 1.5 - 2 seconds ~ish
Would it be beneficial (to more than just me) to allow users to switch high speed counter inputs via the logic vs. plugging in and using a computer?
-
Man that is a real kick in the rear.
We pulse 100 times every 1.5 - 2 seconds ~ish
Would it be beneficial (to more than just me) to allow users to switch high speed counter inputs via the logic vs. plugging in and using a computer?
You are trying to use that to hack around a resource limitation. That causes more trouble than benefit.
How wide are your pulses? Your rate is easily slow enough to do this with an interrupt, but depending on pulse width, you might be able to use normal counters.
-
The BX-HSIO module can add more High Speed Counter/Timers as you need them. Each one comes with 4 High Speed C/T. You can have up to 8 BX-HSIO modules in a single BRX PLC, for up to 32 High Speed C/T per system (in addition to the 3 on-board the -36).
Realize these are hardware based counter/timers, not software based. Hence, the resources necessary are hard coded (literally) in the modules and MPUs.
Another option: Since you need 4 High Speed Counters, use a -M (no I/O) or a -10 MPU, and one BX-HSIO module instead of a -36 MPU.
-
fanji1- I was hoping to avoid the HSIO if possible, we have around 30 production lines that need this hardware upgrade from their previous Horner PLC's and I also need 20 inputs/20 outputs so I was trying to keep my budget down.
BobO, can you provide an interrupt coding example? I'm reading up on those now, I have never used one. I am also not sure what you mean by pulse width, nor am I sure how I can even try and measure it.
-
BobO, can you provide an interrupt coding example? I'm reading up on those now, I have never used one. I am also not sure what you mean by pulse width, nor am I sure how I can even try and measure it.
You said you have 100 pulses every 1.5 to 2 seconds, but what is the pulse frequency and duty cycle? If that is constant pulses of 50% duty cycle, then your pulses are 15-20ms (50-66hz) and on for half of that time. But it is also possible that the pulses come at 15-20ms but are narrow, say 100us wide. Or you could be getting burst of 100 pulses every 1.5-2 seconds, but the frequency is 2khz.
I need to know what the actual pulse train looks like before I can make a recommendation. You would get that from either the source documentation of the device generating the pulses, or connect an oscilloscope to the machine and watch the pulse train.
-
You said you have 100 pulses every 1.5 to 2 seconds, but what is the pulse frequency and duty cycle? If that is constant pulses of 50% duty cycle, then your pulses are 15-20ms (50-66hz) and on for half of that time. But it is also possible that the pulses come at 15-20ms but are narrow, say 100us wide. Or you could be getting burst of 100 pulses every 1.5-2 seconds, but the frequency is 2khz.
I need to know what the actual pulse train looks like before I can make a recommendation. You would get that from either the source documentation of the device generating the pulses, or connect an oscilloscope to the machine and watch the pulse train.
Per our current oscilloscope test, the worst case, pulses are on for 5ms and off for 2ms
-
Per our current oscilloscope test, the worst case, pulses are on for 5ms and off for 2ms
Easy.
This can be done with a timed interrupt (HSIO tab). Create a recurrent 1ms timer. Use the attached code in the ISR. I also included a trend of the interrupt total time and latency. For me, it never goes above 60us, so the PLC will not notice this is running. You can use the SLOPE instruction from the main scan to convert the counter values into frequencies.
-
Great...I said HSIO tab...that's wrong. Interrupt tab.
-
And be sure to set the input filters to something faster. The default is 25hz, and you need to be at least 150hz.