LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CNVNewVariable() argument is invalid

Just such a syntax : "CNVNewVariable("\\\\localhost\\cnvtest.exe", "mycnv");" it always report error. which argument is wrong?

 

 

David 

0 Kudos
Message 1 of 6
(3,465 Views)
By the way, may I need open the TCP port 59110 before using the network variable?
0 Kudos
Message 2 of 6
(3,464 Views)

The wrong parameter is possibly the network variable path, which is not the name of the executable but the one you have created either programmatically with CNVNewProcess or in the iteractive application.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 6
(3,461 Views)

Hi Roberto,

 

I use the following code:

 

char process[] = "mymcnvtest"; 

 

int main ()

{

    char path[256];

 

    CNVNewProcess(process);
    CNVStartProcess (process);
    strcpy(path, "\\\\192.168.0.62\\");
    strcat(path, process);
    CNVNewVariable(path, "mycnv");
    CNVDeleteProcess (process);
...

}

 

the CNVNewVariable() still report the argument is invalid error.

0 Kudos
Message 4 of 6
(3,449 Views)

The first argument to CNVNewProcess is a machine relative path - meaning, you do not specify the machine's name or IP address but rather, <process>\<folder>\<sub-folder>\<sub-sub-folder>\<etc>.

 

So, in your example, the call would be:

    CNVNewVariable(process, "mycnv");

0 Kudos
Message 5 of 6
(3,433 Views)

Now it is working. Thanks Mohan.

0 Kudos
Message 6 of 6
(3,427 Views)