pulse counter with neuron
-
Hi,
I'm having some issues connecting a pulse counter to my neuron: the pulse counter's led is flashing, indicating that it is sending out pulses, but the neuron isn't counting any pulses at all, and the green led to indicate action on I1.1 on the neuron is also not blinking, so I suspect that the pulse isn't seen by the neuron.
This is the diagram that was included with the pulse counter:
So I have connected 7 to DIGND and 6 to DI1.1, but nothing's happening. Did I make a mistake here?
The pulse duration is 90 ms, so I set the debounce of DI1.1 to 0. I also changed the scan_frequency parameter to 8 in /etc/evok.conf but this might be more important for the unipi?
What am I doing wrong? -
And what's the value of the pullup resistor Rc?
-
In my opinion, you are missing here supply voltage, which you need to limit current to protect the transistor of pulse counter with Rc. Usually this value would be limit on maximum ratings 50mA. I would have liked to 10mA and on examply 24V is this value 2400 Ohm. In datasheet for Neuron is value for Input resistance 6200R and minimum voltage is 5V.
This results in the value of the minimum current 806uA. Sum of input resistance and Rc si now 8600 Ohm and with 24V you have 2,7mA for digital input. And that is enough for operation of transistor S0 output and Neuron input. Simply use pullup resistor Rc 2200R or something in this range. You will avoid the limit values like 10k or 20k due to speeds and low values due working supply voltage and kill transistor of course. -
many thanks.
Found this is in the doc: the load resistance (RC) must be designed so that the closed contact current is under 100 mA. -
Sorry to reopen this. but I am looking for a solution for a similar use case.
I have an S0 connection. But yes, I am a noob regarding electronics.
For S0 it states: max 27VDC, max 20mA. It has two wire connectors
Did I get it right I have to provide some power to the circuit as neither the S0 connection nor the digital input provide power?I would use either a 5V power source or a 24V one. Did I get it right if I use the 24V from above calculations I need to place a resistor of 2200R in between?
So the above picture of the wireing is correct and I can use either or with the Rc of 2200R?
Sounds too easy for me ;)
-
@knebb Hello, please see the attached pdf0_1525953996620_Digital input – DI – pulse counter mode_EN.pdf .
-
-
Hello,
I use the S0 like the pdf from tomas_hora and it works.
But the counter register is after reboot 0.I use Neuron S103 with Evok.
-
Hello @jos0,
the counters are reset after reboot. More precisly, they are reset when the PLC loses power. They survive when the OS inside of the PLC is rebooted. -
Hello Martin,
thanks but I thinking that are holding register(from hold)?But maybe you can help me.
If I save on flash the counter it`s saved.
To shut down I use this php comand:
<?PHP
exec("/sbin/shutdown -h now");
?>
Is there an php script to include here to save before shut down?
Thanks for your help.Jo
-
Helo @jos0,
the name "holding register" doesn't mean the value is stored in the non-volatile memory. This is just a type of the data store which comes from the Modbus naming convention, which means it can be read and written into, as oppose to the Input register, which can be only read.You can save the current value of the counter register with the saving of the current values to internal flash. This save can be initiated by e.g. setting the coil named "Save current configuration and use on startup" which has to be called on the appropriate group.
We do not recommend to do it very often as this will corrupt the internal memory. Try solving the problem in the program instead.
Best regards,
Martin