This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

CANx based meter counter
#1
Hello.
I have an electric meter (ETI DEC-3) that has pulses output. It outputs one pulse each 1.25 watts measured. What is a way to handle these pulses, count them and make a trend from this data?
Reply
#2
Impulse counter is not yet implemented in CANx devices. We will add it later.
Reply
#3
Wow! Great news! I hope CANx-UIO16 will support this feature. When do you plan to implement it?

BTW. Answering in other my thread (about open collector inputs) I had renewed my knowledge about VALSENA-DIN32 modbus module. One of input modes supported (according reference manual) is impulses counter. First I need to learn manual on electric meter to find out exact impulses specification (open collector, dry contact) and DIN32 to learn does impulses counter is available and how to program this mode.
I'll report about results, but in any case impulses counter is a very useful feature for CANx modules, IMHO.
Reply
#4
UIO16 will support impulse counter mode but I can't give an exact time frame on when it will be implemented at the moment.
Reply
#5
Well. It is better late than never.
VALSENA-DIN32 count pulses. Main problem was to tune input pin properties: debounce time was too big by default. But finally it works. Actually VALSENA has communication problem but I'll open other thread about it.
Reply
#6
We have a preliminary firmware for UIO8/16 with pulse counter input. It's not fully tested but if you want to try then it can be provided.
Reply
#7
Thank you. For now I have solution. So I can to wait until this feature will be released officially.
Or you want me to be a beta tester?
Reply
#8
Hello.
Are any news about pulses counter implementation? For CANx-UIO16 and/or CANx-UI10 devices.
Reply
#9
It has been implemented for UIO8 and UIO16 some time ago. No plans to implement it for UI10 though.
You need to reflash your device, see this guide: https://kb.logicmachine.net/canx/stm32/
Use the latest V4 version.
Reply
#10
It is great with implementation for UIO8 and UIO16. Where can I read more about this?

I am not using CANx, but I do have a LogicMachine5 RIO3 LTE with 16 i/o ports. I need to detect pulse patterns with a sliding time window.
Reply
#11
Reactor IO is similar to CANx UIO. Pulse counter outputs the number of pulses every 10 seconds. Not sure if it's suitable for your task.
Reply
#12
(21.02.2025, 08:00)admin Wrote: Reactor IO is similar to CANx UIO. Pulse counter outputs the number of pulses every 10 seconds. Not sure if it's suitable for your task.

Unfotunately, it cannot be used in my use case.

I have a gate opener with an orange lamp which blinks either fast or slow depending on if the gate is opening or closing. Via a relay this is connected to the logic machine ports producing one pulse per blink. Can you recommend the best path forward to detect opening or closing activity based on this?
Reply
#13
You can use binary input mode and event script to measure the time between each ON telegram.
Code:
value = event.getvalue()
if not value then
  return
end

tsec, tusec = os.microtime()
time = tsec + tusec / 1000000

key = 'on_time'
out = '1/1/2'

delta = time - storage.get(key, 0)
  
log(delta)

if delta < 0.4 then
  grp.checkwrite(out, false)
elseif delta < 0.8 then
  grp.checkwrite(out, true)
end

storage.set(key, time)
Reply
#14
   
(25.02.2025, 07:19)admin Wrote: You can use binary input mode and event script to measure the time between each ON telegram.
Code:
value = event.getvalue()
if not value then
  return
end

tsec, tusec = os.microtime()
time = tsec + tusec / 1000000

key = 'on_time'
out = '1/1/2'

delta = time - storage.get(key, 0)
 
log(delta)

if delta < 0.4 then
  grp.checkwrite(out, false)
elseif delta < 0.8 then
  grp.checkwrite(out, true)
end

storage.set(key, time)

Thanks - this is much appreciated. I assume that usage of the storage function will only have minor impact on wear and tear of the SD Card? Is your suggestion a resident or event-based script?

Besides the need for my gate, I also have another use case which have a higher frequency, so it will be directly connected to the local i/o ports to reduce the traffic on the bus. I found the frequency option, but I could find any description of it. Can you provide a link or similar with a description? Also here I need to test towards a given threashold within a time period. See screenshot.
Thanks Smile
Reply
#15
Database and storage use RAM and then the data is saved periodically to SD card. Script must be run as event.

Frequency converts the pulse count to pulses per second. The value is updated every 10 seconds.
Reply
#16
Thanks for your reply.

So the solution you suggested initially seems to be the only way to test against a threashold in a gliding window of 10 seconds. I will try it with higher frequency as well.
Reply


Forum Jump: