JiM_cz Posted November 5, 2018 Report Posted November 5, 2018 (edited) Could someone please help me to understand how this particular SFT works please? (See the pic please). The first 3 parallel contacts ensure that 16.08 will be OFF (for 1 program scan) if there is a NG product that needs to be rejected. I'm confused with the part that follows. If 16.08 is OFF the H2.00 will be set to "1". H2.00 is also the rightmost bit of the shift register. However, at the same time the data input of the SFT is always off. My understanding was that when 16.01 is ON the SFT checks what is on its data input and puts it into its rightmost bit. In this case it should be always zero. But I must be wrong because I saw this code working and there were "1" as well (when the "not good" product needed to be rejected). Edited November 5, 2018 by JiM_cz
gtsuport Posted November 5, 2018 Report Posted November 5, 2018 This is a bit different, but I can see where it would work. Instead of using the top input for the data for the shift register, if H2.00 is on when 16.01 initiates the shift, a 1 would be moved into the shift register. Not understanding the entire system, not really sure why it was done this way. Hope this will help.
JiM_cz Posted November 5, 2018 Author Report Posted November 5, 2018 (edited) Yeah, you're probably right. That's how it works. But why? The help file describes the SFT function like this: "When the execution condition on the shift input changes from OFF to ON, all the data from St to E is shifted to the left by one bit (from the rightmost bit to the leftmost bit), and the ON/OFF status of the data input is placed in the rightmost bit." According to this, it should place the the status of the Always OFF (0) of the data input line to the the rightmost bit and never "1" Edited November 5, 2018 by JiM_cz
gtsuport Posted November 6, 2018 Report Posted November 6, 2018 (edited) Best way to see what is happening would be to use the Watch window and monitor H2 in binary. This should help you see what is going on. H2.00 is set in the rung above the SFT. When the shift input is turned on, H2.00 value is moved to H2.01 and a zero condition would be moved into H2.00 in the shift register. However, if H2.00 is still SET on, you may not see the zero value at that position. Much depends on the rest of the program. Edited November 6, 2018 by gtsuport
IO_Rack Posted November 14, 2018 Report Posted November 14, 2018 (edited) This is not very intuitive but it does work. As gtsuport says, use the watch window. In addition, copy this section into a new program and run the simulator. The picture below shows the program in Step mode. It is paused just before executing the Shift. The key point to understand is that the Always OFF does NOT turn H2.00 OFF. It only supplies the data to be shifted in at the Rising Edge of 16.01 which will always be zero. On 11/6/2018 at 7:15 AM, gtsuport said: When the shift input is turned on, H2.00 value is moved to H2.01 and a zero condition would be moved into H2.00 in the shift register. Because 16.01 Sets the data and shifts it, you will not see H2.00 turn ON in real time. Edited November 14, 2018 by IO_Rack
JiM_cz Posted November 18, 2018 Author Report Posted November 18, 2018 Thanks. I think I got it. I tried to run that particular part in a simulator as you advise me to but my CX-programmer freezes every time. There is the hourglass icon hanging forever. Do I need to be connected to a physical PLC for the simulator to work?
IO_Rack Posted November 19, 2018 Report Posted November 19, 2018 You do not need a physical PLC for simulation. I've heard of some simulator issues in the past. Make sure you have the latest CX One updates. There are a few methods for running the simulator. With the program open in CX Programmer, choose Simulation from the menu then Work Online Simulator. This is the simplest method to test PLC code only.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now