LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The problem about calling a .dll function

Dear All,
I use call library function node to call .dll function, but it cannot be run. the .dll function statemet was shown as below and attach the program. Would you please tell me what happen to my program? i think it may be that the filename format is incorrect.
 

flReadProgramFiles


int flReadProgramFiles(
    char * filename
);

Parameters

filename
string containing the directory and filename root. This function will generate the XPV and XDV extensions.

Return Values

non-zero on failure, 0 on success.

Remarks

This function is used to load the firmware files into memory.
 
 
Regards,
JImmy
0 Kudos
Message 1 of 10
(4,628 Views)
Not having much luck with DLLs, there are you? This is like your third post on using DLLs.

The obvious question is: well, what are you specifying for "filename"?
Message 2 of 10
(4,618 Views)


@Jimmy168 wrote:
I use call library function node to call .dll function, but it cannot be run.
What do you mean by "it cannot be run"? Is the run arrow broken? What are the error messages if you click the broken arrow?
 
If the run arrow is intact, it can be run. What errors do you get (error message, GPF, bluescreen, computer crash, program hang, ...).
 
 
Message 3 of 10
(4,610 Views)
To Smercurio_fc,
The finename is a parameter that calling the .dll function. Now i want to pass a value to it by labview, but not successflul.
 
To Altenbach,
when run the program, it have a error, but no any error message beacause it only return a number.
0 Kudos
Message 4 of 10
(4,592 Views)
Jimmy,
 
With all due respect, we're not psychics, so if you want us to help you will need to provide a little more information. I wanted to know what the value of the string that you were passing to the DLL was. I know that "filename" is a parameter - I wanted to know the value that you're passing.
 
Also, altenbach asked what errors you get and you responded that when you run the program you get an error but that it just returns a number. Well, what is that error code number?
 
We can't run the VI you posted since you did not include the DLL - that's not saved with the VI. We're more than happy to try to help, but we need to rely on you providing more detailed information so we can try to help.
 
-Saverio
Message 5 of 10
(4,582 Views)
Hello semercuio,
Thank for your help. The problem was solved.
 
Regards,
jimmy
0 Kudos
Message 6 of 10
(4,577 Views)


@Jimmy168 wrote:
Hello semercuio,
Thank for your help. The problem was solved.
 
Regards,
jimmy


It's these type of people that make you wonder if you really should spend any time at all to help out answer questions. First they (double) post a vague request with no useful information, when asked to provide more information they answer with more vague information and suddenly they post (if at all) that everyting is fine, without any explanation of what they did to make it finally work, so that it may help others with similar problems (if they make the effort to search before posting a request).

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 7 of 10
(4,557 Views)
I agree, which is why I decided to ignore these threads (that is, until I saw your name in the list).

___________________
Try to take over the world!
0 Kudos
Message 8 of 10
(4,551 Views)
Dear All,
You are right. I am sorry for this. As I am a newer, I haven't any experience for this.I think that it will not happen next time.
Now i explain all the course for my problem to you.
 
My program is that calling a .dll function to read a firmware to memory. the parameter "filename" is the firmware path. I check the relative information and find that it is a string pointer type in .dll. And then in the Labview, when i use "call library function node" to call the .dll, i set  
its type to string, string formate to C string pointer.As you know, This is right. So the problem is not cause by passing the value.
 
What happen to my program? now i can tell you that the firmware file is wrong. When you use the .dll function to call the firmware file, you don't need extensive name, but i use so that the problem happen. For example, The firmware file name is "123.xpv". I have to set the parameter "filename"  to "C:\123" not "C:\123" because this funciton can generate ".xpv" extenstion.
 
This is not my fault.As when  i use downloading firmware tool that provided by vendor, it need the extersive name  and i am a newer about the knowlege for labview, please understand.
 
Best regards,
Jimmy  
Message 9 of 10
(4,520 Views)
Smercurio wrote:
 
Also, altenbach asked what errors you get and you responded that when you run the program you get an error but that it just returns a number. Well, what is that error code number?
 
The error code is set by myself. It is not error code with Labview. It is just easy to indicate the failure signal.
0 Kudos
Message 10 of 10
(4,519 Views)