Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Recently I tried with the DLL function in FlexSim.
I wrote a simple dll like adding two numbers of type double, but when I ran, it didn't return the total but only the first input number.
I want to know why this happen and how to avoid it when I build the dll.
Below is my code in dll
// C LIBRARY FOR INPUT/OUTPUT STREAMS
#include <stdio.h>
#include <math.h>
// IN ORDER TO HAVE ACCESS TO FLEXSIM FUNCTIONS, INCLUDE FLEXSIMDEFS.H
#include "FlexsimDefs.h"
visible double dllcommand1(FLEXSIMINTERFACE)
{
// test passing parameters in usercommand
string par1=parstr(1);
pt("string parameter ");pt(par1);pr();
return 0;
}
visible double mydllfunction2(FLEXSIMINTERFACE)
{
pt("This will print to the Output Console");pr();
return 0;
}
visible double addfunction(double p1, double p2)
{
double a;
a = p1 + p2;
print(a); pr();
return a;
}
PS: the function mydllfunction2 is working fine, but the "addfunction" have the problem. I also attach my model too
Solved! Go to Solution.