LabVIEW

cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

Call Library Function Node.vi using problem

Hi, 
 
 ęˆ‘用Labwindows ē¼–äŗ†äøŖčÆ»ę–‡ä»¶ēš„ēØ‹åŗē„¶åŽē”ŸęˆåŠØę€åŗ“, ē„¶åŽåœØLabVIEWé‡Œč°ƒē”ØčÆ„åŠØę€åŗ“(Call Library Function Node), å³å‘čÆ„åŠØę€åŗ“ä¼ é€’ę–‡ä»¶ååŠč·Æå¾„å’ŒęŸäø€å­—ē¬¦äø²,ē„¶åŽčÆ„åŠØę€åŗ“ę‰“å¼€ē›øåŗ”č·Æå¾„ę–‡ä»¶ä»Žäø­čÆ»å‡ŗå¹¶čæ”å›žäø‰äøŖå‚ę•°å€¼,åÆę˜ÆęÆę¬”ēš„čæ”å›žå€¼ę€»ę˜¾ē¤ŗę‰“å¼€ę–‡ä»¶å¤±č“„, čÆ„å‡½ę•°åœØLabwindowé‡Œę²”ęœ‰é—®é¢˜. 在LabVIEWé‡Œå¦‚ä½•č°ƒčÆ•ę„ē”®å®šä¼ åˆ°åŠØę€åŗ“ēš„å‚ę•°ę ¼å¼ę˜Æę²”ęœ‰é—®é¢˜ēš„å‘¢?ä»»ä½•ēš„ęŒ‡ē‚¹čæ·ę“„,äøčƒœę„Ÿęæ€!
 
 
Frank,
 
0 Kudos
Message 1 of 11
(4,480 Views)
Could you try to rephrase your question in Western letters and preferable English so that more people could help you?
 
Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 11
(4,462 Views)
I translate your post using Google Smiley Wink for those can't read Chinese.
>I read documentation procedures before using Labwindows Bianlege generated DLL, Lane then call the DLL in LabVIEW (Call Function
>Library Node), and to the dynamic transmission path and file name of a string. Then open the corresponding dynamic routing document
>from the Secretary read out the three parameters and return values. However, the return value of each open document shows the total
>failure. Labwindow has no function in the problem. in LabVIEW to determine ways to spread the dynamic debugging there is no problem
>with the format of the parameters? Any Ariadne, be grateful!
 
 
It seems you have problem to use a LabWindow dll in LabVIEW.
The data types in LabVIEW are different from those in LabWindow.
I recommand you do the reverse: in LabVIEW, right click the Call Function Library Node, and select "Create .c File...".
Then open the .c file in LabWindow, reprogram your dll to match LabVIEW data type.
 
George Zou
 
George Zou
Message 3 of 11
(4,447 Views)

thanks,

 I have written a DLL with Labwindow that it can be called by LabVIEW to search some given paramters in a given file. The input include two paratmeter file & path and some string like as "paragraph". The output should returns three parameters we will use. This function work fine in Labwindow, but err happened when called in LabVIEW showing failed to open the given file from the return value.  How to know the filename and path aready passed to DLL with correct format?

 Any suggestion will be greatly appreciated! 

Frank

0 Kudos
Message 4 of 11
(4,442 Views)


@xiejiezhou wrote:

thanks,

 I have written a DLL with Labwindow that it can be called by LabVIEW to search some given paramters in a given file. The input include two paratmeter file & path and some string like as "paragraph". The output should returns three parameters we will use. This function work fine in Labwindow, but err happened when called in LabVIEW showing failed to open the given file from the return value.  How to know the filename and path aready passed to DLL with correct format?

 Any suggestion will be greatly appreciated! 

Frank


A LabVIEW path is a special data type whose format is actually privat and therefore only understandable for LabVIEW itself.

Before passing it to the Call Library Node convert it to a string with the Path To String function and then pass this a s a C style string pointer in the Call Library Node.

For the rest, Georges recommandation to have LabVIEW create the function protoype as you have configured it is a good one. You can go from there or at least use it to compare what you have with what LabVIEW thinks it should be according to your CLN configuration. 

Rolf Kalbermatter

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 5 of 11
(4,437 Views)
Thank Georges and Rolf Kalbermatter,
 
 I changed the runtime support with " Full Runtime Engine" instead of " LabVIEW Real-Time Only" before, it's work now, but the output parameters returned are irregular incorrect characters. My funciton prototype is:
DLLEXPORT long  CollectParameter(char *NomFile, char *szNomParagraph, char *Command[], char *Type[], char *Value[]) 
so how to configure the type in LabVIEW respectively?  I tried every types, just "c String Pointer" is ok, but returned value irregular & incorrect.
As Geogre's suggestion,  i should add my code as below function generated by LabVIEW, is it?
ong CollectLabel(char szNomFile[], char szNomParagraph[], char Command[],  char Type[], char Value[])
 {
 /* Insert code here */
 }
 
Frank
0 Kudos
Message 6 of 11
(4,418 Views)


@xiejiezhou wrote:
Thank Georges and Rolf Kalbermatter,
 
 I changed the runtime support with " Full Runtime Engine" instead of " LabVIEW Real-Time Only" before, it's work now, but the output parameters returned are irregular incorrect characters. My funciton prototype is:
DLLEXPORT long  CollectParameter(char *NomFile, char *szNomParagraph, char *Command[], char *Type[], char *Value[]) 
so how to configure the type in LabVIEW respectively?  I tried every types, just "c String Pointer" is ok, but returned value irregular & incorrect.
As Geogre's suggestion,  i should add my code as below function generated by LabVIEW, is it?
ong CollectLabel(char szNomFile[], char szNomParagraph[], char Command[],  char Type[], char Value[])
 {
 /* Insert code here */
 }
 
Frank


The char *Command[], char *Type[], char *Value[] parameters are parameters that you can not create with LabVIEW. This are arrays of strings and and LabVIEW has a completely different idea about how to place strings and arrays in memory than what is used in C.

And while LabVIEW supports translation of the top level type to C compatible pointers it does not have any option to let you configure it to translate embedded elements in parameters (the strings in the array) to be translated too.

But to be honest what you seem want to do is read in a file, do some parsing and then return parameters taken out of that file. Doing that all in LabVIEW would be SOOOOOOOOOOOO much easier.

Rolf Kalbermatter

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 7 of 11
(4,406 Views)
Hi Rolf,
 
   Thank for your answer, because i am just a beginner of LabVIEW,  not so good at using it.  Where to find some examples about reading &writing files or could you give me some example about this? You can read the attached file to understand what i want to do.
   Thank in advance!
 
 
  Frank
0 Kudos
Message 8 of 11
(4,403 Views)
LV does has plenty of splendid example code about  file operation. You can get it by "Find Examples".
Cheng Yang
0 Kudos
Message 9 of 11
(4,394 Views)

Thank very much, i got it.

Frank

0 Kudos
Message 10 of 11
(4,382 Views)