question

João Victor SDA avatar image
0 Likes"
João Victor SDA asked João Victor SDA commented

FlexSimPy error in FlexSim 22.2.3: "lc_flexinit failed: 1".

Hi,


It is a question correlated to the previous question: https://answers.flexsim.com/questions/127403/flexsimpy-error-lc-flexinit-failed-1.html

Following the procedure to create a new module node into the FlexSim tree (https://docs.flexsim.com/en/22.0/Reference/DeveloperAdvancedUser/ModuleSDK/QuickStart/QuickStart.html ), the 'lc_flexinit: 1' error doesn't occur anymore in FlexSim 22.1.


However, this error persists when I use FlexSim 22.2.3 update, even doing the same procedure.


This error occurs when I pass the argument 'evaluateLicense = False' to controller Launch.

Obs: It's essential for me to the 'evaluateLicense = False' because if 'true' FlexSim doesn't do replications.


Thanks.

FlexSim 22.2.3
flexsimpy
· 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.

Kavika F avatar image Kavika F ♦ commented ·
Hey @João Victor SDA, I just tried repeating all the steps in the Module Quick Start guide and setting up the Python Module SDK for both 22.1.4 and 22.2.4 and both seem to work fine when I set evaluationLicense=False. Here are some questions that may help me see where things are going wrong.
  • Did you clone the correct branch from the the GitHub repo? (i.e., are you using the 22.1 branch for your 22.1 module and 22.2 for your 22.2 module?)
  • Is the path to your program directory for your ModuleDev version of FlexSim correct? (Try pasting the created string into your File Explorer address bar to see if it takes you to the right place)
  • Where is this error thrown? After which line? (Is it thrown when you try to run fp.launch, or when you try to use the controller to open a file?)
0 Likes 0 ·
João Victor SDA avatar image João Victor SDA Kavika F ♦ commented ·

Hi Mr. Kavika,


Thanks for the reply! However, it is still getting errors. The following are the answers to your question:

  • Did you clone the correct branch from the the GitHub repo? (i.e., are you using the 22.1 branch for your 22.1 module and 22.2 for your 22.2 module?)

R) Actually, I was using the wrong branch (I was using just the master). However, I recompiled the solution with branch 22.2, and the error persisted.

  • Is the path to your program directory for your ModuleDev version of FlexSim correct? (Try pasting the created string into your File Explorer address bar to see if it takes you to the right place)

R) Yes.

  • Where is this error thrown? After which line? (Is it thrown when you try to run fp.launch, or when you try to use the controller to open a file?)

R) The error occurs after fp.launch.


OBS: My license is the Educational Standalone. Does it have any influence?


If you prefer, I can share my project folder.

0 Likes 0 ·
Andrew O avatar image Andrew O commented ·

Hi @João Victor SDA, was one of Kavika F's or Phil BoBo'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 unaccept and comment back to reopen your question.

0 Likes 0 ·
Kavika F avatar image
1 Like"
Kavika F answered João Victor SDA commented

Hey @João Victor SDA, I was able to replicate your error. After debugging, I was able to find a workaround for your problem. In your module development directory, go into the "program" directory, and find the "flexsim_libFNP.dll".

1671036085314.png

Copy that file and paste it into the directory where your python.exe is located. It could either be in your C:/ drive or your appdata directory (like %APPDATA%\Local\Programs\Python).

1671036413679.png

Then try running your script. Let me know if this fixes your problem.


1671036085314.png (35.5 KiB)
1671036413679.png (3.7 KiB)
· 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.

João Victor SDA avatar image João Victor SDA commented ·

Dear Mr. Kavika,

This solution worked well!

Thanks to you, Phil and the entire FlexSim support team for helping me out.

I wish you a merry Christmas and a prosperous new year!!!


Problem solved!

0 Likes 0 ·
Phil BoBo avatar image
0 Likes"
Phil BoBo answered João Victor SDA commented

In order to run FlexSim with the argument 'evaluateLicense = False', the following conditions must be true:

  • The Flexnet Licensing Service must be installed. This is done by either installing FlexSim via its installer or by running the FlexSim executable as an administrator once.
  • You cannot be attached to the process. If a debugger is attached during FlexSim's license check, then the application will crash. You cannot run FlexSim in debug mode if you are trying to run it using a license. You can attach to the process after the license check, but you cannot have a debugger attached during the license check. The "evaluateLicense" parameter causes the program to run without checking for or receiving a license so that you can debug startup connectivity issues. Once your code is connecting and running appropriately and you want to then run it with a license, then you can no longer debug the startup process. The licensing code cannot be run with a debugger attached.
· 2
5 |100000

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

João Victor SDA avatar image João Victor SDA commented ·

Hi Phil,


Thank you for the quick reply!


Both conditions are done but the error still happen.


Thanks

0 Likes 0 ·
João Victor SDA avatar image João Victor SDA commented ·
Hello Phill,


The solution didn't work. Do you have any alternative idea?


Thanks.

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.