Beijer Electronics (formerly QSI Corporation)
http://www.qsiforums.com/

Bit Level Logic Example
http://www.qsiforums.com/viewtopic.php?f=23&t=3892
Page 1 of 1

Author:  Ron L. [ Mon Nov 16, 2009 4:05 pm ]
Post subject:  Bit Level Logic Example

Code:
init commobj := modbuscomm
init parent := default
init register := 1
init vartype := mb_uint16

'example code in MBVirtualRegisterV2
func ValueChanged()
    dim u as unibyte

    u := intvalue

    if (u and unibyte(0x01)) <> 0 then

    else

    endif
    if (u and unibyte(0x02)) <> 0 then

    else

    endif
    '...
    if (u and unibyte(0x80)) <> 0 then

    else

    endif
endfunc

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/