manjey73

Forum Replies Created

Viewing 15 posts - 271 through 285 (of 856 total)
  • Author
    Posts
  • in reply to: Channel Read Bits #15066
    manjey73
    Participant

    Something is not working to display the number in binary form. It shows !!! on the graph, in the table ---

    in reply to: Channel Read Bits #15063
    manjey73
    Participant

    Oops, I didn’t know there was a binary display format 🙂

    You need to add option B for the format and test it.
    Auxiliary Tables – Formats

    Custom Formats

    • This reply was modified 1 year, 2 months ago by manjey73.
    • This reply was modified 1 year, 2 months ago by manjey73.
    in reply to: Channel Read Bits #15052
    manjey73
    Participant

    Format Channel – String
    Data Type = ASCII

    public string BitsView(double number)
    {
    byte[] data = BitConverter.GetBytes(Convert.ToUInt16(number));
    uint N = BitConverter.ToUInt16(data, 0);
    string bits = Convert.ToString(N, 2);
    return bits;
    }

    Make a calculation channel with the specified parameters. Use the specified formula. Displaying a string in the channel, but only for a byte. In order for the whole number to be displayed correctly, the formula needs to be refined.

    in reply to: Channel Read Bits #15051
    manjey73
    Participant

    00000010 is a binary display of bits of a number, I don’t even know if there is support for such a display in the system. I wrote some kind of formula for this and displayed it as a string

    in reply to: Channel Read Bits #15049
    manjey73
    Participant

    Set the HEX format in the channel, perhaps this will be enough for you.

    There is a choice there

    Hexadecimal
    Hexadecimal 2 digits
    Hexadecimal 4 digits
    Hexadecimal 8 digits

    • This reply was modified 1 year, 2 months ago by manjey73.
    in reply to: Channel Read Bits #15047
    manjey73
    Participant

    00000010 in the bit representation is the number 2 in the decimal representation. Do you need to see the number in some other format?

    in reply to: Channel Read Bits #15045
    manjey73
    Participant

    GetAnyBits(Val(1080), 3, 7)
    Val(XXX) – Where is the XXX number of your channel

    00000111 is the number 7 in the bit representation
    When you need to select 3 bits in a value, you need to make a logical AND with the bits you need, and depending on which bits from the beginning you want to compare, you need to shift the bits you need so that they turn out to be starting from the zero bit

    00001111 is the number 15, which will correspond to four consecutive bits

    00000011 is the number 3, which will correspond to two consecutive bits

    01010110 – Your certain number for checking 3 bits. You need to shift this representation to position 0 (n = 2) 00010101 and make AND with the number 7 (00000111)

    in reply to: Channel Read Bits #15042
    manjey73
    Participant

    00111000

    The 0th bit is on the right. You need to shift by 3

    GetAnyBits(Val(XXX), 3, 7) like this

    • This reply was modified 1 year, 2 months ago by manjey73.
    in reply to: Channel Read Bits #15040
    manjey73
    Participant

    public double GetAnyBits(double val, int n, int mask = 1)
    {
    ulong ulVal = (ulong)val;
    return (ulVal >> n) & (ulong)mask;
    }

    I haven’t checked, but the mask should work by default. The mask is 1. Which fully corresponds to the getBit formula
    You can set 3, 7, and so on.
    n is the offset

    in reply to: Channel Read Bits #15039
    manjey73
    Participant

    public double GetThreeBit(double val, int n)
    {
    ulong ulVal = (ulong)val;
    return (ulVal >> n) & 7ul;
    }

    Here the number 7 (00000111) is used as a mask

    in reply to: Channel Read Bits #15037
    manjey73
    Participant

    If you always need to pull out 2 bits each, then you can make one formula, just like getBit. If your pairs may differ, then you will need to make a formula and install it with your hands. Modify getBit into a different formula

    public double GetTwoBit(double val, int n)
    {
    ulong ulVal = (ulong)val;
    return (ulVal >> n) & 3ul;
    }

    Here 3ul is the number 3 (00000011) and by shifting the bits by the right amount you make a logical one with two bits at once, and not one as in getBit. You can look at how much you need to shift in a calculator or even on a piece of paper.

    • This reply was modified 1 year, 2 months ago by manjey73.
    in reply to: The problem of InfluxDB on Scada V6 #15026
    manjey73
    Participant

    Perhaps the username and password should still appear in the request, even if they are empty

    in reply to: Send command #15017
    manjey73
    Participant

    Another option is to use the Auto-control Module and calculation channels for the values. But it seems to be superfluous here if Modbus is used

    in reply to: Send command #15016
    manjey73
    Participant

    Hmm, sending different values from different buttons but to the same channel is a rare task. I remember there was such a problem, just related to the fact that it is impossible to specify a value when selecting “Send command immediately”

    You need to make several calculation channels that will have their own formulas with different values to specify these channels in the buttons.

    The Modbus device to which you are sending commands?
    Add additional commands to the template that will lead to the same register and link them to the created channels.

    in reply to: Send command #15009
    manjey73
    Participant

    Once you have indicated that the channel type is hex, write in the output formula of channel 111e and specify “Send command immediately” on the mnemonic and check.

    If you need to send different values using different buttons, then you probably need to write a formula and use an enumeration.

Viewing 15 posts - 271 through 285 (of 856 total)