jimcav Member J Join Date Dec 2004 Location new jersey Posts 229 Sep 26, 2011 #1 I am using rs logix 5000 with an l61 processor. i want to change the status of a single bit in a shift register without changing anything else. thx jim cav
I am using rs logix 5000 with an l61 processor. i want to change the status of a single bit in a shift register without changing anything else. thx jim cav
DamianInRochester Lifetime Supporting Member Join Date Jan 2011 Location Rochester NY Posts 1,292 Sep 26, 2011 #2 If you know exactly which bit you wish to change you can use the standard logic blocks with a mask. For example, If you have an integer with bit pattern 1100 1100 1100 1111 and you just want to set bit #3, Then just use an OR block with a mask of 0000 0000 0000 1000
If you know exactly which bit you wish to change you can use the standard logic blocks with a mask. For example, If you have an integer with bit pattern 1100 1100 1100 1111 and you just want to set bit #3, Then just use an OR block with a mask of 0000 0000 0000 1000
DamianInRochester Lifetime Supporting Member Join Date Jan 2011 Location Rochester NY Posts 1,292 Sep 26, 2011 #3 Actually, I showed you the hard way. All you really need to do is reference your tag at the bit level as a set or reset. If you tag is a DINT named Cat For example SET Cat.4
Actually, I showed you the hard way. All you really need to do is reference your tag at the bit level as a set or reset. If you tag is a DINT named Cat For example SET Cat.4
TConnolly Lifetime Supporting Member Join Date Apr 2005 Location Salt Lake City Posts 6,152 Sep 26, 2011 #4 OTL DintTag.1 DintTat.1 --------(L)-- Another way to do it (works well if the bit number is variable) CPT DintTag (DintTag OR 2**VAR) will set and CPT DintTag (DintTag AND NOT(2**VAR)) will clear. Last edited: Sep 26, 2011
OTL DintTag.1 DintTat.1 --------(L)-- Another way to do it (works well if the bit number is variable) CPT DintTag (DintTag OR 2**VAR) will set and CPT DintTag (DintTag AND NOT(2**VAR)) will clear.