01-23-2017 10:22 PM
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.
Solved! Go to Solution.
01-24-2017 06:52 AM
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,
01-24-2017 06:53 AM
You can take a look here too :
02-03-2017 12:39 AM
What can be the possible reason for a cursor getting stuck in ComRdterm() at run time?
02-03-2017 03:06 AM
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,
02-06-2017 09:27 PM
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.
02-07-2017 03:43 AM - edited 02-07-2017 03:44 AM
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,
02-07-2017 05:10 AM
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().
02-07-2017 06:24 AM
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() ?
02-07-2017 09:00 PM
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) .