05-05-2014 03:24 PM
Hi,
As shown in picture below, i have DB connection reference. "Connection properties 2" indicator shows proper values, but the same "Connection properties" indicator in while loop shows nothing, but connection numbers are the same (in probe). There is event structure in this while loop also if it matters. Why i can't get proper connection reference from while loop?
I'm using LV2011.
Regards,
Kacper
Solved! Go to Solution.
05-05-2014 03:32 PM
Try putting a timeout, such as 100 ms, on the event structure (upper left corner icon). By default it is -1 (wait forever until event).
05-05-2014 03:43 PM
That's no problem. I fired this event (Results Button - Value Changed). This is strange problem - i attached next image.
When i run this VI, "connection properties 2" indicator shows proper values only in first loop iteration. After next iterations values are null. Maybe there is problem with ActiveX (ADO)? I'm using MySQL ODBC Unicode Driver.
05-05-2014 03:54 PM
You create a branch of the connection before the while loop and it disappears off screen. I assume you take that over to a close connection where it gets closed.
05-05-2014 03:59 PM
I close connection at the end of application. There is only small part on images.
In addition - i have following error from 'DB Tools Get Properties' after first iteration.
NI_Database_API.lvlib:Conn Get Properties.vi->Controller.lvlib:Controller.lvclass:Actor Core.vi:1->Actor Framework.lvlib:Actor.lvclass:Actor.vi:7->Actor Framework.lvlib:Actor.lvclass:Actor.vi.ACBRProxyCaller.FC600014<ERR>ADO Error: 0x00000001
Property Node (arg 1) in NI_Database_API.lvlib:Conn Get Properties.vi->Controller.lvlib:Controller.lvclass:Actor Core.vi:1->Actor Framework.lvlib:Actor.lvclass:Actor.vi:3->Actor Framework.lvlib:Actor.lvclass:Actor.vi.ACBRProxyCaller.FC10001A
05-05-2014 04:03 PM
What you are calling "the end of the application" is not actually that. You must understand dataflow. Find some tutorials on this and you'll soon understand the problem.
05-05-2014 04:08 PM - edited 05-05-2014 04:08 PM
@kacperek wrote:
I close connection at the end of application. There is only small part on images.
In addition - i have following error from 'DB Tools Get Properties' after first iteration.
NI_Database_API.lvlib:Conn Get Properties.vi->Controller.lvlib:Controller.lvclass:Actor Core.vi:1->Actor Framework.lvlib:Actor.lvclass:Actor.vi:7->Actor Framework.lvlib:Actor.lvclass:Actor.vi.ACBRProxyCaller.FC600014<ERR>ADO Error: 0x00000001
Property Node (arg 1) in NI_Database_API.lvlib:Conn Get Properties.vi->Controller.lvlib:Controller.lvclass:Actor Core.vi:1->Actor Framework.lvlib:Actor.lvclass:Actor.vi:3->Actor Framework.lvlib:Actor.lvclass:Actor.vi.ACBRProxyCaller.FC10001A
You are getting this error because you are closing the connection before you realize. These two sections of code are not the same. The bottom one will give the error that you are getting.
05-05-2014 04:12 PM
@aputman It does not matter. It's reference to some point in memory. It should work this way until i close connection (by reference). Now i have error after first use of this reference and i think it's strange bahaviour.
05-05-2014 04:17 PM
What doesn't matter? If i am misunderstanding something, you'll have to post some code because that is the obvious answer with what you have given us to work with.
05-05-2014 04:18 PM
It's not the dataflow.
This doesn't work too.
It's strange, because i can use this connection reference before the while loop. i'm getting records from DB before loop (not on this screenshot). Problem appears in while loop after first iteration.