bono02 Posted November 2, 2008 Report Share Posted November 2, 2008 This is a cross posting, I also posted in here: http://forums.ni.com/ni/board/message?boar...;thread.id=4915 I hope others LaVa's member could help me faster... ----------------- Hi all, I am using LV RT8.5 with 2 PXI installed, the PXI-7358 and DAQmx PXI-6259. I wrote a program in LabView RT of a single timed loop with time constraint 5 ms. The first program, the loop rate was OK (no delay, finished late boolean is false), however, when I added a subVi, suddenly the loop rate became high and delay occured (finished late boolean is true).The delay could reach to 100ms I attached the pictures below. 1. The fine loop without subVi 2. The loop with subVi 3. The subVi What I guess now the problem is because of the DAQmx create virtual channel and DAQmx start. However, If I remove these functions from the subVi, thus I have to connect the DAQmx create virtual channel and DAQmx start in every main program, and thus it will give so much work and make the program more complex. Are there any solutions for this. I really appreciate your help. Regards, Bondhan Quote Link to comment
LAVA 1.0 Content Posted November 2, 2008 Report Share Posted November 2, 2008 You could build an auto-initialize function, in the first call you create and start the task. In succeeding runs you only read the DAQ. However I advice you to timed IO within DAQmx, so the timing is handled by the daqmx driver and not by LabVIEW. To do this you should create a clock on your 6259 of 5 ms, and do a burst read in LabVIEW of 1 sample, no timing needed the speed will be limited by the DAQ card. Ton (look at the NI examples for timed IO) Quote Link to comment
bono02 Posted November 3, 2008 Author Report Share Posted November 3, 2008 QUOTE (Ton @ Nov 2 2008, 01:12 AM) You could build an auto-initialize function, in the first call you create and start the task.In succeeding runs you only read the DAQ. Hi Ton, Thank you for your reply. However, I could not find example in ni.com related to auto-initialize function. Could you give me one example? Or perhaps what you meant was the create instance function (like constructer in C++) in LV Object Oriented Graphical Programming, was this what you mean? QUOTE (Ton @ Nov 2 2008, 01:12 AM) However I advice you to timed IO within DAQmx, so the timing is handled by the daqmx driver and not by LabVIEW. To do this you should create a clock on your 6259 of 5 ms, and do a burst read in LabVIEW of 1 sample, no timing needed the speed will be limited by the DAQ card. Did you mean using external trigger? I am not planning to use ext. trigger though, since I desire only to use the source from a single machine. Quote Link to comment
LAVA 1.0 Content Posted November 3, 2008 Report Share Posted November 3, 2008 QUOTE (bono02 @ Nov 2 2008, 03:48 AM) Hi Ton, Thank you for your reply. However, I could not find example in ni.com related to auto-initialize function. Could you give me one example? Or perhaps what you meant was the create instance function (like constructer in C++) in LV Object Oriented Graphical Programming, was this what you mean? No, I wasn't very clear. QUOTE Did you mean using external trigger? I am not planning to use ext. trigger though, since I desire only to use the source from a single machine. That's close, but not entirely, what I mean is to use one of the clounters as a clock source. An example shipped with LabVIEW (examples\DAQmx\Synchronization\Multi-Function.llb\Multi-Function-Synch Dig Read Write With Counter.vi) shows how to use a counter as a clock for a read and write routine, just remove the read or write to fit your needs. Remember this can only be done on port 0 (which has 32 inputs on the 6259). Ton PS, if you post screenshots of your code I recommend you to use the http://wiki.lavag.org/Code' Capture Tool' rel='nofollow' title='LabVIEW Wiki article on Code Capture Tool' alt='Wiki article on Code Capture Tool' style="border-bottom: 1px dotted #3366BB; color: #3366BB; cursor:pointer; text-decoration:none;" class="wiki">Code Capture Tool Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.