question

David Chan avatar image
0 Likes"
David Chan asked Matt Long edited

Can FlexSim has its input in XML and output in XML?

Hi,

I have a question regarding Flexsim functionality. I would like to create a supply chain simulation model using software, but I want my simulation model to receive an XML file as the input and generate XML file as the output also.

Can Flexsim do that?

Rgds,

David (Asking on behalf of Iskandar Halim)

FlexSim 16.1.0
xmlmodel inputoutput simulation
5 |100000

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

Ben Wilson avatar image
1 Like"
Ben Wilson answered Matt Long edited

As @Sam Stubbs noted, FlexSim does not have a built-in XML parser. However, FlexSim does allow you to compile C++ code (with Visual C++ installed) or link to external DLLs. In both cases you could find an existing XML parser that you could incorporate into your project.

Here is a quick Google search to get you started. This is for C++ XML parsers. If you link to a DLL, you are not limited to C++.

If you go down this road and get stuck or have questions, start a new question here at Answers!

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

Matt Long avatar image Matt Long commented ·

The DLL Maker Visual Studio project/files can be downloaded from BitBucket:

https://bitbucket.org/flexsim/flexsim-dll-maker

0 Likes 0 ·
Sam Stubbs avatar image
0 Likes"
Sam Stubbs answered

So the quick answer is that FlexSim does not have any built in XML parser. However using certain FlexScript commands it is possible to read in from an XML file and extract data, and also to use commands to write to a file (which you could write XML as the output).

When importing or extracting data, you would open a file using the fileopen("FileName") command, and then you can use the filereadline() commands to parse through the file line by line. (Likely you'd want to write a "for" or "while" loop to do this.) And you can write to files using the fpt() command. Then close the file using the fileclose() command.

For more information regarding reading from and writing to files via FlexScript, look in the command help documentation, (In the top menu under Help > Commands) and look under the Output section in the command help library.

5 |100000

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