power of ten

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #15696
    fischerp
    Participant

    Hello,
    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
    Peter

    #15697
    manjey73
    Participant

    In the input formula, write Cnl/100

    Documentation – Scripts and Formulas

    #15698
    fischerp
    Participant

    I 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)”.

    #15699
    manjey73
    Participant

    Is this an automatic parameter coming to another channel? Or should you change it yourself in the settlement channel, depending on the situation?

    #15700
    manjey73
    Participant

    Actually, what do you dislike about Cnl*Val(xxx) or Cnl/Val(xxx) and already calculations will be performed in the xxx channel

    #15701
    Mikhail
    Moderator

    Hello,
    I agree with the above. The power of ten should be stored in a separate channel.

    #15704
    fischerp
    Participant

    Is 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 above

    The 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?

    #15705
    manjey73
    Participant

    Cnl*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 expression

    #15706
    manjey73
    Participant

    21

    The 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 Cnl

    #15707
    fischerp
    Participant

    Thanks, this works
    great!!

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.