f



How to run while loops in parallel

Hai 
i am using labview 7.1
I want to read the data & i should transmit through CAN
i have two options 
1) Default
2) i will read data from a file
3) By clicking on the LED indicator i will generate the data & transmit
 
when i run the program 
if i select default data & click send default data should be send to the CAN the LED indicator will be ON or OFF
if i select Read from file & click that data i select should send according to the data LED will ON or OFF
if i select the othere option by clicking on LED it will generate the data that will be send
 
but always the CAN read should run and display the received data
 
i attached my vi please give me an idea how to do it
thanks  
 


try.zip:
http://forums.ni.com/attachments/ni/170/173982/1/try.zip
0
x9561 (148442)
3/16/2006 2:41:02 PM
comp.lang.labview 35213 articles. 1 followers. vasusachin24 (1) is leader. Post Follow

0 Replies
508 Views

Similar Articles

[PageSpeed] 5

Reply:

Similar Artilces:

parallel while loops not running in parallel
I am collecting data from a PCI 4351 board and a 6070E board. These are connected to a TC 2190 and a BNC 2090. I do not need exact sychronization, however I do need them to collect data at different rates. Currently I am using two while loops to perform this, but they run sequentially in stead of simultaneously, that is, the second while loop waits for the first one to finish before running. Is there any way I can get these to run both at the same time instead of one after the other? Parallel Whiles.vi: http://forums.ni.com/attachments/ni/170/326678/1/Parallel Whiles.vi Your two loops are calling the same SubVI, and that VI is not reentrant, so only one instance can be in memory at a time.  Therefore, one loop will have to wait for the other loop to release control of the AI Read before it can access the AI Read.   One option is to save AI Read as something else (maybe in your user.lib) and make it reentrant, but it actually calls AI Buffer Read which also uses non-reentrant VIs.  I would suggest looking at your timing to see if you can make it as exclusionary as possible. Thanks for the reply, is there a better way to accomplish what I am trying to do? I was thinking maybe using a sequence and switching off between the two. Any way you do it, you're going to have to sequentially read from the data buffer, and the implementation you have now may be the fastest, if not the most accurate.  I would recommend that you either put a wait...

parallel loops in labview
Hi All,   I have a VB dll for executing a function. i am calling this dll function through .NET ActiveX controls in LabView8.0. its working fine. this function will take time to execute. here my task is, i need to display the status that how much the function is executed in a status bar.   for this, i have an estimated time. so i kept two parallel loops. one loop wil execute the function. another loop (while loop) will increment the value of status bar. but here, if the execution control goes to dll function, my status bar loop is not getting update. after completing the dll execution only, my status bar loop is executing. is there any ways to over come this?   Thanks, Bannu.  Hi Norbert , Thanks for the reply. i am using ActiveX Vis for my dll calling instead of call library function node why because my dll is a VB ActiveX dll. calling and execution of dll function is working fine. According to your answer, is my screen wont update utill the dll function execution finishes? is there no way to do this? Thank, Bannu.   Thank you Norbert ..   ...

How to run while loops parallel
Hai i am&nbsp;using labview 7.1 I want to read the data &amp; i should transmit through CAN i have two options 1) Default 2) i&nbsp;will read data from a file 3) By clicking on the LED indicator i will generate the data &amp; transmit &nbsp; when i run the program if i select default data &amp; click send default data should be send to the CAN the LED indicator&nbsp;will be ON or OFF if i select Read from file &amp; click that data i select should send according to the data LED will ON or OFF if i select the othere option by clicking on LED it will generate the data that will be send &nbsp; but always the CAN read should run and display the received data &nbsp; i attached my vi please give me an idea how to&nbsp;do it thanks&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; trial.zip: http://forums.ni.com/attachments/ni/170/173955/1/trial.zip Sorry now I removed the password thanks try.zip: http://forums.ni.com/attachments/ni/170/173980/1/try.zip Hi LV Beginner, &nbsp; I'm not sure if your question is how to use the CAN driver, or how to organize your LabVIEW code.&nbsp; If you're still learning LabVIEW,&nbsp;you may want to check out these Introductions to LabVIEW:&nbsp; &nbsp; <a href="http://zone.ni.com/devzone/learningcenter.nsf/webmain/60c2782788a811c986256cd50001a0a6" target="_blank">LabVIEW Three Hour Introduction Course</a> <a href="...

Timed loop running parallel with Queues
I was wondering if it is possible to have a Producer/Consumer Pattern with a timed loop that is not just executed when it is called by the queue or from the Producer Loop, but also executes the timeout after a given time. Thanks in advance, Oliver<img alt="" src="file:///c:/temp/moz-screenshot-1.jpg"><img alt="" src="file:///c:/temp/moz-screenshot-2.jpg"> example.png: http://forums.ni.com/attachments/ni/170/338121/1/example.png Oliver, maybe it is more suitable just to set a timeout for the dequeue-function...Norbert lol :smileyvery-happy: thank you Norbert great adviceI was so focused on wanting to use a Timed Loop that I totally forgot about the dequeue TimeOut :smileyhappy: cheers Olli ...

By parallel for loops is one running faster?
Hello, I have a question: I have two for loops running paralell (I have "wait until next millisecond multiple" with 10ms in each of them). If I run this VI with higlightet execution, I see, that the upper loop in my VI si running slower, than the lower loop. If I run the VI without highlighting execution, I do not see this problem. Why does the VI run differently, when the execution is highlighted? Thank you. parallel_for.vi: http://forums.ni.com/attachments/ni/170/182276/1/parallel_for.vi ...

running a while loop within a while loop
Hi &nbsp;I am making an executable where all controls are programatically derived - no use of Labview buttons. &nbsp; I have a bit of a dilema with this vi that I am making: &nbsp; I have a while loop to run my executable vi which does the data processing. These results are stored in an array - each column representing one set of results. I then want to plot these results and i want to do it column by colum (column specified by a control on the front pannel) while the main processing vi is still running. So i put the plotting part of the code in a while loop, which itself is inside...

Parallel event loops
Hi there, I've been working on a "top-level" VI for a tester project, in which six separate (but identical) subVIs run quasi-independently. My VI explains better than words what I'm trying to do. It does seem a very bulky way of doing things (and the Value Changing property node, I've been told, has a lot of overhead) - can anybody suggest where it might be improved? Hopefully this will help out some other users too! Test3x4.vi: http://forums.ni.com/attachments/ni/170/239846/1/Test3x4.vi CountTest.vit: http://forums.ni.com/attachments/ni/170/239846/2/CountTest.vit ...

Parallel computing runs for many loops, but eventually gets stuck and just hangs
I'm running a stochastic fitting algorithm to fit my model parameters to a set of data and I'm using parallel computing. I'm trying to get many different data sets so I can compare them, but the program keeps stalling somewhere in the middle. It will run and get a couple of rounds of good fits, but eventually it just stalls out without throwing an error. For clarification, I'm assuming it is stalling because I have the program displaying its progress and it updates every ~7 seconds, but when it stalls it will not have updated for more than an hour. I'm not 100% sure that it...

Why does NiVisaServer.exe is running when Labview is running??
I am running two identical test setups for&nbsp;some system testing.&nbsp; The PC&nbsp;configuration and test cases are same on both the setups. I am using &nbsp;Labview version 8.5 . I observe the setup running with NiVisaServer.exe is slow as compared to the other setup.&nbsp;The same file is not running in the other setup.&nbsp; My question is , does NiVisaServer.exe slow down the Labview execution?? Why does NiVisaServer.exe is not running in the other tester eventough both are identical?? &nbsp; ...

how to change a variable in loop when loop is running
Dear all How to change a variable in loop when loop is running? Such as: while 1 i=5; % Hoping 'i' can be changed when the loop is going pause(0.5); disp(i); end But I can not make it. Who can help me. Many thanks, "Ross" <ukcrossa@gmail.com> wrote in message news:ef40f6e.-1@webcrossing.raydaftYaTP... > Dear all > > How to change a variable in loop when loop is running? > > Such as: > > while 1 > i=5; % Hoping 'i' can be changed when the loop is going > pause(0.5); > disp(i); > end > > But I can...

Running LabView run time from Excel
I need to run a labview runtime from Excel, the problem is I do not have LabView installed on my computer so I do not see the LabView object library in Excel VB interface, I assumed that installing a runtime version should install that too. Am i missing something, or is there a way to run a labview runtime VI using ActiveX without actually intstalling labview. Thank You. Check out this post&nbsp; on <a href="http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=45099&amp;requireLogin=False" target="_blank">Accessing compiled VI`s via VBA </a>. I think will shed some light on the subject. Also, consider making a dll instead of an exe. That may also solve the problem. Post to let us know your results. Thanks! &nbsp; &nbsp; Chris C I'm hoping that this thread isn't TOO old... In any case, I am also trying to call an ActiveX server I have built with LV from Excel. If I change the reference to "Labview.application" to something like "myapp.application", the routine actually runs&nbsp;once and Excel stops with a "runtime error '13' type mismatch". Anybody have any ideas as to what is mismatching what? Mike.... Hey Mike, Two things to verify, 1. The LabVIEW run time engine is installed. 2. You've enabled ActiveX for your executable. See the picture below. &nbsp; &nbsp; <img src="http://forums.ni.com/attachments/ni/170/231567/1/ActiveX.GIF"...

parfor loop running same speed as for loop on Mac
I'm using a Mac with 2, 3 GHz quad-core intel xeon processors, running Mac OS-X. When I run the following short code: matlabpool local 4 tic; parfor i=1:2000 rand(i); end toc; matlabpool close tic; for i=1:2000 rand(i); end toc; matlabpool close the parfor loop clocks at ~73 seconds while the for loop clocks at 72 seconds. If i change the value of i much greater or smaller, the effect is similar, the parfor loop runs 1-2 secs longer (I assume because of the time it takes to distribute the for loop). My first question is how can I make parfor function much faster (as it...

parallel for loops without parallel computing toolbox
Is this possible? On 11-03-07 10:12 AM, Nathan Jensen wrote: > Is this possible? That depends on what you mean by "parallel for loops". Matlab has a published external interface. That interface could be used to call out to arbitrary routines that might _somehow_ do computations in parallel, such as by using OpenMP or POSIX Threads or using an operating-system-specific method. Or you could start multiple Matlab instances and have them communicate with each other somehow, such as via shared memory or TCP; there are a couple of Mathworks File Exchange (FEX) contributions for...

AS400 runs, and runs, and runs
A friend went to a conference last week. One of the speakers said they went to a location as a consultant to review their systems and suggest possible upgrades. The consultants found the file servers but they couldn't find any physical device that was actually performing the daily business task. After a day of searching and tracing cables they had maintenance rip the drywall from an interior wall. Behind the drywall was a closet door, in the closet was an AS400. None of the current employees knew the AS400 existed. It had been buried inside a closet for at least 5 years, but it was still processing the daily business transactions. I've heard this story before somewhere else, but it was not a AS/400, but a Window Server at a University School. A rumor or true? I don't know... But, AS/400 is a true blue friend when it comes in reliability. Gil Eb wrote: > A friend went to a conference last week. > > One of the speakers said they went to a location as a consultant to > review their systems and suggest possible upgrades. > > The consultants found the file servers but they couldn't find any > physical device that was actually performing the daily business task. > After a day of searching and tracing cables they had maintenance rip > the drywall from an interior wall. Behind the drywall was a closet > door, in the closet was an AS400. > > None of the current employees knew the AS400 existed. > It had been buried ins...

LOOP and +LOOP
With LOOP, since the index (I) increases by 1 with each loop iteration, we can test for equality as a means to determine if it's time to exit the loop or not: : TEST 10 0 DO I . LOOP ; TEST 0 1 2 3 4 5 6 7 8 9 Here, when I gets to 10, the loop exits. It's not so easy with +LOOP, since the index can be changed by any arbitrary value on each iteration: : TEST 100 0 DO I . RANDOM +LOOP ; Here, we cannot test for equality. We have to test for crossing a boundary instead, at least as far as I can see. With that in mind, are these following results correct: : TEST 10 0 DO I . 1 +LOOP ; TEST 0 1 2 3 4 5 6 7 8 9 10 (11 iterations) : TEST 10 0 DO I . 3 +LOOP ; TEST 0 3 6 9 (4 iterations) : TEST -30 -7 DO I . -3 +LOOP ; TEST -7 -10 -13 -16 -19 -22 -25 -28 (8 iterations) Regards Mark On Nov 25, 10:34=A0pm, MarkWills <markrobertwi...@yahoo.co.uk> wrote: > With LOOP, since the index (I) increases by 1 with each loop > iteration, we can test for equality as a means to determine if it's > time to exit the loop or not: > > : TEST 10 0 DO I . LOOP ; > TEST > 0 1 2 3 4 5 6 7 8 9 > > Here, when I gets to 10, the loop exits. > > It's not so easy with +LOOP, since the index can be changed by any > arbitrary value on each iteration: > > : TEST 100 0 DO I . RANDOM +LOOP ; > > Here, we cannot test for equality. We have to test for crossing a > boundary instead, at least as far as I can see. > > With that in mi...

WHILE LOOP AS FOR LOOP
its possible? For each id in (SELECT * FROM table) INSERT INTO table2(id,fk,nombre) values(1,id,'xxx'); Jessica Gonz�lez (jess.rgm@gmail.com) writes: > its possible? > > For each id in (SELECT * FROM table) > INSERT INTO table2(id,fk,nombre) > values(1,id,'xxx'); > So in SQL, you don't normally code the loops explicitly - the loops are hidden on the inside. Logically, it is an operation of a set. INSERT table(id, fk, nombre) SELECT 1, id, 'xxx' FROM table -- Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se Books Online for SQL Server 2005 at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx thanks.. but SET IDENTITY_INSERT table ON; INSERT INTO table(pk,activo,permiso,rol) SELECT IDENT_CURRENT('table')+1,'S',id, 1 FROM table2 return error Violation of PRIMARY KEY constraint 'PK__table__3213E83F2B947552'. Cannot insert duplicate key in object 'table'. The duplicate key value is (6). only 'id' i need get from table2 Jessica Gonz�lez (jess.rgm@gmail.com) writes: > thanks.. but > > SET IDENTITY_INSERT table ON; > INSERT INTO table(pk,activo,permiso,rol) > SELECT IDENT_CURRENT('table')+1,'S',id, 1 > ...

labview 8.2 llb run with labview 8.5
On the PC I have delete labview 8.2, but I dont find the CD for reinstall. I have a .llb file made with labview 8.2, Can i run it with labview 8.5 or download labview 8.2, I muss install ii rapidelly. &nbsp; tks Costello, you can update the VIs within the LLB to LV 8.5 if they do not have their blockdiagram removed.....hope this helps,Norbert How can I update ? When I start the .vi in the lbb he dont found somme .vi located in DAQmx (wrtie.lbb, start task.lbb,...) How can i install this lbb? thks Costello, if you get loading errors when opening one VI from the LLB like you the ones you get, you have missing components.Since you spoke of DAQmx, i asume that you didn't install NI DAQmx on your machine. You should catch that up.hope this helps,Norbert ...

loops in loops
In the attached vi, the one second loop runs at one second and can't be touched.&nbsp; In the ten second loop, the ten second clock is a stand in for a process that generates a finished signal. The problem is once the process is complete, to start it again, leave the one second loop running, and start an additional process that will take less time than 10 seconds. thanks internal loops.vi: http://forums.ni.com/attachments/ni/170/319512/1/internal loops.vi Hi exo, what do you try there? If you start your vi, the value from your stop button will be read and after that, both loops "one" second and "ten" second won�t notice the state change of the stop button. Can you please explain, what you try to do?? Mike Okay, let me try again. I need three loops. Two loops start at the same time one runs fast one runs slow. The slow one is probably independent to the problem. When the second loop is done, it needs to restart and start a third loop that takes less than the second. You have a very basic dataflow problems. Unfortunately, I don't understand your description. &nbsp; I would recommend starting with some basic LabVIEW tutorials. &nbsp; Here are some&nbsp;obvious mistakes: - Your loop cannot read changes in the stop button, because the terminal is outside the loop. - You reset "internal loop" to zero in parallel to the loops. You cannot guarantee that this will happen before the locals are read so you might have a race c...

For loop while loop
I need to evaluate a function from 0:200 then create an array of every 5th value in the 0:200 array using a for loop then using a while loop. I can't get the for loop to work at all because I cannot use >,< controllers, only an =. So I focused on the While loop: n=0:200;%creates 201 cell array from 0-200 x=n.^2+.25;%calculates x plotcol=(length(n)-1)/5;%=(201-1)/5=40 y=zeros(1,plotcol);%creates 1X40 vector col=1;%used for incrementing in while loop while col<=plotcol; y(1,col)=x(1,5*col); col=col+1; end Unfortunately the output starts at 16 when it should start at 0. It seems like it should work to me, but something is messed up. Any help would be appreciated. "mpl " <mpl@mathworks.com> writes: > I need to evaluate a function from 0:200 then create an > array of every 5th value in the 0:200 array using a for > loop then using a while loop. > > I can't get the for loop to work at all because I cannot > use >,< controllers, only an =. > > So I focused on the While loop: > > n=0:200;%creates 201 cell array from 0-200 > x=n.^2+.25;%calculates x > plotcol=(length(n)-1)/5;%=(201-1)/5=40 > y=zeros(1,plotcol);%creates 1X40 vector > col=1;%used for incrementing in while loop > while col<=plotcol; > y(1,col)=x(1,5*col); > col=col+1; > end > > Unfortunately the output starts at 16 when it should start > at 0. It seems like it should work to me, ...

while loop in a while loop
Hi all, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I am trying to write a program with a while loop within another while loop. When I run the vi both while loops&nbsp; run but then only the inner while loop seems to update, I adjust controls and they have no effect on the indicators. &nbsp; Thanks.. The outer while loop will not update until the inner while loop finishes, at which point the whole dance will start again You need to familiarize with the concept of dataflow programming. Run your VI in "execution highligthing" mode while watching the diagram and you'll get a better feeling on how things work. :) &nbsp; If both loops need to run in parallel, place them next to each other without data dependency. &nbsp; Can you explain what you are trying to do? :) So is it a bad idea to have one within the other if I was them to run simultaniously? Should I put the two whileloops side by side? I have attached the block diagram Thanks &nbsp; Block Diagram.JPG: http://forums.ni.com/attachments/ni/170/319250/1/Block Diagram.JPG sparrowroad wrote:So is it a bad idea to have one within the other if I was them to run simultaniously? Should I put the two whileloops side by side? I have attached the block diagram It all depends what your program should do There are scenarios where stacked loops are appropriate. Typically, one loop is sufficient if you want to run most of the code at 500ms interval, but some p...

Run once while loop
Hi, I'm trying to do a while loop with condition of time if time is 12:00:00 print text, but for this one second the text is printed at least 50 times, how can I print only once? Thank Anatoli ...

Parallel for loop
There doesn't seem to be any EASY way of doing a parallel computation in Ruby. I would like to do something like this : array.map do |i| fork do i + 1 end end Process.waitall wich would give back the array with one added to each element in an array, and it would perform this "calculation" in parallel. However, this doesn't work since fork runs a subprocess which is another Ruby interpreter and I can't get anything back from that black hole, except some exit status. Actually, it would be really nice if there was a 'forkmap' method that could do this: ar...

while loop in a while loop
Hi All, I have the following situation: while(rs.next()) { //loop1 while(rs2.next()) { //loop 2 } } It seems like loop 2 is only beeing used once. Should I after loop2 put the cursor back to the beginning? if so, how do I do that? Thanks! -- Posted by news://news.nb.nu Steven wrote: > Hi All, > > I have the following situation: > > > while(rs.next()) { //loop1 > > while(rs2.next()) { > //loop 2 > } > > } > The architypal loop (for a List eg ArrayList of Blah objects) is: for(It...

How can I exit a while loop while it is running if a button is pressed mid loop.
I have an acquisition loop reading data from a serial port. Because the timing of the signal can vary between a couple per second and one every few hours I have set the timeout to be hours. What this seems to have resulted in is that each time I press stop to end the program the loop is still waiting for the next value to be put onto the buffer before carrying out the rest of the loop and then stopping. With the next value going into the buffer being possibly three hours away it waits all this time before it completes the loop and stops. Is there any way to override everything else in the ...

Web resources about - How to run while loops in parallel - comp.lang.labview

Parallel - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

The parallel universe of Donald J. Trump
Within days of the launch of Donald J. Trump's presidential campaign last June, he entered a parallel universe of his unique creation – a universe ...

The parallel universe of Donald J. Trump
Within days of the launch of Donald J. Trump's presidential campaign last June, he entered a parallel universe of his unique creation &ndash; ...

Buy Parallels
Starting today, Parallels is offering a new bundle for a limited time that will let you get 81% off 7 great Mac apps with the purchase or upgrade ...

Explore parallel worlds in Abandoned: The Underground City
... through the scenes, pick up items, and obtain clues. Unlock different locations to explore and search for the secrets behind this hidden, parallel ...


The S&P's eerie parallels to August
Stocks haven't done much in a while, and that could create some concerning questions for historically minded traders.

Scandal over South African president draws Nixon parallel
JOHANNESBURG (AP) — Speaking in an old fort and prison from South Africa's era of white domination, a former anti-apartheid leader hinted that ...

Trust and Democracy: The Odd Parallels between Trump and Apple
... Apple in its fight against the FBI and Justice Department wouldn’t be caught dead voting for Trump. And yet Apple’s position has some odd parallels ...

Trade Policy Parallels
It’s not surprising at all, I think. Both Bernie and Trump belong to the rebels, the outsiders. The establishment on both sides is trying to ...

Resources last updated: 3/29/2016 12:06:17 AM