Here is some mitsi code, a quick look at the manual I could not see if the for/next loop has a break function if the loop is variable, also could not see how you indirectly point to variables like mitsi but anyhow attached is some code I use.
Hi Parky, Thank you very much for your reply. Highly appreciate it.
I am not saying I was able to make a loop successfully but I was able to somewhat make a loop. But there is another issue now. Before coming to that, I will briefly explain the nature of my project.
This machine is being built to make cuts in garment panels in order to cut them in to 2. Inputs and outputs are as follow;
Inputs:
X0 - Emergency
X1 - Selector Switch
X2 - Home (Proximity) Sensor (to detect the home position of the linear guide)
X3 - Photo Electric Sensor 1 (which detects the presence of the garment)
X4 - Photo Electric Sensor 2 (which detects the presence of the garment)
X5 - Reed Switch (which is set on to the pneumatic cylinder)
Outputs:
Y0 - Motor Pulse
Y1 - Motor Direction
Y2 - Pneumatic Cylinders (which are activated through a solenoid valve)
Y3 - Scissor (which is activated through a relay)
When X0 is released and X1 is switched on, and X3 and X4 garments sensing sensors are triggered, the pneumatic cylinders are actuated and holds the garments against the machine bed. When the pneumatic cylinders are actuated and are fully down, X5 is activated. Thereafter, a 1.5 second delay, the scissor which is mounted on top of the linear guide and the stepper motor is actuated and starts sending the scissor forward up to predetermined pulses value. Once it reaches the end, the scissor stops, the motor comes to its initial position and the cylinders get retracted. This is the basic program I have written.
After that I have tried looping using memory bits and Xinje's built-in STL flow functions. Now it is looped somewhat. Now it takes the scissor forward and backward once; and when the next loop starts, the scissor moves forward successfully but does not come back. All the other functions are working as required but the scissor does not come back as the motor is not actuated in the second loop. I am currently stuck there. I believe this has something to do with resetting the motor direction and the pulses. I am not sure though.
Can you kindly help me on this. I have attached a pdf format and the Xinje PLC program of the same, herewith. Thank you in advance.