09-15-2005 09:37 AM
09-15-2005 11:16 AM
09-16-2005 06:59 AM
09-16-2005 07:17 AM
09-16-2005 10:03 AM
09-16-2005 11:31 AM
@Robert_Schröder wrote:
I do not understand why a single wait statement supports CPU
A loop without a wait statement or other mechanism to slow it down will run as fast as it can, gobbling up all availalble CPU. It will typically spin many times for many milliseconds before releasing its hold so other processes such as front panel updates or parallel loops get their turn. You will notice that the FP controls and indicators might even get unresponsive for short periods of time. (In one of his blog entries, Joel Sumner explains that loops without a wait primitive will spin for 55ms before other loops that are ready to execute get a chance.)
Even a 0ms wait statement will allow everyhing to run smoother, because other processes can "interlace" after each iteration.
It really depends on how critical your loop speed is. It is probably sufficient to run e.g. 100x per second. If without wait it would execute10000x per second, a 10ms wait inside the loop will cause your application to consume only 1% of the CPU resources. This is a big difference!
Another reason is predictablility. Especially with instrument control, you don't want you application speed to be a function of computer hardware. It should run at a predictable speed on both a slow or a fast computer.
@Robert_Schröder wrote:
How exactly work those shift registers? How, other than sequence structure, can I guarantee, that some blocks are executed one after the other ("Menü" first), but some ("Not-Aus") can always interrupt and execute?
Dataflow dictates that
This makes it easy to force execution order using wires. (See below)
Many of your controls (e.g. the one mentioned above) use fixed starting values. They get set from the output of the subVI and are then used as input somewhere else. Whatever you change on the FP has no effect, because it will get overwritten by the code anyway.
@Robert_Schröder wrote:
I thought I use controls for starting values, which can be transfered to the executing subs, but easily changed through the use of variables. Is this possible with direct wire?
Of course it looks a bit messy at the moment. Yo should probably rearrange things for a more suitable layout. More comments are on the block diagram in yellow.
Local variables should be avoided if possible because:
09-16-2005 06:08 PM
Let me know if you have any questions! 😄
Good luck with your project. Modify as needed. (I cannot test, because I don't have your dlls and hardware. There are probably a few bugs left).
10-06-2005 06:44 AM
Thanks, great help there.
I did some more, but I want to know if I have understand it correctly with dataflow 1-2-3-4-5 and those arrays.
10-06-2005 10:29 AM
Yes! It looks very nice now! 🙂
One little thing. You could avoid the sequence structure [2] if you would wire the outputs from the two FOR loops through the two cases of case structure [3]. This creates a data dependency that naturally forces case [3] to wait until everything in the sequence structure has finished. Still, a single frame flat sequence is not bad and maybe helps in the diagram readbility because it provides some structuring. I would leave it as is. 🙂
Also remember the highlight execution debugging tool. Press the light-bulb button and run the VI while watching the diagram. You see exactly how things execute. Good luck!