Somachine basic v1.6 flow meter programming

auto123

Member
Join Date
Jun 2020
Location
port louis
Posts
4
Hello,

I am new to plc programming. I am trying to program a flow meter (E&H promag 50) in somachine basic to achieve the following:


1. Trigger an output when a certain amount of liquid has passed through a pipe. For this, I've tried a positive edge detection input with an up-counter but the number of pulses required (amount of liquid) is higher than the preset value of the counter.

2. obtain a flow totaliser

Can someone explain how to do the programming in somachine basic?
 
Are you using a high speed input or just standard I/O, I know that the E&H can be programmed to x pulses per volume, very often these are programmed as 1 pulse per litre so if the flow rate is not too high you may catch it with normal I/O, anyway, why not increment on a one shot a double integer
I have no idea about that particular plc software but create a one shot off your input and increment a 32 bit double word. could be called a long integer Dword etc. There may be 32 bit counters as well as 16 bit check the documentation.
 
It sounds like you may need to change the flowmeter pulse output configuration. If you are working in cubic metres for your "trigger an output" but your flowmeter is giving a pulse every 10 Litres then you've got unnecessarily high resolution.

If I'm expecting less than 3000m3/day then I configure my meter for 1 pulse every 0.1m3

Up to 30,000m3/day I use one pulse per m3.

That lets me use a 16 bit unsigned int and still have room for unexpected higher volumes (0-6553.5m3 or 0-65535m3 depending on pulse configuration)

If you can't modify the flowmeter, then use two counters. Lets say you can only count every 1L but you need to turn on your output when you get to 100,000L - so your first counter has a preset of 1000, and trigger the reset as soon as the preset is reached and the counter output is true. Use the first counter output to drive the input on your second counter. The second counter has a preset of 100.

What that does is essentially gives you 100 counts of 1000L which is 100,000L.

Hope that makes sense.
 
Thanks for your replies. Its really helpful.

I have one more question. In the software, I can use either a count-up/down/up-down counter by entering a count value from 0-9999 and get only an output bit from the counter. How do I use a counter to increment a 32 bit dword?
 
Last edited:
There are a number of ways, I do not know the software you are using but for example: you could set the pre set of the counter to 1000, and the "Q" output of the counter will go true, use this to add 1000 to the double word.
see a couple of ways in the picture:
The first couple of rungs are using two counters (note: for testing purposes only set the counter to 10 should be 1000) when it reaches 1000 the output bit turns on, this then adds one to the second counter so counts the 1000's, the last rung of this times the 1000's counts and adds the first counter (units)
On the next scan the counter 1 is reset back to 0. so for example. Counter 2 is at 2 (2000) counter 1 is at 400 so total is 2400.

The final rungs show how you can create a one shot bit from the flow meter input and use this to add 1 to a double word. without the use of counters. As I say I have no idea how you will do this in your editor but it's basic type code and most PLC's have similar functions.

Flowmeter.png
 
I think you need to use %MD for a double word address for example %MD100
I believe if you use the high speed counters then these can have a double word for the count value (I assume that there is a special function block for the HSC).
See this manual it shows high speed counters using the I/O & how to configure them, it appears that you can configure the HSC in the somachine basic, take note on a true/false parameter for double word use this will give you counts into the millions.
http://pneumatykanet.pl/wp-content/...221-Logic-Controller-Programming-Guide-EN.pdf

Read from page 96 on high speed counters. there it shows the configuration of the different types.
 
Last edited:

Similar Topics

Hi all, I've been trying to develop modbus rtu program between uv balasts and plc ı'have 6 slave balast.I am reading fault run voltages etc...
Replies
0
Views
1,198
hello eveyrone I want to make an application with M221 PLC in SOMACHINE BASIC program. I request your valuable help. I have a 50 ms pulse...
Replies
1
Views
1,604
Hi Guys, I'm using M221(TM221CE24R) PLC and SoMachine Basic from Schneider and having a bit of problem. 1. I can't able to read the data from...
Replies
1
Views
1,748
I downloaded SoMachine Basic, I'm looking to maybe use an M241 in an upcoming project. It seems that the basic vs, doesn't offer Tag based...
Replies
2
Views
3,054
Hello! I am new at PLC programming. I am using TM221CE16R PLC with TM3AI8 analog input module and SoMachine Basic v1.6. I am trying to scale...
Replies
8
Views
7,072
Back
Top Bottom