question

Aravind D avatar image
0 Likes"
Aravind D asked Jason Lightfoot commented

How to use MongoDB in flexsim as database

HI,

1. I would like to get the input data from MongoDB to store it in the global table and store the output results to the global table and also directly in MongoDB. Please let me know how to connect to MongoDB from FlexSim.

. Thanks in advance for your help

FlexSim 19.2.0
database connectorsql servermongodb
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

·
Steven Hamoen avatar image
4 Likes"
Steven Hamoen answered Jason Lightfoot commented

@Aravind D Considering the fact that MongoDB is not supported in de DBConnector, there are 2 ways you can go.

1. Use the standard ODBC path. I think that MongoDB has an ODBC driver (at least a very quick google search tells me that)

2. Considering MongoDB is written in C++ it should not be to hard to use a native driver and create your own FlexSim dll that calls the database directly.

· 4
5 |100000

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

Aravind D avatar image Aravind D commented ·

Hi @steven.hamoen

sorry for the late reply,

1.I installed the ODBC driver using the standard ODBC path, but in Flexsim if I select ODBC and after giving the login and username and password the DBConnector is not connecting.It says that it is not the default driver and data source is not available

2.And for the Flexsim dll part. I don't know how to create Flexsim dll that calls the database directly.Can you please help me in creating a Flexsim dll that uses MongoDB to connect in Flexsim has DBConnector

Thank you for your help in advance.

0 Likes 0 ·
Steven Hamoen avatar image Steven Hamoen Aravind D commented ·

@Aravind D

With 1 I can't help you. Please search the internet or this forum for situation that are similar to yours. You can also take a look at all the commands in FlexSim that start with "db" and see if those can communicate with your ODBC connection.

For point 2 also please search this forum. If you type FlexSim DLL or DLL SDK so will find a lot of posts and one of the first is where you can download the module SDK. The module SDK itself has quite a lot if information on how to create a DLL.

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ Aravind D commented ·

1. See Jordan's answer to Connecting Access database for an example of how to modify the connection string directly in the tree to access an ODBC connection.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Phil BoBo ♦♦ commented ·
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.