Code Binding Error

Code Binding Error

HemanthSaiKumar_311099
Not applicable
2,164 Views
4 Replies
Message 1 of 5

Code Binding Error

HemanthSaiKumar_311099
Not applicable

[ FlexSim 24.1.0 ]

Hi Folks,

I am trying to link external python 3.11 with FlexSim 2024 here I am trying a small example case where I need to assign a cycle time of a processor externally ,when I am trying it I am getting an error as below,

Error:
exception: Code Binding Error: could not bind to function

Node: /Processor1>variables/cycletime

Binding string: item.id = add_num(5, 10)

/**external python: */ /**/"my_1st_code_1"/**/

/** \nfunction name:*/ /**/"add_num(5, 10)"/**/


Windows Error Code : 126


Below I am attaching the ss and kindly can anyone guide me in fixing the error. Thanks in advance !

use-case.png


cycle-time-code.png
error-message.png

0 Likes
2,165 Views
4 Replies
Replies (4)
Message 2 of 5

Jeanette_Fullmer
Community Manager
Community Manager

Hi @Hemanth Sai Kumar,

Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.

0 Likes
Message 3 of 5

FelixMoehlmann
Mentor
Mentor

From what I've seen so far, error code 126 means that your python installation needs to be added to the PATH. See linked post below.

https://answers.flexsim.com/questions/140337/python-function-error-windows-error-code-126.html

0 Likes
Message 4 of 5

Arun4
Not applicable

Hi Hemanth,

Firstly, the anaconda is not working in Flexsim to my knowledge. so make sure you install Python from here. Further on u need to check on pyhton version in flexsim code
1717313042170.png
Lastly and more importantly, you must add the path to environmental variables as mentioned here.
This should solve the Python integration issue.

0 Likes
Message 5 of 5

logan_gold
Community Manager
Community Manager

Hi @Hemanth Sai Kumar, was one of Arun's or Felix Möhlmann's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes