String as output in DLL is not change

Antworten
PowerSoft
Beiträge: 22
Registriert: Samstag 8. Oktober 2011, 12:43
Wohnort: Hellevoetsluis-NL

String as output in DLL is not change

Beitrag von PowerSoft » Donnerstag 28. Juni 2018, 14:55

I try to figure out how the string output is working.
In this simple DLL at startup the output should be ""
and after trigger the output should change in a string.
In the code below I show how I have programmed it.
It is not working the output keeps the value "0".
What is wrong with my code?

Thanks for any help.

Code: Alles auswählen

//Call from PROFILAB, this is the actual function call DLL
DLLEXPORT void _stdcall CCalculateEx(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?
            {
            	//output longstr1 to putput 0
            	sprintf((char*)PChar(PStrings[0]),"%s",longstr1);    	
            }
		}
      PUser[CLK_OLD] = PInput[CLK]; // Value of CLC stored for next cyclus
}
GetFromNorad.zip
(37.65 KiB) 154-mal heruntergeladen
MacBook Pro Mac OSX El-Captain, Parallels 11, Windows-7 Professional ........

Mike D
Beiträge: 528
Registriert: Dienstag 14. Oktober 2008, 14:48
Wohnort: Elbe- Weser-Dreieck

Re: String as output in DLL is not change

Beitrag von Mike D » Donnerstag 28. Juni 2018, 16:03

PStrings ist nicht ganz einfach zu verstehen und funktioniert anders als PInput und POutput.

Lies dir mal bitte diesen Thread durch: viewtopic.php?f=42&t=943&p=1449&hilit=PStrings#p1449
und die Suche im Forum mit PString

Das Thema wurde schon öfters diskutiert.

Grüße
Mike

Antworten

Zurück zu „DLL-Programmierung“