We need to change the acceleration parameters of a section of conveyor based on parameters such as "number of items on", or "items blocking a Photo Eye". I can use the Conveyor.targetSpeed function to change the speed, and that has an immediate effect, but the Conveyor.acceleration function is Read-only, so I can't change it that way. If I try to use the tree address to change it I get an error message too.
The data we have is only expressed in terms of acceleration, so we would really like to use that instead.
I tried setting up two Conveyor Types: "ConTypeFast" and "ConTypeSlow" and then using this code to change the Conveyors Type:
Variant newtype = Model.find("ConveyorSystem>variables/conveyorTypes/ConTypeSlow"); Model.find("Conveyor1>variables/type").value = newtype; // Change conveyorType to Slow Variant checktype1 = Model.find("Conveyor1>variables/type").value; //check parameter has changed
The logic is successful, in that the parameter is changed correctly and the conveyor visual immediately changes to the new type, but the speed and acceleration does not change. Even if you manually stop the run, change the conveyor type, and restart the run, the display changes but the speeds do not, until you do a Reset.
There is a similar question from 2017 about this, where the logic above is recommended, but no mention is made of it not being activated immediately. I also cannot find any mention of it in the manual.
In AGV logic you have a similar "agvType" parameter. When you change it, the AGV changes speed/accel almost immediately, (sometimes waiting until it reaches the destination CP), so why is the conveyor behavior different?
Any suggestions?
I am attaching a sample model..change-conveyor-type.fsm