Simple shift register in Unity Pro (M340)

aqueousdan

Member
Join Date
Jan 2016
Location
uk
Posts
32
I am having trouble with creating a shift register in Unity Pro on my Schneider M340. I am using the FFB SHR to try and get this to work.

I have my enable leg connected to a normally open contact which is pointing to %S6 to pulse every second. My 'N' leg is set to '1' to move and input bit one place to the right.

I am struggling with the shifting part. If I put something like 2#0001000100010001 on the IN leg, i get 16#0888 on the OUT leg. When the enable leg pulses, nothing shifts. i.e. it only shifts once.

How do I carry on the shifting?
 
It seems the problem is that the input pattern must also be updated. It as if the fb knows that if the input word or int stays the same that it already shifted that value. You should use a move fb to move the output value back in as the input value
 
Maybe i am misunderstanding you but when I try this, it moves the output from the SHL to the input of the SHL and then when the %S6 turns off again it resets.

Is this usually the way to do a shift register? I have never had as much trouble as this with other software!

sss.png
 
That didnt work either. It just goes backwards and forwards. Could there be a setting somewhere i'm missing? Does anyone have Unity pro that they could use to set this up just to check im not doing anything completely wrong?

d.jpg e.jpg f.jpg
 
SHL block apparently needs more PLC scans than one to work.

On unity ladder bits work little differently than on FBD program.

There was some setting on project properties for that. At least --|P|-- and --|N|-- not working like you think with default setting on ladder code. (They are not working like one shots..)

On ladder there is this setting :Single scan edge detection for EBOOL
 
Tested with newest unity, no problems so far. Attachments is saved to Unity 8.0 format.

By the way, on first post you say SHR block and your attachments have SHL block?
 
Thankyou Lare. I won't get chance to look at this for a few days but thankyou so much for taking the time to check this out for me. I think I got confused with SHL and SHR because I was trying all sorts to get them working
 
Hi there Lare, I cannot get this to work as I have Unity Pro 7. Can you possibly save it for this version if possible?
 
Thankyou so much for your help guys, this works perfectly. I still cant see why mine wasnt working as expected but this is exactly what I was after. Thanks again!
 

Similar Topics

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,635
Eric Nelson gave an example of how to make your own 4 position shift register using a few markers, but no matter what I type in SEARCH, I come up...
Replies
3
Views
1,750
Hi all, Writng a FB in ST on Beckhoff TC for a pulser which turns on and off on a cycle, is paused by turning bControlInput to FALSE, but resumes...
Replies
6
Views
240
I'm trying to build my Classic Step 7 programming skills this weekend. I get stuck on little things that are not covered in YouTube tutorials. I'm...
Replies
7
Views
303
I have a program that does a 7 second "scan" sensor calibration routine whenever a setting (setting is called assistance level or "AL" and ranges...
Replies
3
Views
201
Back
Top Bottom