取消
显示结果 
搜索替代 
您的意思是: 

Execution time for Call Library Function Node

已解决!
转到解答

I am experimenting with the Call Library Function Node block in LabVIEW and am curious if it should be running faster than what I'm seeing.  For testing purposes, I have compiled and transfered to my RT target the .out file from the KB article http://digital.ni.com/public.nsf/allkb/81D1172E3C28A5E4862575CC0076A230 (I'm using the vxworks 6.1 version).  The function in the .out file just multiplies two inputs together, adds a constant, and returns the result.  I have put this inside a 1 kHz timed loop with a commanded period of 1 ms and via the Ticks(ms) block and shift registers I calculate the amount of time per loop execution.  This process is apparently taking 5 ms per cycle and to me that seems slow.  Is that roughly the correct execution time for this kind of setup?  I will attach my test .vi file.

 

What I'm using:

Windows 7

LabVIEW 2009 SP1

NI-cRIO 9024 with NI-RIO 3.4.0

 

 

0 项奖励
1 条消息(共 7 条)
5,184 次查看

First off, the way you are doing timing isn't necessarily accurate because you don't know when the tick count VI is being called. For example, if it gets called on one iteration after your call library node executes, and the next iteration it gets called before the CLFN it executes, the subtraction doesn't include the call of the CLFN so you aren't seeing the true time it is taking for the dll to be called.

 

Where it says "error" on the top left hand corner of your loop. left click and choose previous iteration timing. Also, do you have the ability to choose a 1 Mhz clock? Are you sure it's actually being run on the RT and not on your PC? Running it on the PC would definitely make it difficult to execute at a 1 kHz rate.

0 项奖励
2 条消息(共 7 条)
5,172 次查看
解答
已被主题作者 jbailey86 接受

 

Another thing you need to change is to double-click on the Call Library Node and change the thread it runs in from the UI thread to any thread. The UI thread won't help you when you're trying to run as fast as possible.

3 条消息(共 7 条)
5,167 次查看

How do you use VxWorks 6.1 with LabVIEW 2009? LabVIEW 2009 compatible realtime targets all run the a kernel based on VxWorks 6.3.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 项奖励
4 条消息(共 7 条)
5,157 次查看

I changed the way I was measuring the execution per for(imstuck)'s recommendation and more accurately measured the loop to be running at ~250 Hz.  And yes it was definitely being run on a RT target.

0 项奖励
5 条消息(共 7 条)
5,148 次查看

I went through the procedure outlined in that article with the 6.3 version and could not compile succesfully.  I tried the 6.1 version and it worked.  It looks like my cRIO has files for both 6.1 and 6.3 on it.  Not sure why the newer version didn't work for me.

0 项奖励
6 条消息(共 7 条)
5,146 次查看

Configuring the Call Library Function Node to "Run in any thread fixed" fixed the problem and I can now execute the loop in the preferred amount of time.  Thanks for all of your help.

0 项奖励
7 条消息(共 7 条)
5,144 次查看