Vishnu Dev
Member
OP
I am actually trying the parcels in amazon conveyors (model) using realvirtualio
Code:F_Trig_Buff_1_0(CLK := _IO2Sim.I_Buff_1_0_Sens_Occupied); Buff_1_0_Falling_Edge := F_Trig_Buff_1_0.Q; R_Trig_Buff_1_0(CLK := _IO2Sim.I_Buff_1_0_Sens_Occupied); Buff_1_0_Rising_Edge := R_Trig_Buff_1_0.Q; F_Trig_Buff_1_1(CLK := _IO2Sim.I_Buff_1_1_Sens_Occupied); Buff_1_1_Falling_Edge := F_Trig_Buff_1_1.Q; R_Trig_Buff_1_1(CLK := _IO2Sim.I_Buff_1_1_Sens_Occupied); Buff_1_1_Rising_Edge := R_Trig_Buff_1_1.Q; F_Trig_Buff_1_2(CLK := _IO2Sim.I_Buff_1_2_Sens_Occupied); Buff_1_2_Falling_Edge := F_Trig_Buff_1_2.Q; R_Trig_Buff_1_2(CLK := _IO2Sim.I_Buff_1_2_Sens_Occupied); Buff_1_2_Rising_Edge := R_Trig_Buff_1_2.Q; F_Trig_Buff_1_3(CLK := _IO2Sim.I_Buff_1_3_Sens_Occupied); Buff_1_3_Falling_Edge := F_Trig_Buff_1_3.Q; R_Trig_Buff_1_3(CLK := _IO2Sim.I_Buff_1_3_Sens_Occupied); Buff_1_3_Rising_Edge := R_Trig_Buff_1_3.Q; F_Trig_Buff_1_4(CLK := _IO2Sim.I_Buff_1_4_Sens_Occupied); Buff_1_4_Falling_Edge := F_Trig_Buff_1_4.Q; R_Trig_Buff_1_4(CLK := _IO2Sim.I_Buff_1_4_Sens_Occupied); Buff_1_4_Rising_Edge := R_Trig_Buff_1_4.Q; F_Trig_Conv_2_End(CLK := _IO2Sim.I_Conv_2_SensEnd_Occupied); Conv_2_End_Falling_Edge := F_Trig_Conv_2_End.Q; R_Trig_Conv_2_End(CLK := _IO2Sim.I_Conv_2_SensEnd_Occupied); Conv_2_End_Rising_Edge := R_Trig_Conv_2_End.Q; Buff_1_0_RTR := NOT _IO2Sim.I_Buff_1_0_Sens_Occupied; Buff_1_1_RTR := NOT _IO2Sim.I_Buff_1_1_Sens_Occupied; Buff_1_2_RTR := NOT _IO2Sim.I_Buff_1_2_Sens_Occupied; Buff_1_3_RTR := NOT _IO2Sim.I_Buff_1_3_Sens_Occupied; Buff_1_4_RTR := NOT _IO2Sim.I_Buff_1_4_Sens_Occupied; Buff_1_0_Motor_Running := Buff_1_0_RTR; Buff_1_1_Motor_Running := Buff_1_1_RTR; Buff_1_2_Motor_Running := Buff_1_2_RTR; Buff_1_3_Motor_Running := Buff_1_3_RTR; Buff_1_4_Motor_Running := Buff_1_4_RTR; FB_ItemDetection_Inst( I_Buff_1_0_Rising_Edge := Buff_1_0_Rising_Edge, I_Buff_1_1_Rising_Edge := Buff_1_1_Rising_Edge, I_Buff_1_2_Rising_Edge := Buff_1_2_Rising_Edge, I_Buff_1_3_Rising_Edge := Buff_1_3_Rising_Edge, I_Buff_1_4_Rising_Edge := Buff_1_4_Rising_Edge, I_Conv_2_End_Falling_Edge := Conv_2_End_Falling_Edge ); ItemCount := FB_ItemDetection_Inst.ItemCount; BufferFull := FB_ItemDetection_Inst.BufferFull; BufferEmpty := FB_ItemDetection_Inst.BufferEmpty; FB_ModeSelector_Inst ( I_ItemCount := ItemCount, I_BufferFull := I_BufferFull, I_SinkClear := I_SinkClear, BufferingToFullElapsed := BufferingToFullElapsed, O_Mode => SystemMode, O_Conv0Speed => Conv0Speed, O_BuffSpeed => BuffSpeed, O_Conv2Speed => Conv2Speed, O_StopConv0 => O_StopConv0 ); IF SystemMode = 'Buffering' THEN BufferFillTimer(IN := TRUE, PT := T#1S); IF BufferFillTimer.Q THEN IF ItemCount < BufferCapacity THEN ItemCount := ItemCount + 1; Conv0_Enable := TRUE; END_IF BufferFillTimer(IN := FALSE); END_IF IF ItemCount >= BufferCapacity THEN SystemMode := 'Buffer Full'; Conv0_Enable := FALSE; END_IF ELSE BufferFillTimer(IN := FALSE); Conv0_Enable := FALSE; END_IF Conv_0 ( I_Enable := Enable, I_SensOccupied := _IO2Sim.I_Conv_0_SensStart_Occupied, I_DownstreamRTR := Buff_1_0.O_ThisConveyorRTR, I_ConveyorIsRunning := _IO2Sim.I_Conv_0_MotorIsRunning, I_Speed := Conv0Speed, O_MotorRun => _IO2Sim.O_Conv_0_Run, O_ThisConveyorRTR => Conv_0_RTR ); Buff_1_0 ( I_Enable := Enable, I_SensOccupied := _IO2Sim.I_Buff_1_0_Sens_Occupied, I_DownstreamRTR := Buff_1_1.O_ThisConveyorRTR, I_ConveyorIsRunning := _IO2Sim.I_Buff_1_0_MotorIsRunning, I_Speed := BuffSpeed, O_MotorRun => _IO2Sim.O_Buff_1_0_Run, O_ThisConveyorRTR => Buff_1_0_RTR ); Buff_1_1 ( I_Enable := Enable, I_SensOccupied := _IO2Sim.I_Buff_1_1_Sens_Occupied, I_DownstreamRTR := Buff_1_2.O_ThisConveyorRTR, I_ConveyorIsRunning := _IO2Sim.I_Buff_1_1_MotorIsRunning, I_Speed := BuffSpeed, O_MotorRun => _IO2Sim.O_Buff_1_1_Run, O_ThisConveyorRTR => Buff_1_1_RTR); Buff_1_2 ( I_Enable := Enable, I_SensOccupied := _IO2Sim.I_Buff_1_2_Sens_Occupied, I_DownstreamRTR := Buff_1_3.O_ThisConveyorRTR, I_ConveyorIsRunning := _IO2Sim.I_Buff_1_2_MotorIsRunning, I_Speed := BuffSpeed, O_MotorRun => _IO2Sim.O_Buff_1_2_Run, O_ThisConveyorRTR => Buff_1_2_RTR); Buff_1_3 ( I_Enable := Enable, I_SensOccupied := _IO2Sim.I_Buff_1_3_Sens_Occupied, I_DownstreamRTR := Buff_1_4.O_ThisConveyorRTR, I_ConveyorIsRunning := _IO2Sim.I_Buff_1_3_MotorIsRunning, I_Speed := BuffSpeed, O_MotorRun => _IO2Sim.O_Buff_1_3_Run, O_ThisConveyorRTR => Buff_1_3_RTR); Buff_1_4 ( I_Enable := Enable, I_SensOccupied := _IO2Sim.I_Buff_1_4_Sens_Occupied, I_DownstreamRTR := Conv_2.O_ThisConveyorRTR, I_ConveyorIsRunning := _IO2Sim.I_Buff_1_4_MotorIsRunning, I_Speed := BuffSpeed, O_MotorRun => _IO2Sim.O_Buff_1_4_Run, O_ThisConveyorRTR => Buff_1_4_RTR); Conv_2 ( I_Enable := Enable, I_SensOccupied := _IO2Sim.I_Conv_2_SensStart_Occupied, I_DownstreamRTR := TRUE, I_ConveyorIsRunning := _IO2Sim.I_Conv_2_MotorIsRunning, I_Speed := Conv2Speed, O_MotorRun => _IO2Sim.O_Conv_2_Run, O_ThisConveyorRTR => Conv_2_RTR );
Is this right way because I tried using this code and run, the parcels are stopped at buff0,buff2,buff4 and not in buff1,buff3
what does that picture mean?Picture of the conveyor
Are those yellow lines physical separators or bars, that can hold an item back while the conveyor moves? or are they proximity sensors?The picture is from realvirtualio/demoautomationgame software for simulation
Yellow Line: separator between conveyor zones.
Red Line indicates a stopping or sorting point where actions like scanning or diverting occur.
Black: the surface of the conveyor belt itself.
Actually I tried all with different stop so I was confused that's why
VAR_GLOBAL
//IO variables to Conv_0
I_Conv_0_SensEnd_Occupied AT %I*: BOOL;
I_Conv_0_SensStart_Occupied AT %I*: BOOL;
I_Conv_0_MotorIsRunning AT %I*: BOOL;
O_Conv_0_Run AT %Q*: BOOL;
O_Conv_0_Acc AT %Q*: REAL := 3.0;
O_Conv_0_Speed AT %Q*: REAL := 0.0;
//Buffer segments
//IO variables to Buff_1_0
I_Buff_1_0_Sens_Occupied AT %I*: BOOL;
I_Buff_1_0_MotorIsRunning AT %I*: BOOL;
O_Buff_1_0_Run AT %Q*: BOOL;
O_Buff_1_0_Acc AT %Q*: REAL := 3.0;
O_Buff_1_0_Speed AT %Q*: REAL := 0.0;
//IO variables to Buff_1_1
I_Buff_1_1_Sens_Occupied AT %I*: BOOL;
I_Buff_1_1_MotorIsRunning AT %I*: BOOL;
O_Buff_1_1_Run AT %Q*: BOOL;
O_Buff_1_1_Acc AT %Q*: REAL := 3.0;
O_Buff_1_1_Speed AT %Q*: REAL := 0.0;
//IO variables to Buff_1_2
I_Buff_1_2_Sens_Occupied AT %I*: BOOL;
I_Buff_1_2_MotorIsRunning AT %I*: BOOL;
O_Buff_1_2_Run AT %Q*: BOOL;
O_Buff_1_2_Acc AT %Q*: REAL := 3.0;
O_Buff_1_2_Speed AT %Q*: REAL := 0.0;
//IO variables to Buff_1_3
I_Buff_1_3_Sens_Occupied AT %I*: BOOL;
I_Buff_1_3_MotorIsRunning AT %I*: BOOL;
O_Buff_1_3_Run AT %Q*: BOOL;
O_Buff_1_3_Acc AT %Q*: REAL := 3.0;
O_Buff_1_3_Speed AT %Q*: REAL := 0.0;
//IO variables to Buff_1_4
I_Buff_1_4_Sens_Occupied AT %I*: BOOL;
I_Buff_1_4_MotorIsRunning AT %I*: BOOL;
O_Buff_1_4_Run AT %Q*: BOOL;
O_Buff_1_4_Acc AT %Q*: REAL := 3.0;
O_Buff_1_4_Speed AT %Q*: REAL := 0.0;
//End of buffer segment
//IO variables to Conv_2
I_Conv_2_SensEnd_Occupied AT %I*: BOOL;
I_Conv_2_SensStart_Occupied AT %I*: BOOL;
I_Conv_2_MotorIsRunning AT %I*: BOOL;
O_Conv_2_Run AT %Q*: BOOL;
O_Conv_2_Acc AT %Q*: REAL := 3.0;
O_Conv_2_Speed AT %Q*: REAL := 0.0;
END_VAR
Sure i will tryIf I understand correctly packages move through a total of 7 conveyors and ends at a sink.
In the order of transportation:
This is not complicated. IMHO the problem should be solved in it's entirety on paper - before writing a single line of code.
- Conveyor 0
- Buffer 0
- Buffer 1
- Buffer 2
- Buffer 3
- Buffer 4
- Conveyor 2
- Sink (end station)
The program is the implementation of a solution. It's not the solution.
Also don't write the entire program and then try to debug it to find the problem.
Do it like that so you can have many small problems that are easy to fix - instead of one big mess that will take forever to untangle.
- Write one piece / section
- Test that section so you know it works the way you want
- Test it together with the rest of the program
- Move to the next one.