03-23-2012 08:12 AM
Hi,
we are using a NI 1772 smart camera and cvi 2010 for two projects.To communicate between the camera and cvi we use shared variables.
The systems are running well when they are started. But on the first start up after power up we always get an error message after trying to create a subscriber
example:
//
rw = CNVCreateSubscriber(String, ResultDataCallback, ResultStatusCallback,
0, 10000, 0, &Sub_Cmd_GetResult);
causes an error message that the function could not completed. Nevertheless what we use as timeout. Even if the timeout is a minute this problem occurs. On the second startup it works.
Is there any initialization what we have to do before we can use CNVCreateSubscriber?
does anyone know this problem two?
greetings
Oliver
03-26-2012 08:36 AM
He OZI
Maybe this can help:
Problem Details:When you connect a subscriber to a network variable
(CNVCreateSubscriber) neither the status, nor the data callback is fired.
Help:
When the status of the connection changes, the statusCallback function is
called with the new status. When the subscription is successful, the
dataCallback function is called with the current value of the variable; if the
variable is uninitialized and does not have a value, the dataCallback function
is called with data of type CNVEmpty."
So I would expect to get a status event "connected" and a data-event with the
current (initial) value of the variable.Steps to Reproduce:Open the example:
samples\networkvariable\Subscriber\NVSubscriber.prj
Place a breakpoint inside the status- and data-callback functions.
Start the example, select a network variable, and see that no callback is
fired.Workaround:Use a second "read" connection to the same variable, and read
the data programmatically at the beginning of your application.Most Recent User
Note
04-04-2012 01:48 AM
Hi,
the problem is, it happens only in the release version not in the debugging version. And it happens not everything when we start up the camera.
But when it happens, we have to restart the HMI software several times until we get an stable connection.
how can we solve this? Any ideas?
Thanks
Greetings
Oliver