Forum Home › Forums › Understanding the Software › Using Formulas › power of ten
- This topic has 9 replies, 3 voices, and was last updated 8 months, 3 weeks ago by
fischerp.
-
AuthorPosts
-
December 2, 2024 at 8:27 pm #15696
fischerp
ParticipantHello,
I receive values via Modbus that consist of a number and the factor as a power of ten. How can I turn the power of ten into a number? Or, better asked, how do I calculate the correct value 235, for example, from the combination of 23500 (value) and -2 (factor as a power of ten).
Hopefully the question is understandable despite my poor English.
Thanks for your help
PeterDecember 3, 2024 at 6:22 am #15697manjey73
ParticipantIn the input formula, write Cnl/100
December 3, 2024 at 7:40 am #15698fischerp
ParticipantI probably expressed myself in a misleading way. It is not a static factor, that would not be a problem. They are factors that change depending on the operating status.
“how do I calculate the correct value 235, for example, from the combination of 23500 (raw value) and -2 (factor as a power of ten)” In the example above, the factor can then change to -1 or -3 during the runtime, which would then of course be 0.1 or 0.001. It is therefore a matter of evaluating the specified power (power) so that the actual value can then be specified in a formula in the form “Cnl*Val(xx)”.December 3, 2024 at 9:40 am #15699manjey73
ParticipantIs this an automatic parameter coming to another channel? Or should you change it yourself in the settlement channel, depending on the situation?
December 3, 2024 at 9:41 am #15700manjey73
ParticipantActually, what do you dislike about Cnl*Val(xxx) or Cnl/Val(xxx) and already calculations will be performed in the xxx channel
December 3, 2024 at 9:50 am #15701Mikhail
ModeratorHello,
I agree with the above. The power of ten should be stored in a separate channel.December 3, 2024 at 10:21 am #15704fischerp
ParticipantIs this an automatic parameter that appears in another channel? Or should you change it yourself in the billing channel, depending on the situation?
There are two registers (and therefore two channels), one with the raw value and one with the power of ten. Since the factor is not fixed, but changes from time to time, I cannot specify a fixed factor, but have to calculate it permanently from the given values (powers of ten).if I could calculate the factor automatically from the power of ten, then the proposed solution would be optimal. So -1 is 10^-1 i.e. 0.1.
So there should be a formula of the following type: Cnl*(10^(power of ten(Valxx))What do you have against Cnl*Val(xxx) or Cnl/Val(xxx) and the calculation is done in the xxx-channel.
This is basically my idea, but I don’t have the factor (e.g. 100) in the second channel, but the power of ten. See aboveThe power of ten should be stored in a separate channel.
This is exactly the problem. The channel does not contain the factor, but the power of ten of the factor. So the question is: How can I calculate the factor from the power in Rapid Scada?
December 3, 2024 at 1:51 pm #15705manjey73
ParticipantCnl*Math.Pow(10, Val(xx))
where xx is the channel number where the degree is stored. I’m not sure that’s the right way to do it.
And will the formula engine accept this expressionDecember 3, 2024 at 2:22 pm #15706manjey73
ParticipantThe channel formula contains 23500*Math.Pow(10, Val(105))
Channel 105 is a channel in the Hello World Project Simulator in which I enter the degree = -1, -2 and so on. That is, instead of 23500 there should be CnlDecember 3, 2024 at 7:36 pm #15707fischerp
ParticipantThanks, this works
great!! -
AuthorPosts
- You must be logged in to reply to this topic.