Pulse counter on Flexim 601


#1

I’m struggling to get a pulse output from a Flexim 601 Flow meter to register on the tag output. Any ideas what I’m not setting correctly?


#2

Is this a float, boolean, string, ect? Also what is the IO server that the Flexim 601 is using?


#4

Hi,

We were able to change the tag to point to the DI on the flexy extension to DI3 which will be called DI1 on the card itself.

I will check the rate the Analog input can be used at to keep track of the flow over a minute.


#5

Zach,

I have the proper wiring now and I’m still not seeing the pulse flow. The unit delivers a 0V pulse in npn mode and 24V in pnp mode. I don’t see anything on the ewon in either mode. Could you give me a call?


#6

#7

Attached is the sensor device I’m trying to connect.

AS_71745_FD-Q_IM_96M13515_GB_WW_1086-3 (1).pdf (1.52 MB)


#9

Hi,

This should work for your application. instead of an onchange i switch to having it pull every second. The reason for this is if the level stays the same it will not add that value for the end calculation since it did not change and would have the average off at the end. I separated the reset from the upload so you can make the API call before the total resets each minute.

TSET 1,60
TSET 2,1

ONTIMER 1, "GOTO upload"
ONTIMER 2, "GOTO counter"

REM counts the flow reading every second
COUNTER:
flow1total@ = flow1@ + flow1total@
flow2total@ = flow2@ + flow2total@
Print "Flow 1: "; flow1total@
Print "Flow 2: "; flow2total@
END

REM Takes the average then upload total flow using API
UPLOAD:
flow1total@ = flow1total@ / 60
flow2total@ = flow2total@ / 60
REM insert API upload here
Print "Uploading flow 1 and flow 2."
Print "Flow 1: "; flow1total@
Print "Flow 2: "; flow2total@
GOTO reset
END

REM reset the flow totals after upload
RESET:
Print "Reset"
flow1total@ = 0
flow2total@ = 0
Print "Flow 1: "; flow1total@
Print "Flow 2: "; flow2total@
END


#12

Zach, thanks so much for the work! I’m driving now and will give this a try as soon as I can check in later tonight. I need to set up tags for the counters at least could you take a screenshot of what that looks like and how you set them up? Thanks.


#13

The setup consists of one mem and one ewon io server tag per a flow sensor. I have the type set as floating point for all tags. this will round to the second decimal when taking the average over a minute. The two flow tags will be different for you in the addressing since I used a Flexy 201 with the io extension card in slot 4 instead of slot 1 like you have on yours.


#16

Hi,

Just to make note we have added more code to now count the pulse though a minute time frame. If there is anymore questions on the matter feel free to respond here or give us a call again.

Have a Great Day


#17

Hi Zach,

You helped develop this code with me for an average 60 second value tracker. I now need to do a quick check for bouncing around 0 values.

REM Low Value Check
LOWVALUE
if flow1total60@ < 0.1 then
flow1total60@ = 0
end if

This the routine I think I want to put in the code to set the 60 second total value to just 0.0 if it’s below 0.1. I placed it in the code once and it did not work. Can you help me fit it in where it needs to be or help change it so it works?

The currently working code is below and is doing great for us other than the bouncing values below 0 I want to set to 0.

eWON_init_section:

TSET 1,60
TSET 2,1
TSET 3,60
ONCHANGE “Pulse1”, “GOTO P1Counter”
ONTIMER 3, “GOTO PRESET”
ONTIMER 1, “GOTO upload”
ONTIMER 2, “GOTO counter”

REM counts the flow reading every second
COUNTER:
flow1total@ = flow1@ + flow1total@
flow2total@ = flow2@ + flow2total@
//Print "Flow 1: "; flow1total@
//Print "Flow 2: "; flow2total@
END

REM Takes the average then upload total flow using API
UPLOAD:
flow1total@ = flow1total@ / 60
flow2total@ = flow2total@ / 60
flow1total60@ = flow1total@
flow2total60@ = flow2total@
REM insert API upload here
Print “Uploading flow 1 and flow 2.”
Print "Flow 1: "; flow1total60@
Print "Flow 2: "; flow2total60@
GOTO reset
END

REM reset the flow totals after upload
RESET:
Print “Flow Total Reset”
flow1total@ = 0
flow2total@ = 0
Print "Flow 1: "; flow1total@
Print "Flow 2: "; flow2total@
END

REM add pulse to total when 1
P1COUNTER:
IF Pulse1@ > 0 THEN
TotPulseFlow1@ = 1 + TotPulseFlow1@
ENDIF
END

REM reset total pulses
PRESET:
Print “Pulse Total Reset”
REM Create 60 sec total
TotPulseFlow160@ =TotPulseFlow1@
TotPulseFlow1@= 0
Print " TotPulseFlow1: "; TotPulseFlow1@
END


#18

You will want to put that in the upload section and add an else statement after words. such as the following.

IF (flow1total60@ < 0.1) THEN
flow1total60@ = 0
ELSE
flow1total60@ = flow1total@
ENDIF


#19

Brilliant, that work. Thanks!