Forum Home › Forums › Understanding the Software › Using Formulas › Using formulas bit confusing
- This topic has 4 replies, 3 voices, and was last updated 6 years, 6 months ago by Mikhail.
-
AuthorPosts
-
June 28, 2016 at 10:21 am #1359ramboParticipant
I have got some success simulating a channel for temp reading, As far as I see, the communicator device data table displays all values in decimal format.
that means raw values ( modbus TCP ) massage is decoded and converted into decimal.
I have add Getbyte formula ( as suggested by Mikhail in other query)
public double GetByte(double val, int n)
{
UInt64 uintVal = (UInt64)val;
return (uintVal >> (n*8)) & 0xFF;
}I am trying to read byte bye means of putting Getbyte(Cnl,0) in formula of input channel.
Scada server restart shows error
2016-06-28 15:25:34 <****><SYSTEM><ERR> Error compiling the source code of the formulas:
Line 429, column 55: error CS0103: The name ‘Getbyte’ does not exist in the current
contextAlso I have tried with GetBit (Cnl, 0)
Same result
2016-06-28 15:25:48 <*****><SYSTEM><ACT> Formulas are read from the configuration database
2016-06-28 15:25:49 <*****><SYSTEM><ERR> Error compiling the source code of the formulas:
Line 429, column 55: error CS0103: The name ‘Getbit’ does not exist in the current context
See the file C:\SCADA\ScadaServer\Log\CalcEngine.cs with the source code
2016-06-28 15:25:49 <*****><SYSTEM><ERR> Normal program execution is impossible.
2016-06-28 15:29:21 <******><SYSTEM><ACT> ScadaServerService is stoppedWhere I am doing the mistake…..
I am trying to capture the actual massage bytes and bits.
Pls Help
Regards,
June 28, 2016 at 2:46 pm #1360MikhailModeratorFunction and variable names are case sensitive. Check it.
June 29, 2016 at 11:36 am #1371ramboParticipantYou are right ….
Its working now… thanks a lot.
September 11, 2017 at 2:14 pm #2547manrajParticipantI having trouble running my addition codes in SCADA,I am looking to take a value from the MODbus operator as an input value for this codes.
/*
* C# Program to Get a Number and Display the Sum of the Digits
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;namespace Program
{
class Program
{
static void Main(string[] args)
{
int num, sum = 10,while (num != 0)
{
num = num / 10;
sum = sum + num;
}}
}Please show me an example of a simple addition coding to test it in the scada configuration.I have a basic level C# coding only.
September 11, 2017 at 4:04 pm #2548MikhailModeratorPlease create a new topic and describe what calculations you need.
-
AuthorPosts
- You must be logged in to reply to this topic.