S7-200 and EM231 : weighing amount of water

melon52

Member
Join Date
Jun 2013
Location
setif
Posts
16
Hello everyone,
I want to weigh a certain amount of water (in kg). For this I use an S7-200 (CPU226) and EM231 analog module. I did the program in question, but I do not know if correct or not. Thank you for any help or advice. (I am a beginner in this field).
 
Last edited:
melon, it's hard to read it withou comments. could you explain how stuff should work or what is what.
as for scaling, it's siemens library as i noticed and as that it should be ok. also you didn't mention if it's voltage or current measurment on voltage (or current) input card.
 
AIW0 corresponds to the voltage (0-10V) provided by the weight indicator. I open the valve (Q0.0) for weighing the water on a balance and closes the valve when the desired weight is reached.

weighing_water.jpg
 
first as you have 0-10V input the scale is 0-32000 not 6400-32000.
ok, what's flying weight?

EDIT:
when calculating weight, try call once S_ITR and save the result in memory rather than call the subroutine more times.
 
Last edited:
flying_weight is the weight of the amount of water (estimated) located after the closing of the valve and which is not yet occurred in the balance.

Code:
when calculating weight, try call once S_ITR and save the result in memory rather than call the subroutine more times.
? How should I proceed? thank you
 
Last edited:
ok, i'll try to rewrite it.
first remarks for your future work:
  • don't use multiple coil for same output like you do with Q0.0 - coil can only have one of two states and doing that will result that output will follow the last one coil (as outputs are set at end of program cycle) and disregard previous, in your case output Q0.0 will follow only the coil in network 3.
  • settling time - i guess you wanted to prevent oscillation of AIW around target weight. AIW will rarely be same even when valve is closed, so you either use hysteresis (tolerance can act like that) or you use TOF (Off delay) with (weight < target) as IN that will keep the valve opened for additional minimum period that IN has to be false to start closing.
  • use less SR instruction. set/reset can cause undesirable effect if you forget one action somewhere or if stuck in the middle. try combine condition and if SR is unavoidable use it at minimum.
 

Similar Topics

Hello everyone, I want to weigh a certain amount of water (in kg). For this I use an S7-200 (CPU226) and EM231 analog module. I did the program...
Replies
1
Views
1,281
I am facing problem in S7200 analog module 8AI ,no indication in module i.e 24V indication How to check further in to this
Replies
7
Views
2,807
Hi, I have purchased 2 x 6ES7 231-7PD22-0XA0, Analog input Thermocouple module, I cannot find any manuals on how to configure thermocouple type...
Replies
5
Views
5,826
Hello everybody My plc is S7-200 CPU226+EM231 AI2×RTD,when connect to Pt100 all is OK,i.e. when the temperature is 30 ℃,the data AIW0 is...
Replies
5
Views
3,901
Hi all, Currently having trouble getting a speed reference to write over modbus to an Omron M1... I can successfully write a run command and...
Replies
2
Views
30
Back
Top Bottom