question

anon-user avatar image
0 Likes"
anon-user asked Arun Kr commented

How to set the location of PhotoEye/Decision point on Curved Conveyor using code

Hi Team,.

I have added a label on the conveyor which indicates at what % of length of the conveyor the photo eye should move.

How do I set the location of photo eye on the curved conveyor.

Attached is the model.

Thank you

FlexSim 23.1.3
conveyorphoto eyecurved conveyor object
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Arun Kr commented

Starting from a reference to the Photo Eye, the following code will set its location depending on the label value.

Object PE = Model.find("PE2");
Object conveyor = ownerobject(PE.find(">variables/conveyorPoint/1+")); double length = Math.fabs(conveyor.getProperty("SweepAngle")*conveyor.getProperty("Radius")*Math.pi/180); function_s(PE, "setDistAlongConveyor", length*conveyor.Sensor1/100);
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Arun Kr avatar image Arun Kr commented ·
If curved length was a property it would have been helpful.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.