LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Run time error

Solved!
Go to solution

HI All,

I have use some serial com port functions which are defined in some other project. So I simply copied that .c & .h file (where these functions are defined) in my project and included its name in my project as header file. But while running I'm getting some weird error.

 

Function definition is:

int CVIFUNC Initialize_SerialComPort(void)
{
int __error = 0;


if (__assemblyHandle == 0)
__errChk(CDotNetLoadAssembly(
__assemblyName,
&__assemblyHandle));

 

__Error:
return __error;
}

 

and error is:

NON-FATAL RUN-TIME ERROR: "SerialComPort.c", line 32, col 9, thread id 0x00002504: Function CDotNetLoadAssembly: (return value == -6579 [0xffffe64d]). The LabWindows/CVI .NET Library could not load the specified assembly.

 

 

Can anyone tell me what is the issue and how to fix it.

0 Kudos
Message 1 of 10
(4,559 Views)
Solution
Accepted by mahto

Hello mahto,

 

This function loads the .NET assembly that the name parameter specifies.

If the .NET assembly is not in the Global Assembly Cache or in the same directory as the calling executable, then you must first call CDotNetRegisterAssemblyPath to register the file path of the assembly.

 

Make sur you include "cvidotnet.h" in your header file from the .NET library.

 

regards,

0 Kudos
Message 2 of 10
(4,521 Views)

You can take a look here too :

LINK

0 Kudos
Message 3 of 10
(4,520 Views)

What can be the possible reason for a cursor getting stuck in ComRdterm() at run time?

 

0 Kudos
Message 4 of 10
(4,473 Views)
Solution
Accepted by mahto

You are probably setting an important timeout period value.

Try to set the timeout period by calling SetComTime

 

I'm not sure if this was the reason for the cursor getting stuck. You need to investigate. 

 

Regards,

0 Kudos
Message 5 of 10
(4,467 Views)

I'm checking ports one by one whether it's the one which I want. But for the ports which are not available in PC then OpenComConfig() function shows Run time error saying "this port is invalid".

How can that error be removed.

0 Kudos
Message 6 of 10
(4,448 Views)

In this case, try to use GetComStat() before. This function returns information about the status of a COM port.

In fact, it returns a negative error code if you have not opened the port or if you pass an invalid value for port number. So you need to check the returned value each time you have to call OpenComConfig().

 

Regards, 

0 Kudos
Message 7 of 10
(4,434 Views)

Even after using GetComStat() before OpenComConfig(), it's still showing the run time error (port not open). So I used OpenCom() before GetComStat(). But if let say port 2 is not available then story is same as with OpenComConfig().

 

0 Kudos
Message 8 of 10
(4,429 Views)

OpenComConfig() and OpenCom() are the same function. It's just that with OpenComConfig() you have the possibility the update the port settings (parity, ...). 

 

I have a question : en debug, when you got the error message ? I mean, when you execute OpenComConfig() or before when you execute GetComStat() ?

0 Kudos
Message 9 of 10
(4,424 Views)

when I execute GetComStat(). For execution of OpenComConfig(), I have used status of GetComStat(). But GetCom Stat() gives error for every scan(Com Port Scanning) .

0 Kudos
Message 10 of 10
(4,415 Views)