Shift register S7 300

alielectrical

Member
Join Date
Mar 2003
Location
Toronto
Posts
47
Dear Friends,
I am progressing from S7 200 to S7 300, self study.
I was able to program bottling example by shifting bit SHRB in S7 200.
But there is no SHRB in S7 300, only SHR_W and SHR_I.
How do I track a bit?
Because I am not clear as to how can I convert the bit move to word move, as required by SHR_W.
Thanks in anticipation.
ali
 
In STEP7 try the Standard Library / TI to S7 folder. You will find there an FC92 named SHRB. It's a shift register for bits.


Problem solved?

Ken
 
I thought that some month's ago somebody pointed out that there is a 'shift bit'-instruction, in S7-300 but only in STL. I would say go for 'help on STL' and search for this, because I do not have STEP7 on my current pc.
 
From Siemens S7 LAD manual:​






"​
The SHR_W instruction is used to shift bits 0 to 15 of input IN bit by bit to the right. The input N specifies the number of bits by which to shift."







So, there's nothing about shifting words.:confused:
To make out of it working shift register - use same data word for IN and OUT parameters.​


 
Ok, I'm a bit miffed, what was wrong with my answer?
Alielectrical wanted a SHRB function in S7-300 and what I pointed him to is described in Siemens' manual as -

The Bit Shift Register (SHRB) function shifts a bit into a shift register from the indicated source (DATA). New data is read from the source each time the instruction is executed, and this data is shifted into the shift register starting location (S_BIT) while the RESET input has a signal state of 0. All successive bits are shifted by one. The bit contained in the last location (S_BIT + N) is lost after the shift. Whenever the RESET input is et to 1, the locations in the table are set to 0 rather than being shifted.


(In this case, N defines the length of the shift register)

I thought this was what he wanted?

Ken
 
Ken M said:
In STEP7 try the Standard Library / TI to S7 folder. You will find there an FC92 named SHRB. It's a shift register for bits.


Problem solved?

Ken
Dear Ken,
thanks for your reply, I went to FC92, it is alright Bit Shift register,
but it does not say how to use it. No help avaiable, because the block is protected.
How can I use it?
Thanks
ali
 
Dear Simon,
I tried to use SHL_W, but i do not know how to use EN, MW for detection.
So I used the detect bit to convert to Word, and then OR_ed
it with itself to detect any subsequent detect bit.
This word i then fed to EN of SHL_W.
My logic works OK provided I use separate Input I2.1, for Defective part detection and Input I2.2 for Shift register.
How can I use the same Clock pulse to detect the defective part as well as Shift the register?
I am attaching zip file, because I could not paste the logic.(If you can help me, I will paste logic for others to see)
 
Dear Jacekd,
I think I am following what you said, but then I have to use two inputs, one I2.1 to detect the defective part and another input I2.2 to clock the pulse to shift. Kindly refer to Shift1.doc file.
Any suggestion to correct my dilemma will be appreciated.
Thanks,
 
Ali

Of course the block is protected - all Siemens standard library blocks are protected. That doesn't stop you using it. It doesn't even stop you understanding what it's doing. Have you noticed how the ADD or MULT or many other boxes in Siemens ladder are 'protected'?! So what? I don't care provided they do the job. Try highlighting it and hitting "F1" to bring up the online help, (you do know that F1 is the standard key in Windows applications for Help?) or maybe even reading manual. I even cut and pasted the description of the function from the manual in my previous post - there's not much else to it.

Regards

Grumpy old man.
 
Dear Grumpy Old Man,
I hope you are in good mood.
I got help for FC 92 as you had suggested.
But woe be gone, it is in Greek, I mean STL, which is Greek to me.
Anyhow, I understood the function, but when I changed my View to STL and tried to enter the function, I could not, because frankly I do not know how to enter the function in STL. I am LAD man. No sooner I type FC92( and press Enter, FC92 turned Red. (Does it mean it is angry at me?)
Will it be too much to ask you to make this function for me, with any arbitrary values, I will then understand and modify it as per my necessity. I have started to learn STL, but still am in Bit instructions.
Thanking you in anticipation,
Regards,
ali
 
Dear Simon,
I tried to shift bit with SHR_W, but then I have to use two inputs as shown in my attached file Shift01.doc.
Can you tell me where am I wrong?
thanks and regards
 
Ali

First copy the FC92 from the library folder to your own project folder. If you attempt to call an FCxxx in your project without having an FCxxx in it, you will get the FC number highlighted to show there is an error.

I honestly don't understand your reference to STL. Why not just call the block in LAD if that's what you prefer?

I've attached two pages I've extracted from the Siemens manual on library and standard functions. This quite clearly explains the function and evens shows a picture of it as a LAD representation.

Why did I have to get a copy of the manual? Why did I have to extract the pages? I'm not the one with the problem.

Keep at it - it will all come clear!

Not-quite-so-grumpy old man.
 

Similar Topics

Hi Guys, I am installing a vision system on a conveyor to inspect fill volumes and cap defects on an Eye drop bottling line. The idea is to...
Replies
12
Views
7,701
Hi guys, I am pretty new when it comes to programming. I am working with CX-Programmer and I am having a problem where I have a sensor on my...
Replies
6
Views
608
Hi all, i have a very slow indexing machine where we are looking to make everything as bulletproof as possible, money is not much of a factor...
Replies
12
Views
3,016
Good morning (EST), I am trying to implement the code below in on an S7-1200. It's barely half a dozen instructions, but I am stuck; I have not...
Replies
26
Views
5,503
Hi everyone I am completely new to using shift registers and am a bit stuck, my shift register works as should, it is for an overhead conveyor...
Replies
55
Views
15,308
Back
Top Bottom