LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CNVCreateBufferedWriter - Could not complete operation in specified time

I confirm that:

  • the ports are not blocked by antivirus or firewall
  • changing the registry doesn't work

I can be wrong but as I wrote in one of the previous messages, I think the problem is the following:

sometimes when I call CNVStartProcess() the variables (that have been properly created, as shown in Distributed System Manager) are deleted. The process is not deleted.

Could you suggest me a way to deeply debug what happens when I call CNVStartProcess()?

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 21 of 40
(1,342 Views)

Vix,

 

It could be that there is a hang in the shared variable engine. We can determine this if not only do the variables in your buf-Test process disappear, but if all variables disappear. You can manually create a process and variables in the Distributed Systems Manager, then restart the system and run through the code again. Check before and after starting the process to see if not only do your buf-Test variables exist, but also to see if your manually created variables exist. If the all variables do not display when expanding the process tree, then we know that the shared variable engine likely hung and we can begin debugging that.

National Instruments
0 Kudos
Message 22 of 40
(1,336 Views)

I did what you suggested me, but the Shared Variable Engine isn't hung. Only buf-Test variables are deleted when I call CNVProcessStart().

Other variables aren't deleted and are updated regularly.

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 23 of 40
(1,329 Views)

When the program doesn't run, if I try to stop the variable engine through Administrative tools >> Services I have the error 1067 "Termine imprevisto del processo" (in Italian).

After having restarted the Variable Engine, the first time CNVCreateBufferedWriter() fails with error -6382 "Socket has been disconnected by its peer", then (from the second time) with the usual "Could not complete operation in specified time".

 

I want to clarify that I work with Win 7 64-bit with a user without administrative rights.

 

Moreover I notice a strange behavior: during application development using CVI, it happens that after having changed some lines of code and having rebuilt the application, it CNVCreateBufferedWriter fails, and I must re-start my PC.

This morning I've already restarted 7 times!!!!!!!!

 

This problem is really urgent. I can't develop an application in this situation.

 

 

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 24 of 40
(1,323 Views)

In NetVar_ReserveHandle you check if the process exists, then stop and delete this process if it does exist. Then you create a new process. I am concerned that during startup this may not happen as explicitly as expected. The shared variable engine may not be fully ready to delete the process, then when it is ready it deletes the process, but your application has moved on. Could you try double checking if the process exists by successfully browsing to it before you delete it. Alternatively, you could avoid deleting the process and reuse the process and variables instead.

 

It would also be interesting to see if this is limited to only buffered writers. What about buffered subscribers, or non buffered operations?

 

Do you have access to admin privileges that you could check to see if it shows the same behavior?

 

What happens if you put a delay into the code at the beginning. I understand this may not be ideal for you application, but it would be interesting for troubleshooting purposes to see if the behavior changes if a delay of 5-10 seconds is placed at the beginning.

National Instruments
0 Kudos
Message 25 of 40
(1,311 Views)

In NetVar_ReserveHandle you check if the process exists, then stop and delete this process if it does exist. Then you create a new process. I am concerned that during startup this may not happen as explicitly as expected.

The problem is not during startup: it's exactly the opposite!!!! One of the best ways to have the application working is to launch it as soon as possible after the system startup.

 


The shared variable engine may not be fully ready to delete the process, then when it is ready it deletes the process, but your application has moved on. Could you try double checking if the process exists by successfully browsing to it before you delete it.

This workaround doesn't work.

 


Alternatively, you could avoid deleting the process and reuse the process and variables instead.

If I don't delete the process, CNVVariableExists() returns that variable exist, but I can't see it in Distributed System Manager!!!! So this doesn't work.

 


It would also be interesting to see if this is limited to only buffered writers. What about buffered subscribers, or non buffered operations?

They work, because the NVBuffering example (that has a non-buffered writer and a buffered subscriber) works as expected.

 


Do you have access to admin privileges that you could check to see if it shows the same behavior?

Unfortunately I don't.

 


What happens if you put a delay into the code at the beginning. I understand this may not be ideal for you application, but it would be interesting for troubleshooting purposes to see if the behavior changes if a delay of 5-10 seconds is placed at the beginning.

This doesn't make any difference.

 

Hope this helps.

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 26 of 40
(1,318 Views)

... only to say that I made all the test in the previous message after the application has failed for the first time (and the Variable Engine probably has run into unexpected situation).

Then I modified my code and I don't delete the process if it already exists: I let you know if this modification will work.

 

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 27 of 40
(1,316 Views)

I can confirm that not deleting the process if it already exists doesn't help solving this problem.

 

Let me know...

Vix
-------------------------------------------
In claris non fit interpretatio

-------------------------------------------
Using LV from 7
Using LW/CVI from 6.0
0 Kudos
Message 28 of 40
(1,300 Views)

Hey Vix,

 

I wanted to post back and let you know that I did not forget about you. We are still looking into how we can debug this issue further. I should have some more details soon.

National Instruments
0 Kudos
Message 29 of 40
(1,289 Views)

Vix,

 

Let's make sure that the MXS service is started before you run your application. And while we are at it, we can test to see if the variable engine is running as well. Here is some code that will do it.

 

SC_HANDLE SCManager;
	SC_HANDLE SCHandle;
	BOOL isConnected;
	SERVICE_STATUS ServiceStatus;
	DWORD status = 0;
	
	do
	{
		SCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
		SCHandle = OpenService(SCManager, "mxssvr", SERVICE_QUERY_STATUS);
		isConnected = QueryServiceStatus(SCHandle, &ServiceStatus);
		status = GetLastError();
	}while(ServiceStatus.dwCurrentState != SERVICE_RUNNING);
	
	
	do
	{
		SCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
		SCHandle = OpenService(SCManager, "NITaggerService", SERVICE_QUERY_STATUS);
		isConnected = QueryServiceStatus(SCHandle, &ServiceStatus);
		status = GetLastError();
	}while(ServiceStatus.dwCurrentState != SERVICE_RUNNING);

 

Here I am using QueryServiceStatus and other service Win API functions.

National Instruments
0 Kudos
Message 30 of 40
(1,278 Views)