question

Leandro Meirelles avatar image
0 Likes"
Leandro Meirelles asked Leandro Meirelles commented

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

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...


FlexSim 24.1.1
createinstance
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

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Leandro Meirelles commented

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.

· 3
5 |100000

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

Leandro Meirelles avatar image Leandro Meirelles commented ·

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


1722007367097.png

0 Likes 0 ·
1722007367097.png (409.4 KiB)
Gustavo Teodoro avatar image Gustavo Teodoro Leandro Meirelles commented ·

@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 0 ·
Leandro Meirelles avatar image Leandro Meirelles Gustavo Teodoro commented ·

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

0 Likes 0 ·