Set Multiple Bits in one Instruction - SETA Omron PLC Programming

In the field of PLC Programming we must keep our self update about the latest plc programming instructions. A plc program can be made in various ways for the same logic,but we always should try to make the plc program in the shortest way to achieve a good scan time and increase efficiency.

SETA Omron PLC Programming Instruction :-


We all know about the popular SET instruction which is available in all the PLC used for SET of a particular bit. Think if we some time need to set more than one bit at a time , than this instruction can be beneficial. The instruction is available in all the omron PLC for setting multiple bits at a time.
Instruction Syntax :- SETA D N1 N2
where :- D is the beginning word ,N1 is the beginning bit in D and N2 is the number of Bits.
For example if we write that SETA d200 #5 #4
then when this instruction is executed than the bit no 5 to 9 are set in D100.
SETA(530) turns ON N2 bits, beginning from bit N1 of D, and continuing to the left (more-significant bits). All other bits are left unchanged. (No changes will be made if N2 is set to 0.)Bits turned ON by SETA(530) can be turned OFF by any other instructions, not just RSTA(531).

RSTA Omron PLC Programming Instruction :-


Similarly to reset the multiple bits at a time we can use RSTA instruction.The syntax is same as for that of SETA.
RSTA(531) turns OFF N2 bits, beginning from bit N1 of D, and continuing to the left (more-significant bits). All other bits are left unchanged. (No changes will be made if N2 is set to 0.)
Bits turned OFF by RSTA(531) can be turned ON by any other instructions, not just SETA(530).

Note :- SETA(530) can be used to turn ON bits in data areas that are normally accessed by words only, such as the DM areas.
Note :- RSTA(531) can be used to turn OFF bits in data areas that are normally accessed by words only, such as the DM areas.

Sample PLC Program Using SETA and RSTA.

Also you can subscribe to get all latest updates in PLC Programming in yours Mail-Box.
If you have any doubts then you can write us in comment section.Subscribe to Automation-Talk by Email.

Advertisements :-

1 comment:

Get New Updates

Enter your email address:

Delivered by FeedBurner

Receive all updates via Facebook. Just Click the Like Button Below