Jump to content

While Loop Trouble


Recommended Posts

Hi.

I am programming a VI that mainly consists of three while loops:

(1) The main while loop takes input from a java program (TCP/IP) manipulates the data and puts it in the queue.

(2) The second while loop deques elements and sends it to an electric motor.

(3) The third while loop gets input (meassurements) using the DAQ Assistant express VI and sends it to the java program (Also TCP/IP, different port).

Developing this program I first made two while loops, (1) and (2), and it executes well in paralell. Then I added the last (3) while loop for meassurements and it won`t execute. Not untill i press the stop button for the first (1) while loop. But I want all three to run in paralell.

I`m using the "Wait Until Next ms Multiple" VI with 50 ms in all the three while loops. I do this because the sampling period from the java simulator is 50 ms.

Any suggestions to what might cause the last (3) while loop not to run will be greatly appreciated. Thank you.

Link to comment

QUOTE (jjylf @ Jun 24 2008, 10:58 AM)

Hi.

I am programming a VI that mainly consists of three while loops:

(1) The main while loop takes input from a java program (TCP/IP) manipulates the data and puts it in the queue.

(2) The second while loop deques elements and sends it to an electric motor.

(3) The third while loop gets input (meassurements) using the DAQ Assistant express VI and sends it to the java program (Also TCP/IP, different port).

Developing this program I first made two while loops, (1) and (2), and it executes well in paralell. Then I added the last (3) while loop for meassurements and it won`t execute. Not untill i press the stop button for the first (1) while loop. But I want all three to run in paralell.

I`m using the "Wait Until Next ms Multiple" VI with 50 ms in all the three while loops. I do this because the sampling period from the java simulator is 50 ms.

Any suggestions to what might cause the last (3) while loop not to run will be greatly appreciated. Thank you.

Hi jjylf,

Can you post a screen shot of you main diagram (the one with the 3 while loops), it sounds like there is a dependance between loop 1 and 3, that could explain the behaviour you described.

Hope this helps

Link to comment

QUOTE (Antoine @ Jun 24 2008, 10:04 AM)

post-11832-1214298944.jpg?width=400

The stop button in loop (1) is connected to the stop in loop (3). That is the only dependence I can think of.

QUOTE (jjylf @ Jun 24 2008, 10:18 AM)

The stop button in loop (1) is connected to the stop in loop (3). That is the only dependence I can think of.

Hi.

I removed the stop button connection, and it worked. Thank you very much! :D

Link to comment

QUOTE (jjylf @ Jun 24 2008, 11:21 AM)

If you execute in highlight mode you will see why it can't work :)

QUOTE (jjylf @ Jun 24 2008, 11:21 AM)

I removed the stop button connection, and it worked. Thank you very much!
:D

You're welcome :)

There are different way of stopping several loops with only one button, do you need help on this ?

Link to comment

QUOTE (Antoine @ Jun 24 2008, 12:10 PM)

If you execute in highlight mode you will see why it can't work :)

You're welcome :)

There are different way of stopping several loops with only one button, do you need help on this ?

I`m now using a local Variable. I don`t think that will cause problems.

Thanks again.

But I`ve got a problem with everything running very slow. I want the loops to execute at 20Hz, but when I run it only executes at about 1-2Hz.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.