Forum Home › Forums › Understanding the Software › Formulas in input channel
This topic contains 10 replies, has 2 voices, and was last updated by Mikhail 2 months ago.

AuthorPosts

September 12, 2017 at 7:00 am #2551
Hi there.I am having trouble running codes in the input channel of the Modbus.Basically I have a pipe modal whereby, an input channel is assumed and the assumed value would be calculated in the formula given below to get the output values which is the output channel as well.Please help me out with a simple coding that can be used.Let me know if any changes in to be made.
p2= output pressure (Output channel)
p1= input pressure(Input channel)
ρ=density of water(1000kg/m3)
f=friction factor ( 0.05)
L=length of pipe (12m)
v= velocity of water (3m/s)
D=pipe diameter (0.1m)p2=p1(ρ*f*L*v2/2D)
September 13, 2017 at 7:20 am #2555Hi,
1. Add the constants to the Formulas table like this:
const double D = 0.1;2. Create an additional input channel (number 2, for example) of the “Calculated real” type and specify a formula for this channel:
Val(1)p*f*L… (I don’t understand the end of the formula)
1 – is the number of the input channel for p1.3. Download the new version of Automatic Control Module
http://rapidscada.org/download/mod_auto_control/mod_auto_control_5.2.1.0_en.zip
and setup sending command on change of channel 2In case of follow up questions provide screenshots of your settings.
September 13, 2017 at 10:08 am #25581. Do you mean i should add the constants to the Formulas table like this:
const double p2= output pressure (Output channel)
const double p1= input pressure(Input channel)
const double ρ=1000;
const double f= 0.05;
const double L= 12;
const double v= 3;
const double D= 0.1;Do i need to add on anything else at the start of the codes like “namespace” or “system” since its reads programming C#.Do you have any working example format of formulas so I can study how to insert formulas in the channel.
2.So I should have 2 input channels is it?.Input channel 1 should be the value is received from Modbus and channel 2 I should place in formulas in the SCADA administrator.?
Val(1)(p*f*L*v^2)/2D–p multiply with f,l, and the square of v.Then divide 2*D
1 – is the number of the input channel for p1Thank you!
 This reply was modified 2 months, 1 week ago by manraj.
September 13, 2017 at 3:06 pm #2564const double p2= output pressure (Output channel)
const double p1= input pressure(Input channel)
const double ρ=1000;
const double f= 0.05;
const double L= 12;
const double v= 3;
const double D= 0.1;September 13, 2017 at 3:07 pm #2565Do i need to add on anything else at the start of the codes like “namespace” or “system” since its reads programming C#.Do you have any working example format of formulas so I can study how to insert formulas in the channel.
You don’t need namespace and usings. The examples are already in the Formulas table.
September 13, 2017 at 3:08 pm #25662.So I should have 2 input channels is it?.Input channel 1 should be the value is received from Modbus and channel 2 I should place in formulas in the SCADA administrator.?
Yes. The input channel 2 is the calculated value that is needed to be sent as a command.
September 13, 2017 at 5:18 pm #2567I got it thank you very much.I will create the formulas and update here if there is any problem. Thank you!
September 17, 2017 at 5:05 pm #2579Hi!
Is there away to place formulas in the condition of a dynamic picture? because i tried putting Val(input channel) but it only read real number.
September 18, 2017 at 5:34 am #2581Hi,
You should create an input channel of calculated type and use its value for a dynamic picture.September 18, 2017 at 4:30 pm #2583So does this mean I only can put a calculated values in the conditions of the dynamic pictures and not the formula itself.
September 19, 2017 at 1:40 pm #2589Yes, you right.

AuthorPosts
You must be logged in to reply to this topic.