F
In Cimplicity HMI version 6 I want to do the following:
To limit the amount of I/O's between the PLC and Cimplicity, we put 31 successive flags (virtual Cimplicity points) in 1 register. The PLC then 'disassembles' this register into real PLC-flags. The problem is when we want to reset such a flag (for set we use a or-function in the script: pointset reg,(2^offset or valreg) where valreg is the value of the register before we do the pset and offset the bitposition in the register;x^y=x to the power y )
We can't reset the whole register because other flags have to be still in a high-state.
Short example (4 bits):
in the sequence: 1001 I want to reset the first bit on the left. I tried with a xor:
1001 xor 1000=0001 (pset reg,(valreg xor 2^offset)) that's ok, but
0001 xor 1000=1001: not what I want, a state low changes in high (0001 xor 0=0001 is good for me, but when to know if you have to xor with zero or 2^offset?)!
Please help me (the available logic functions in Cimplicity: and, or, not, xor and shr,shl).
To limit the amount of I/O's between the PLC and Cimplicity, we put 31 successive flags (virtual Cimplicity points) in 1 register. The PLC then 'disassembles' this register into real PLC-flags. The problem is when we want to reset such a flag (for set we use a or-function in the script: pointset reg,(2^offset or valreg) where valreg is the value of the register before we do the pset and offset the bitposition in the register;x^y=x to the power y )
We can't reset the whole register because other flags have to be still in a high-state.
Short example (4 bits):
in the sequence: 1001 I want to reset the first bit on the left. I tried with a xor:
1001 xor 1000=0001 (pset reg,(valreg xor 2^offset)) that's ok, but
0001 xor 1000=1001: not what I want, a state low changes in high (0001 xor 0=0001 is good for me, but when to know if you have to xor with zero or 2^offset?)!
Please help me (the available logic functions in Cimplicity: and, or, not, xor and shr,shl).