LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable connection upon VI start

Solved!
Go to solution
Highlighted

Friday eveningSmiley Happy

Thanks James !

0 Kudos
Message 11 of 19
(711 Views)
Highlighted

@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

 

disable_connection_upon_start.JPG


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.Smiley Wink  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. 

"Should be" isn't "Is" -Jay
0 Kudos
Message 12 of 19
(707 Views)
Highlighted

@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.Smiley Wink  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>   ---'

0 Kudos
Message 13 of 19
(702 Views)
Highlighted

Simply wire a NaN constant to the input SR and thats all that is needed!

Thanks Jeff.

Just tried it. Doesn't work.

0 Kudos
Message 14 of 19
(688 Views)
Highlighted

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>   ---'

0 Kudos
Message 15 of 19
(682 Views)
Highlighted

@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.Smiley Wink  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 SRSmiley Wink

"Should be" isn't "Is" -Jay
Message 16 of 19
(675 Views)
Highlighted

 

@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

Download All
0 Kudos
Message 17 of 19
(667 Views)
Highlighted

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??

Testbend Operation.PNG

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'

0 Kudos
Message 18 of 19
(657 Views)
Highlighted

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"

 

0 Kudos
Message 19 of 19
(652 Views)