12-19-2007 11:01 AM - edited 12-19-2007 11:03 AM
Hi everybody,
I'm programming a LabVIEW code to connect to an Agilent Multimeter (model 34405A) to measure electrical continuity.
The code is very simple, but unfortunately the multimeter sends me measurements in different time periods. I guest this behavior is caused by the multimeter internal trigger, but I'm not sure... I observed that the synchronization problem is caused during the frame labed with Block 1. This block spends different periods of time to run in ms (40, 60, 80, 40, 50...). The block 2 always runs in 12 ms. The overall while seem synchronization problem too..
I'm trying to force the measurement cycles run always with the same period (greater than requests and transfer measurements). So, I'm using the Wait Until Next ms Multiple to fix the period of time of Block 1 and the period of the entire loop, but it's not working...
Could anyone send a idea?
This is my code:
Thanks in advance.
12-19-2007 10:03 PM
12-19-2007 11:16 PM
No, don't add any extra sequence frames, that's not the problem!
You problem is purely mathematical. 🙂 Wait next ms multiple does exactly that, it waits until the tick count is an integer multiple of 80 ms.
The problem is that 500 ms is NOT a multiple of 80, meaning that the two waits interact in an unwelcome way.
Lets say for simplicity the tick starts at zero.
Iteration 1:
Frame 1 ends after 80ms (tick=80, 1x80) and the loop will finish after 420 more ms, when the outer wait reaches a multiple of 500 (tick=500).
Iteration 2:
Frame 1 ends at the next multiple of 80, this is at tick 560 (7x80!), meaning the first frame only takes 60ms! Loop iteration completes at tick=1000.
Iteration 3:
Frame 1 ends at tick 1040 (13x80), now the first frame only lasts 40ms! Loop completes at tick 1500.
etc.
The wait for the first frame will change in a regular sawtooth pattern between 80 and 0ms!!!! (80ms, 60ms, 40ms, 20ms, 0ms, 80ms, 60ms, ... etc)
You need either...
Makes sense? 🙂
12-20-2007 07:20 AM - edited 12-20-2007 07:23 AM
Thanks ShotSimon, I think you solution will work too!!!
Hey Altenbach, you are my fan mentor!!!
I have being problems with Wait Until Next ms Multiple for a long time because the LabVIEW help doesn't seem clear enough about this function!!
Your explanation was great (thanks for your time!). You said exactly what happens with the time inside the Frame 1: 80ms, 60ms, 40ms, 20ms, 0ms, 80ms, 60ms. Finally I understood what the "tick" means and it does make sense.
Thanks a lot, Altenbach.
I uploaded two examples to indicate the synchronization problem related to "tick iteration":
Example 1 (Frame 2 is multiple incompatible with the Wait function outside the frames):
Example 2 (Wait function inside the Frame 2 is multiple with the one outside. Note that the time of execution of Frame 2 is 40ms = 50ms - 10ms (of Frame 1) and the iteration time is 500 ms:
12-20-2007 08:41 AM
12-20-2007 11:04 AM