03-04-2016 12:45 PM
Friday evening
Thanks James !
03-04-2016 12:46 PM - edited 03-04-2016 12:52 PM
@Pavel_47 wrote:Hello,
Upon VI start undesired action occurs - value Polarization[i] is memorized in flip-flop (please, see the screenshot below).
Does exist some tecjnique, that allow to desactivate a connection (red cross on screenshot) during some instants upon VI start.
Thanks in advance
Pavel
OK Pavel, You gotten some usefull tips however, most of them are a bit convoluted. Sorry Guys- nice tries all around but, Lets do a minimal and robust initialization of that there SR. What we really need is a way to garuntee that the output of the less than function is False when i=0. the rest of the code works just fine unless the USR feeding the wire at probe 4 has stale data from a previous run.
Simply wire a NaN constant to the input SR and thats all that is needed!
Explaination: NaN is a bit unique- it is "Not A Number" so, it is not less than any number, it is not greater than any number, it is not equal to any number, Heck, it is not even equal to itself! so, you get that False into the boolean crossing garunteed when i = 0 and are ready to detect the desired transition.
03-04-2016 12:50 PM - edited 03-04-2016 12:59 PM
@JÞB wrote:OK Pavel, You gotten some usefull tips however, most of them are a bit convoluted. Sorry Guys- nice tries all around but, Lets do a minimal and robust initialization of that there SR. What we really need is a way to garuntee that the output of the less than function is False when i=0. the rest of the code works just fine unless the USR feeding the wire at probe 4 has stale data from a previous run.
Simply wire a NaN constant to the input SR and thats all that is needed!
That's what I tried to get him to do with "You should also initialize that value in front of the loop anyways. If you set the initial value to "Inf", the Greater Than operator will always be false, right?" in my first reply.
Also, when he implemented the First Call code above, that results in the same thing your solution suggests, but he said that didn't fix his problem. I don't think his only problem is the boolean value there, maybe it's the express VI that needs a few iterations to level out.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
03-04-2016 01:06 PM
Simply wire a NaN constant to the input SR and thats all that is needed!
Thanks Jeff.
Just tried it. Doesn't work.
03-04-2016 01:09 PM
Pavel, if you want to get to the root of this problem, share your code. The "above index 13" solution isn't really a good solution.
Probe the code elsewhere and find out what isn't fully initialized when i=1, or i=2, or i=12.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
03-04-2016 01:23 PM
@James.M wrote:
@JÞB wrote:OK Pavel, You gotten some usefull tips however, most of them are a bit convoluted. Sorry Guys- nice tries all around but, Lets do a minimal and robust initialization of that there SR. What we really need is a way to garuntee that the output of the less than function is False when i=0. the rest of the code works just fine unless the USR feeding the wire at probe 4 has stale data from a previous run.
Simply wire a NaN constant to the input SR and thats all that is needed!
That's what I tried to get him to do with "You should also initialize that value in front of the loop anyways. If you set the initial value to "Inf", the Greater Than operator will always be false, right?" in my first reply.
Also, when he implemented the First Call code above, that results in the same thing your solution suggests, but he said that didn't fix his problem. I don't think his only problem is the boolean value there, maybe it's the express VI that needs a few iterations to level out.
Actually the +inf isn't quite as robust ~~~~eh. Depends on the Data Processing Algorithym and the comparison type. The NaN is a bit more universal - Splitting hairs- Regardless I bet there is a much simpler solution using min/max and a NaN initialized SR
03-04-2016 01:43 PM
@James.M wrote:Pavel, if you want to get to the root of this problem, share your code. The "above index 13" solution isn't really a good solution.
Probe the code elsewhere and find out what isn't fully initialized when i=1, or i=2, or i=12.
Hmm.. I considered that problem is already resolved.
But Ok, here is the code
03-04-2016 02:37 PM
I've run your code and I don't see any difference in functionality whether I change the value of 10 comparison or leave it as you have it. The chart still shows the dips like you showed above. What exactly does the value of 10 fix??
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
03-04-2016 02:48 PM
James,
After starting VI the next action is click on "RUN".
Without "startup modification" algorithm misses external loop on X quasi immediately passing to external loop on Y (FYI intenal loop - Z).
With startup precaution it works correctly.
According to your screenshot you didn't click on "RUN"