Request help for Shift Registering Method in S7200 PLC

jaffarsaleem

Member
Join Date
Jan 2012
Location
uae
Posts
5
Dear Friends,

how are you ? i have small doubts in PLC.Can anyone Please clarify on this . My doubts is

1. i have 3 Pumps, the 3 pumps to be work one by one. if all the pumps work after 1 hour pump should stop. Next time same above function repeat but now 2nd pump start as first, 3rd pump start as second and 1st pump start as third after one hour again all pump stop. next time 3rd as first, 1st as 2nd, 2nd as 3rd.

For the above operation, i want to use Shift register. but i dont know how to use Shift register in S7200. Can anyone please clarify Briefly about this or anyone Send any link related to the above.


Looking For reply



:unsure::ROFLMAO:🙃(y)
 
Jaffar,

I think that using a shift register could be more difficult than using indirect addressing (use an address to contain another, true used address for a function. Using the indirect-address method, you can set up three addresses that always contain the address or number of the next-to-run pump sequence.

For example, if the next time, the pumps should run in sequence 2, 1, 3, then Indirect Address #1 would contain the address of Pump 2, Indirect Address #2 would contain the address of Pump 1, and Indirect Address #3 would contain the address of Pump 3. The sequence can easilly be switched at any time. In your case, you probably should do the address shifting just after the last pump 1-hour run time. After each run, you just move Indirect Address 2 to 1, and 3 to 2, and then load the number of the last running pump into Indirect Address #3.

On the other hand, if you set up a shift register, each time a pump runs, you will have to program a routine to load the last running pump number back into the top of a first-in-first out shift register, otherwise after 3 runs it will be empty and no other runs could be made. So it seems that the shift register method could be made to work, but not as easily and efficiently as the indirect-addressing method. Read Chapter 7.2 of your Siemens S7-200 System Manual.

7.2 Indirect Addressing of the CPU Memory Areas
Indirect addressing uses a pointer to access the data in memory. The S7-200 CPU allows you to use pointers to address the following memory areas indirectly: I, Q, V, M, S, T (current value only), and C (current value only). You cannot address individual bit or analog values indirectly.

Creating a Pointer
To address a location in memory indirectly, you must first create a pointer to that location. Pointers are double word memory locations that contain the address of another memory
location. You can only use V memory locations or accumulator registers (AC1, AC2, AC3) as pointers. To create a pointer, you must use the Move Double Word (MOVD) instruction to
move the address of the indirectly addressed memory location to the pointer location. The input operand of the instruction must be preceded with an ampersand (&) to signify that the
address of a memory location, instead of its contents, is to be moved into the location identified in the output operand of the instruction (the pointer).

Example: MOVD &VB100, VD204
MOVD &MB4, AC2
MOVD &C4, VD6

Note:If you want to access a word or double word value in the I, Q, V, M, or S memory areas indirectly, you must specify the address of the value’s initial byte as the input operand of the MOVD instruction used to create the pointer. For example, VB100 is the address of the initial byte of VW100, and MB4 is the address of the initial byte of MD4. If a symbol name was assigned to the word or double word value, then you cannot use that symbol name in the MOVD instruction used to create the pointer since the address of the value’s initial byte must be specified in the instruction’s input operand. You must assign a different symbol name to the address of the initial byte of the word or double word memory location for use in pointer creation under these circumstances.

Example: ‘‘Pump_Speed’’ assigned as the symbol name for VW100
‘‘Pump_Speed_IB’’ assigned as the symbol name for VB100
(which is the initial byte of the word value stored in VW100)
MOVD &‘‘Pump_Speed’’, AC1 illegal (&VW100 is not allowed)
MOVD &‘‘Pump_Speed_IB’’, AC1 correct (&VB100 is OK)

Using a Pointer to Access Data
Entering an asterisk (*) in front of an operand for an instruction specifies that the operand is a pointer. Using the example shown in Figure 7-9, *AC1 specifies that AC1 is a pointer to the word-length value being referenced by the Move Word (MOVW) instruction. In this example, the values stored in both V200 and V201 are moved to accumulator AC0.

Modifying Pointers
You can change the value of a pointer. Since pointers are 32-bit values, use double-word instructions to modify pointer values. Simple mathematical operations, such as adding or incrementing, can be used to modify pointer values. Remember to adjust for the size of the data that you are accessing:
1. When accessing bytes, increment the pointer value by one.
2. When accessing a word or a current value for a timer or counter, add or increment the pointer value by two.
3. When accessing a double word, add or increment the pointer value by four.
Figure 7-10 shows an example of how you can create an indirect address pointer, how data is accessed indirectly, and how you can increment the pointer.
 
Last edited:
Jaffar,

I think that using a shift register could be more difficult than using indirect addressing (use an address to contain another, true used address for a function. Using the indirect-address method, you can set up three addresses that always contain the address or number of the next-to-run pump sequence.

For example, if the next time, the pumps should run in sequence 2, 1, 3, then Indirect Address #1 would contain the address of Pump 2, Indirect Address #2 would contain the address of Pump 1, and Indirect Address #3 would contain the address of Pump 3. The sequence can easilly be switched at any time. In your case, you probably should do the address shifting just after the last pump 1-hour run time. After each run, you just move Indirect Address 2 to 1, and 3 to 2, and then load the number of the last running pump into Indirect Address #3.

On the other hand, if you set up a shift register, each time a pump runs, you will have to program a routine to load the last running pump number back into the top of a first-in-first out shift register, otherwise after 3 runs it will be empty and no other runs could be made. So it seems that the shift register method could be made to work, but not as easily and efficiently as the indirect-addressing method. Read Chapter 7.2 of your Siemens S7-200 System Manual.
Dear Lancie,

thanks for your comment. i was already try this one. but i can't fulfil. can you send any sample program to me. please i am waiting for your reply
 
The only sample I have for a pump alternator does not use shift registers or indirect addresssing, and it is an Allen Bradley RSLogix program, not Siemens S7-200.
 
Thanks Lancie,

i will try indirect addressing method for my pump operation. but i have to know i have to create 3 subroutine for each shift with indirect address or 1 subroutine we can handle all this.
 
Jaffar,

You may program each method with no subroutines at all, or 1 subroutine for each method. I would do it without any subroutines, only some networks (or ladder rungs) in the main program.
 
jaffar, perhaps you have done so already, but if not, check the s200 manual and read about the Roll Byte/Left/Right instructions, with a bit of tweaking, sounds ideal for your application.
 

Similar Topics

Hi,I need to build a PLC panel with a CUP & I/O cards, the panel to be communicated with a remote (500 meter away) extension module station. I...
Replies
9
Views
2,539
Hey guys, was hoping someone could give me a bit of advice here in a couple spots. I'll start off with my dumb code and explain after...
Replies
10
Views
2,820
Peter, I have been following all of your posts since 2009. We (PLCS.NET forum), are all amazed at your acquired empirical knowledge to identify a...
Replies
8
Views
2,443
I recently had a request that was pretty vague and was wondering if anyone could guide me on some questions I should ask. The request from the...
Replies
6
Views
2,433
I am looking to see if somebody can assist me with a pdf copy of the attached SLC500 RSS file. Thank you Jeff
Replies
5
Views
1,983
Back
Top Bottom