PeterB Posted March 15, 2006 Report Share Posted March 15, 2006 Hi there, while running a timed loop I would like to change its mode by wiring a mode enum control into the RHS data node of the Timed Loop. The Timed Loop does not seem to change its behaviour (let alone report the new mode) when I do this. Any ideas why? thanks Peter Badcock Product Development ResMed Ltd. Download File:post-1272-1142390859.vi Download File:post-1272-1142390871.vi Quote Link to comment
Ton Plomp Posted March 15, 2006 Report Share Posted March 15, 2006 Hi there,while running a timed loop I would like to change its mode by wiring a mode enum control into the RHS data node of the Timed Loop. The Timed Loop does not seem to change its behaviour (let alone report the new mode) when I do this. Any ideas why? thanks Peter Badcock Product Development ResMed Ltd. I've had no problem running you're example (8.0.1), the only thing you have to remind is that you can't initialize with 'no change' setting this kills you're loop BEFORE the first run. (error -820) Ton Quote Link to comment
birenshah Posted March 15, 2006 Report Share Posted March 15, 2006 Peter: Supply an offset along with the change in mode. See the shipping example. biren Quote Link to comment
PeterB Posted March 16, 2006 Author Report Share Posted March 16, 2006 Peter:Supply an offset along with the change in mode. See the shipping example. biren Hmmm.... well adding the offset in gets me a step closer, but I must say that I could find NO evidence of needing to do this in any example (could you list the specific example Biren?) nor in any of the LV Help literature. Moving on however, when I did add the mode on the RHS datanode (see attachment Timed Loop Test v0.1.2.vi), and select a new mode, the loop dt goes from 1000ms to 0mS ! i.e. it iterates VERY fast, and because timed loops are high priority, the vi takes a while to recognise any stop buttons on the FP. OK admittedly I have no code in the timed loop to actually consume additional CPU clock cycles, but this behaviour is rather weird. So while adding in the offset did answer my original question, it highlights a new unexplained behaviour. Moving on to a more real life example, check out the next vi "Timed_Loop_Test_v0.2.1.vi". The delay being called inside this timed loop is programmed to finish late every 4th iteration. Now run it, then simply change the "Subsequent Mode" from 'No Change" to "Process missed periods, maintain original phase" and the Expected Start and End times drop down to 0 and 500ms respectively ! Rather weird. regards Peter Download File:post-1272-1142469841.vi Download File:post-1272-1142469854.vi Quote Link to comment
PeterB Posted March 16, 2006 Author Report Share Posted March 16, 2006 I've had no problem running you're example (8.0.1), the only thing you have to remind is that you can't initialize with 'no change' setting this kills you're loop BEFORE the first run. (error -820)Ton I am running 7.1.1, if you have got it working then maybe v 8.0.1 doesn't require the offset to be simultaneously set as Biren suggests. Anyway, I updated the examples and they now run for me under v7.1.1 but with some interesting behaviour as noted in the reply here . regards Peter Quote Link to comment
PeterB Posted March 17, 2006 Author Report Share Posted March 17, 2006 So while adding in the offset did answer my original question, it highlights a new unexplained behaviour. Biren has now solved the unexpected behaviour for me by pointing out that .. "when you change the offset you should be supplying an offset into the future and not 0. If I am changing the offset I usually add the expected start to period to get the new offset" This now makes sense and works OK Download File:post-1272-1142563359.vi If only NI had shown me this by way of example it would have clicked much sooner for me. Even though Biren had suggested that examples are available in LV 7.1, none of them contain a timed loop with the mode and /or offset wired up from inside the loop. There's also no indication of how to properly effect a mode change in the LV user manual - other than to say "To set the mode, right-click the Mode input terminal of the Right Data Node and select Create Quote Link to comment
birenshah Posted March 20, 2006 Report Share Posted March 20, 2006 I checked the documentation and realized we added examples in LV 8.0 and thats why you can't find it on your system. Here is a link to some 8.0 documentation. Most of it is applicable to 7.1.1 except the part where you can add frames to your timed loop. http://zone.ni.com/devzone%5Cconceptd.nsf/...6256E3700560052 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.