Create or move flow item to Photo Eye (custom code)

Create or move flow item to Photo Eye (custom code)

leandroom
Not applicable
119 Views
4 Replies
Message 1 of 5

Create or move flow item to Photo Eye (custom code)

leandroom
Not applicable

[ FlexSim 24.1.1 ]

Hello,

I need to create or move a flow item to a Photo eye. It supposed to be a easy task, but I tried those 3 commands and neither work:

createinstance(Model.find("Tools/FlowItemBin/Box/Box")), Model.find("PE1"));

createcopy(Model.find("Tools/FlowItemBin/Box/Box")), Model.find("PE1"));

moveobject(Model.find("Source1").first,Model.find("PE1"));

what am i missing? this is the error output by the way:

Error create:

Flexscript Error VIEW:/active/MainPanel/BackPanel/SplitterXPane/SplitterYPane/ToolTabPane/TabControl/ScriptConsole/Script>script Line 9 syntax error

Error move:

time: 10.724000 exception: FlexScript exception: Property "first" accessed on invalid node. at MAIN:/project/exec/consolescript c: <no path> i: <no path>

Could not finish parsing because of previous errors.

the syntax looks right to me, just the "first" property that i didn't know i couldn't use on source, so I did send to a queue and tried the same code from queue to photo eye and didn't work...


0 Likes
Accepted solutions (1)
120 Views
4 Replies
Replies (4)
Message 2 of 5

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

You will need an entry transfer by which you can move the item onto the conveyor. If you have one photoeye than you can put that transfer at the correct point along the side of the conveyor.

If you have many photoeyes on the same conveyor then you need to have an extended transfer along the length of the conveyor and set the xlocation of the item to match the phote eye's 'distAlong' property before you move it to the transfer.

0 Likes
Message 3 of 5

leandroom
Not applicable

Thanks for the entry transfer information, but it still didn't work:


1722007367097.png

0 Likes
Message 4 of 5

gustavo_teodoroD8NVF
Advocate
Advocate

@Leandro Meirelles I made a test here and worked. I have update a screenshot of the command that I used and the model that I tested.

1722013621825.png

FX_EntryTransferPhotoEye.fsm

0 Likes
Message 5 of 5

leandroom
Not applicable

I am sorry for not pay attention, my Queue name is "Queue2"... Its working, thanks!

0 Likes