Bit Reading

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18326
    Hcinarli
    Participant

    Hello,
    I’m reading data from a single register in Rapid. I want to process the data by breaking it down into its individual bits. How can I do this? Or can I read it bit by bit directly? What I want to do is treat each bit as a channel—if I need to read a single register and create virtual channels, how should I define the formula? Thank you.

    #18327
    manjey73
    Participant

    Look at the formula tables.
    There is a standard formula for reading bits.

    You can check how this is organized through the Modbus driver by specifying the Bitmask and then creating channels using the wizard.

    GetBit(double val, int n) in the second line of scripts

    An example in the input formula – GetBit(Val(101), 2)
    Get the 2nd bit of the channel value 101

    #18328
    Mikhail
    Moderator

    Hello,

    I suggest editing the Modbus template and setting the Bitmask checkbox for the element. Then generate channels by a wizard. It will create calculated channels with the required formulas.

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