公式得使用
发布时间:2022-01-21
1.
2. 如果输入通道公式包含“;”,则该公式将计算输入通道的值和状态。分号之前的第一部分是用于计算值的公式,分号之后的第二部分用于计算状态。
对输出通道使用公式的规则:
1. 处理具有以下内容的输出通道的公式标准和二元命令类型。
2. 输出通道的公式定义了标准命令的命令值计算,并定义了二进制命令的命令数据计算。
公式中可访问的变量:
CnlVal, Cnl | double | The input channel value transmitted to Server before calculation |
CnlStat | int | The input channel status transmitted to Server before calculation |
CmdVal, Cmd | double | The command value transmitted to Server before calculation |
CmdData | byte[] | The command data transmitted to Server before calculation |
CnlNum | int | The channel number for which the formula is calculated |
E | double | The natural logarithmic base, specified by the constant, e |
PI | double | The ratio of the circumference of a circle to its diameter, specified by the constant, π |
N(n) | int | Returns the specified channel number for updating numbers on cloning |
Val() | double | Gets the current value of the formula channel |
Val(n) | double | Gets the current value of the channel n |
SetVal(n, val) | double | Sets the current value of the channel n |
Stat() | int | Gets the current status of the formula channel |
Stat(n) | int | Gets the current status of the channel n |
SetStat(n, stat) | int | Sets the current status of the channel n |
SetData(n, val, stat) | double | Sets the current value and status of the channel n |
Abs(x) | double | Calculates the absolute value of a number |
Sin(x) | double | Calculates the sine of the specified angle |
Cos(x) | double | Calculates the cosine of the specified angle |
Tan(x) | double | Calculates the tangent of the specified angle |
Exp(x) | double | Calculates e raised to the specified power |
Ln(x), Log(x) | double | Calculates the natural (base e) logarithm of a specified number |
Sqr(x) | double | Calculates the square of a specified number |
Sqrt(x) | double | Calculates the square root of a specified number |
公式中可访问的函数: