LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

possible architectural problems..can anyone help?

Hello,
I have written a code to control a stepper motor but there seems to be problems with it. The while loop is iterating very slow and it has to be faster to be useful. I'm guessing that there are some problems with the way I wrote the code and I can't sort it out.Can anyone help me?

0 Kudos
Message 1 of 6
(3,099 Views)
Hi,

yes, you have an issue with your "architecture".
Here some hints:
1. Blockdiagram is way too large. Keep it in a size of one screen (not everyone has a 40" monitor!)
2. You should not use local variables (except of some exceptions)
3. You should not use sequence structures (except of some rare exceptions)
4. You should wire from left to right, so data sources should be placed in the left, sinks in the right.
5. Keep your wires unbended if possible and don't cross them unneccessarily.
6. Create proper symbols for your VIs to increase readability of the sourcecode.
7. Maybe you should choose an architecture with parallel loops in order to split execution from UI handling. See the templates installed with LV in the Templatebrowser for this (File >> New).

hope this helps,
Norbert


Message Edited by Norbert B on 07-28-2008 03:21 AM
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 6
(3,087 Views)
Hi Norbert,
Thank you for your reply.

I'm now trying to solve the problems you addressed- but I couldn't understand how to replace the sequence structure with something else.Maybe I can simply remove it, but then how can I make the 2 seconds delay between the subVIs?

0 Kudos
Message 3 of 6
(3,073 Views)

Hi otceliker,

you can use a state diagram architecture. Use shift register to store your values. You can create cases with a wait in it.

Mike

Message 4 of 6
(3,067 Views)
Well I'm trying to sort out the problems now,thank you all for helping..but I have a final question: how can I make my loop iterate faster?is it a performance issue,or can it be specified?
0 Kudos
Message 5 of 6
(3,034 Views)
You specify the loop-iteration timing with the timing functions, your waitfunctions. If you have no timing included, the loop will execute as fast as possible if not slowed down by event-driven programming like waiting for a certain number of samples in your DAQ-part.....

Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 6
(3,027 Views)