String as output in DLL
String as output in DLL
Hello,
I'm working on a ISS tracker. To do the heavy calculations I use a DLL. My program environment is the Dev-C++compiler.
My DLL is working perfect, have used the well know SGP4 routines witch can be found on the Web.
Now I need to output some information as a string. Have looked to all the examples and discussions here on the forum.
Without a result.
Please can someone help me out with this?
With kindly regards
Jan
Hellevoetsluis-NL
I'm working on a ISS tracker. To do the heavy calculations I use a DLL. My program environment is the Dev-C++compiler.
My DLL is working perfect, have used the well know SGP4 routines witch can be found on the Web.
Now I need to output some information as a string. Have looked to all the examples and discussions here on the forum.
Without a result.
Please can someone help me out with this?
With kindly regards
Jan
Hellevoetsluis-NL
MacBook Pro Mac OSX El-Captain, Parallels 11, Windows-7 Professional ........
Re: String as output in DLL
Hello,
try the appended StringDLL, that i wrote just for testing.
The source is with german comments.
May be, the DLL is uesfull for you.
Regards
try the appended StringDLL, that i wrote just for testing.
The source is with german comments.
May be, the DLL is uesfull for you.
Regards
- Dateianhänge
-
- StringDLL.zip
- (7.44 KiB) 217-mal heruntergeladen
Ich bin der Müllmann und räume nur auf.
Re: String as output in DLL
Hej,
one important point is, that the names of the string-ports have to begin with a dolar sign.
Mike
one important point is, that the names of the string-ports have to begin with a dolar sign.
Mike
Re: String as output in DLL
Vielen Dank,
das ist, was ich gesucht habe
Jan
das ist, was ich gesucht habe
Jan
MacBook Pro Mac OSX El-Captain, Parallels 11, Windows-7 Professional ........
Re: String as output in DLL
In you're code you mentiod "Stringein-/ausgabe nach Beispiel aus Profilab"
Wich example is this?
Thanks and regards,
Jan
Wich example is this?
Thanks and regards,
Jan
MacBook Pro Mac OSX El-Captain, Parallels 11, Windows-7 Professional ........
Re: String as output in DLL
In my directory of Profilab is following path to a StringDLL
/Profilab/Beispiele/Neue_Funktionen/Strings/DLL
May be, you can find it in /Profilab/Examples/New_Functions/Strings/DLL
I have zipped the directory of the C++ example, see appendix
/Profilab/Beispiele/Neue_Funktionen/Strings/DLL
May be, you can find it in /Profilab/Examples/New_Functions/Strings/DLL
I have zipped the directory of the C++ example, see appendix
- Dateianhänge
-
- HexToWord_DLL C++Builder source.zip
- (55.88 KiB) 205-mal heruntergeladen
Ich bin der Müllmann und räume nur auf.
String as output in DLL is crashing Profilab
Hello,
I have a working DLL thats calculate the position of Satellites.
This is my call to execute :
//Call from PROFILAB, this is the actual function call DLL
1. DLLEXPORT void _stdcall CCalculate(double *PInput, double *POutput, double *PUser, StringParam PStrings)
2. DLLEXPORT void _stdcall CCalculate(double *PInput, double *POutput, double *PUser)
When I use line 1. Profilab is crashing.
When I use line 2. in my code the program is running perfect.
Have tested under windows 7-32bit and windows 10-64bit.
Include my complete project.
What is going wrong?
I know it is a complicated program, but thanks for any help.
Jan
I have a working DLL thats calculate the position of Satellites.
This is my call to execute :
//Call from PROFILAB, this is the actual function call DLL
1. DLLEXPORT void _stdcall CCalculate(double *PInput, double *POutput, double *PUser, StringParam PStrings)
2. DLLEXPORT void _stdcall CCalculate(double *PInput, double *POutput, double *PUser)
When I use line 1. Profilab is crashing.
When I use line 2. in my code the program is running perfect.
Have tested under windows 7-32bit and windows 10-64bit.
Include my complete project.
What is going wrong?
I know it is a complicated program, but thanks for any help.
Jan
MacBook Pro Mac OSX El-Captain, Parallels 11, Windows-7 Professional ........
Re: String as output in DLL is crashing Profilab
First of all please make sure to have latest ProfiLab update installed, if you haven´t yet.
ABACOM support
Re: String as output in DLL is crashing Profilab
I have used the version from : 07-05-2018
MacBook Pro Mac OSX El-Captain, Parallels 11, Windows-7 Professional ........
Re: String as output in DLL
Hello,
I have constructed a simple DLL thats should output a string named longstr1.
I don't get it to work I think it is a matter of conversion.
What to do to get it running?
Thanks allot for any help.
I have constructed a simple DLL thats should output a string named longstr1.
I don't get it to work I think it is a matter of conversion.
What to do to get it running?
Thanks allot for any help.
Code: Alles auswählen
#include "GetFromNorad.h"
char longstr1[]="1 25544U 98067A 18161.85073725 .00003008 00000-0 52601-4 0 9993";
char longstr2[]="2 25544 51.6418 50.3007 0003338 171.6979 280.7366 15.54163173117534";
//Number of inputs
unsigned char inputs = 1;
//Number of outputs
unsigned char outputs = 1;
//index for input variables
const unsigned char CLK = 0;
//index for user variables
const unsigned char CLK_OLD = 0;
typedef unsigned char *PChar;
typedef PChar *StringParam[100];
char OutString[1000];
//Call from PROFILAB, get number of inputs
DLLEXPORT unsigned char _stdcall NumInputs()
{
return inputs;
}
//Call from ProfiLab, get number of outputs
DLLEXPORT unsigned char _stdcall NumOutputs()
{
return outputs;
}
DLLEXPORT void _stdcall GetInputName(unsigned char Channel, char *Name)
{
if (Channel == 0) strcpy(Name,"CLK");
}
DLLEXPORT void _stdcall GetOutputName(unsigned char Channel, char *Name)
{
if (Channel == 0) strcpy(Name,"$Satelite");
}
//Aufruf von PROFILAB, setzt bei Programmstart den "Counter"auf "0"+ setzt alle Ausgaenge zurueck
DLLEXPORT void _stdcall CSimStart(double *PInput, double *POutput, double *PUser)
{
}
//Call from PROFILAB, this is the actual function call DLL
DLLEXPORT void _stdcall CCalculate(double *PInput, double *POutput, double *PUser, StringParam PStrings)
{
if (PInput[CLK] < 2.5) //Input CLK low?
{
if (PUser[CLK_OLD] > 2.5) //falling edge CLK?
{
strcpy(PChar(PStrings[0]),longstr1);
}
}
PUser[CLK_OLD] = PInput[CLK]; // Value of CLC stored for next cyclus
}
MacBook Pro Mac OSX El-Captain, Parallels 11, Windows-7 Professional ........
Re: String as output in DLL
Note that method name must be...
C++: void _stdcall CCalculateEx(double *PInput, double *POutput, double *PUser; StringParam PStrings)
for string processing.
You seem to have missed the "Ex"?
C++: void _stdcall CCalculateEx(double *PInput, double *POutput, double *PUser; StringParam PStrings)
for string processing.
You seem to have missed the "Ex"?
ABACOM support
Re: String as output in DLL
Thanks this was helpful, it is now running
MacBook Pro Mac OSX El-Captain, Parallels 11, Windows-7 Professional ........