LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why Ref. operations are taking so much time

In my program i want to execute some commands. for executing command i do following things
1.search a vi with perticular name in certain folder.
2.open ref. to selected vi
3. Pass the args data into cmdArgs string control in the vi
4. Set the error status of the vi
5. Run the VI
6. Read the Error status of the vi
7. Read the data in "Data" indicator in the vi
i am attaching the block diagram of the perticular vi.
 
but when call the dynamic vi it takes excessively large time here is what i found after further analysis
1. Open ref takes around 700 msec
2. ctr val set for cmd args takes around 550 msec
3. ctr val set for error in takes hopeless 2.5 SECONDS
4. RunVI takes 300 msec
5. both ctr val get takes less than 1 mSec
and close ref takes 700msec.
 
now if just i open the VI which is called dynamically by double clicking on it and if i run my code it takes hardly 150msecs.
 
i cant figure out why its happening so
1. file path is correct
Controls and indicators which are used for ctr val Get\Set are existing without any spelling mistake or without any extra whiterspace chars
 

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 1 of 8
(3,384 Views)

Just a guess, but could it be that your VI was last saved in a previous version of LabVIEW? In this case it would need to be converted every time you call it, a slow process.

Make sure all you VIs are saved in the current LabVIEW version. You could even masscompile the entire folder containing all your subVIs.

Message Edited by altenbach on 09-05-2006 09:06 AM

0 Kudos
Message 2 of 8
(3,368 Views)

This is surely not the case.

I am using LabVIEW 8.0.1, and the entire code has been developed from scratch in LabVIEW 8.0.1 itself.

 

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 3 of 8
(3,321 Views)

just now i conducted one more experiment and here are the results

1. I created one simple VI and Called it dynamically (Entire VI was Written in LabVIEW 7.1) i found that overhead of dynamic calling is around 2 msec

2. then i wrote (NOT CONVERTED) same code in LabVIEW 8 and i found that the overhead of the dynamic calling is around 12 Msec.

3. I Converted the 7.1 code into 8.0 and saved it to find that it takes around 12 msec as an overhead

please find attached sample code on which i took these trials. it is in LV7.1

some more things i observed are as follows

1. If i increase the Execution time of VI being called dynamically (by increasing the iterations) then overhead also increases (try out 10000, 100000, 1000000 etc.) this seems funny to me, since i expect the overhead must be due to opeining of ref. passing the values and closing the vi ref.

 

Message Edited by Tushar Jambhekar on 09-10-2006 02:36 AM

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

Download All
0 Kudos
Message 4 of 8
(3,317 Views)

The apparent increase in overhead time is due to the passing of the array. Increasing the iteration number also increases the size of the data chunk to be transfered. Additionnally, the array indicator should have been placed after the second timer, outside the sequence structure, otherwise you also measure the display time.

If you use a fixed size array in the test.vi, then the overhead time stays the same, whatever the iteration number.

Sorry for the two stars, that's just the result of an unintentionnal drop-through click 😞

Message Edité par chilly charly le 09-10-2006 11:41 AM

Chilly Charly    (aka CC)
0 Kudos
Message 5 of 8
(3,305 Views)
thanks. certainly now i know one more point to take care of while calling vis dynamically
 
but why there is so much of a difference in Version 7.1 and 8.0
 
i observed 7.1 takes 1/6 the time taken by 8.0
 
and in the actual VIs that i itend to call is taking the overhead of the order of hundreads of miliseconds, the data passed is certainly not that huge.
 
is there any way through which i can reduce this overhead?

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 6 of 8
(3,277 Views)
I don't see such differences between 7.1 and 8.2. May be you could post a vi that shows the problem ?
Chilly Charly    (aka CC)
0 Kudos
Message 7 of 8
(3,223 Views)
please check out attached file

Tushar Jambhekar
tushar@jambhekar.com

Jambhekar Automation Solutions
LabVIEW Consultancy, LabVIEW Training
Rent a LabVIEW Developer, My Blog

0 Kudos
Message 8 of 8
(3,176 Views)