check the status of one or more bits in 2 bytes

Forum Home Forums Understanding the Software check the status of one or more bits in 2 bytes

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #662
    jeeslo
    Participant

    According to the table below 16 bit where 1 is closed and contactor open contact 0

    bit 0 Red connected.
    bit 1 Group connected.
    bit 2 Group connected redundant.
    bit 3 Group redundant prepared.
    bit 4 Group redundant available.
    bit 5 redundant Group is based.
    bit 6 Start O (external demand).
    bit 7 Request redundant group as a base.
    bit 8 Petition based group.
    bit 9 Priority Group.
    bit 10 Reception / remote alarm reset.
    bit 11 Auxiliary Service 1 connected.
    bit 12 Service 2 auxiliary connected.
    bit 13 Auxiliary Service 3 connected.
    bit 14 connected auxiliary service.
    bit 15 Auxiliary Service 5 connected

    The decimal value that gives me such SCADA 65014 communicator is so serious that in binary 1111110111110110. My problem is that the state is variable or SCADA comunicator changing and can be many combinations in decimal and I want to present in the SCADA-scheme editor each of the separate state, but not how to make it happen in the SCADA-scheme editor! or condition use! or formulas to extract the state of each bit … sorry I do not understand how to do it

    #669
    Mikhail
    Moderator

    Hi,
    You need a one input channel of type Real for the value received from a device. Then you should create a separate input channel of type Calculated discrete for the each value. Use such formula for those channels:

    GetBit(Val(1),2)

    where 1 – the Real channel number, 2 – bit index

    #674
    jeeslo
    Participant

    Hello Mikhail

    I used the formula that you mention:

    GetBit (Val (1), 2)

    But when you turn the formula around the entire communication is disabled, apparently the variable “GetBit” the problem is to remove only this line the system recovers again. The test did in version 4.4 and 4.5 and is the same problem.

    Below is a sample image

    http://postimg.org/image/8e82s69zl/

    Eje

    • This reply was modified 8 years, 7 months ago by jeeslo.
    #676
    Mikhail
    Moderator

    Hi,
    Sorry, I didn’t catch what the problem is? Could you give an additional example, please?

    #677
    jeeslo
    Participant

    Hello Mikhail!

    I have a Generator-Electric which communicates with the Modbus protocol to the SCADA-comunicator where the value received is (16bit) this value changes depending on the variety of states. The problem is to work with the state of each binary bit and seeing it so clear to working with the representation in Scada-Sheme.

    I must make use formula?

    Status Table:
    bit 0 Red connected.
    bit 1 Group connected.
    bit 2 Group connected redundant.
    bit 3 Group redundant prepared.
    bit 4 Group redundant available.
    bit 5 redundant Group is based.
    bit 6 Start O (external demand).
    bit 7 Request redundant group as a base.
    bit 8 Petition based group.
    bit 9 Priority Group.
    bit 10 Reception / remote alarm reset.
    bit 11 Auxiliary Service 1 connected.
    bit 12 Service 2 auxiliary connected.
    bit 13 Auxiliary Service 3 connected.
    bit 14 connected auxiliary service.
    bit 15 Auxiliary Service 5 connected

    #679
    Mikhail
    Moderator

    Hi,
    Does GetBit function work? If not, what are the symptoms?

    #714
    jeeslo
    Participant

    Hi Mikhail

    The “Get Bit” function does not work me, when active formula in the Scada-Administrator as you suggest happens that the Scada-Comunication and Scada-Server stop working. Below error log

    Scada-Comunicator LOG:
    2015-11-17 18:11:24 <LM-SRVSCAD-V><SYSTEM><ACT> Disconnect from SCADA-Server
    2015-11-17 18:11:44 <LM-SRVSCAD-V><SYSTEM><EXC> Error connecting to SCADA-Server: You can not make a connection because the target machine expressly rejected that connection 127.0.0.1:10000

    Scada-Server LOG:
    2015-11-17 18:17:59 <LM-SRVSCAD-V><SYSTEM><ACT> ScadaServerService is started
    2015-11-17 18:17:59 <LM-SRVSCAD-V><SYSTEM><ACT> Module is loaded from the file C:\SCADA\ScadaServer\Mod\ModAutoControl.dll
    2015-11-17 18:17:59 <LM-SRVSCAD-V><SYSTEM><ACT> Check the existence of the data directories is completed successfully
    2015-11-17 18:17:59 <LM-SRVSCAD-V><SYSTEM><ACT> Check the existence of the configuration database files is completed successfully
    2015-11-17 18:17:59 <LM-SRVSCAD-V><SYSTEM><ACT> Input channels are read from the configuration database. Active channel count: 320
    2015-11-17 18:17:59 <LM-SRVSCAD-V><SYSTEM><ACT> Ouput channels are read from the configuration database
    2015-11-17 18:17:59 <LM-SRVSCAD-V><SYSTEM><ACT> Users are read from the configuration database
    2015-11-17 18:17:59 <LM-SRVSCAD-V><SYSTEM><ACT> Formulas are read from the configuration database
    2015-11-17 18:17:59 <LM-SRVSCAD-V><SYSTEM><ERR> Error compiling the source code of the formulas:
    Line 452, column 57: 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
    2015-11-17 18:17:59 <LM-SRVSCAD-V><SYSTEM><ERR> Normal program execution is impossible.

    #715
    Mikhail
    Moderator

    Hi!

    GetBit appears since Rapid SCADA v.4.5
    I think you have tried to use this formula in v.4.4

    #716
    Mikhail
    Moderator

    You can import C:\SCADA\BaseDAT\formula.dat from the distributive v4.5 using SCADA-Administaror. It contains GetBit function.

    #725
    jeeslo
    Participant

    Hi Mikhail!! good news

    This is the problem!!!!

    It turns out that I tested with 4.4 and 4.5 but not working. Then there are 2 different versions 4.5.0.3 and 4.5.0.5 with the latest version works perfectly if you bring this GetBit.

    Thank you very much for your attention and resolving closed topic

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