Call C++ DLL function from Cicode. Error code -1.

tmithun

Member
Join Date
Nov 2021
Location
Bangalore, India
Posts
5
Hi all :) ,

I'm very new to CitectSCADA and Cicode programming, however have good programming experience in most major programming languages (Java, py, js, etc); so please excuse my ignorance.

What I'm trying to do is invoke a function in a C++ DLL to perform string reversal (which I will change for a complex function later). PFA the DLL src as MathLibrary.txt and header file as MathLibraryHeader.txt.
I was able to build the DLL and copied both the DLL and header to the project location (where the ci script file is located).

PFA the code used to call the DLL as trailCicode.txt.
I am getting error code -1 on the function DLLOpen. (sResult is -1)

1. Any idea of what I'm doing wrong?
2. Have I placed the DLLs in the correct directory?

It would mean the world to me if someone could help me with this! Thank you so much in advance!! :geek:
 

Similar Topics

Hello everyone. I am working on designing a call light/alarm system I have roughly 20 stations that will each have their own call switch. Then...
Replies
20
Views
456
I've gotten to the learning curve where I can program a call for pump to come on at set point but I'm not sure how to turn the same pump off when...
Replies
1
Views
137
Hi Siemens Experts, I am hoping someone can shed some light on my issue. I have uploaded the code from a S7-300 (317-2PN/DP) using Step 7...
Replies
9
Views
680
I created this FC and it compiles, but when I use it in my MAIN OB1, it appears to have two outputs. See pictures. What am I doing wrong here...
Replies
9
Views
1,480
Is there a way in CX-Programmer to call Ladder Instructions from a structured text program? I can see several functions in the autocomplete...
Replies
3
Views
1,974
Back
Top Bottom