From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable connection upon VI start

Solved!
Go to solution

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

0 Kudos
Message 1 of 19
(4,413 Views)

You can't disable a connection, but you can change the data depending on circumstances. There's a function called "First Call?" that you can use to manipulate that boolean. Maybe you want to value to be False if First Call? is true? Then put an operation like: If True and First Call Not True.

True And Not First Call.png

 

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?

Cheers


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

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


0 Kudos
Message 2 of 19
(4,407 Views)

Thanks James,

 

Thanks.

I've tried your suggestion - unfortunately flip-flop still actions due to a "glitch" upon VI start.

 

 

disable_connection_upon_start (2).JPG

 

0 Kudos
Message 3 of 19
(4,391 Views)
Apply the same logic as above somewhere else in your code to ignore the flip flop then. Like done graph point if first call. Or use a default value if first call.

Cheers


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

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


0 Kudos
Message 4 of 19
(4,386 Views)

I've added 2nd condition (on comparator input), also added default value on SR.

Unfortunately problem persits

 

disable_connection_upon_start (3).JPG

0 Kudos
Message 5 of 19
(4,375 Views)

Well you're setting a default value of Zero to be graphed when first call... so you're going to see a value of zero on your graph. If you don't want to graph on first call, put a case strcture around your indicator terminal so that it is only written to when First Call is False.

 

Your Select function with the First Call value as the input and boolean as the output is redundant. Use a Not operator if you want to negate the value.

Cheers


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

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


0 Kudos
Message 6 of 19
(4,369 Views)

@James.M wrote:

Well you're setting a default value of Zero to be graphed when first call... so you're going to see a value of zero on your graph. If you don't want to graph on first call, put a case strcture around your indicator terminal so that it is only written to when First Call is False.

 

Your Select function with the First Call value as the input and boolean as the output is redundant. Use a Not operator if you want to negate the value.


I changed employment of the "First Call" according to your concept.

Concerning indicator, it isn't so important, the most important - prevent flip-flop memorize the value when VI starts as it's dramatically changes algorithm functionnality

 

disable_connection_upon_start (4).JPG

0 Kudos
Message 7 of 19
(4,358 Views)

So what's your problem still? Do you need to put a case structure around that VI for the first call?

 

Pavel, remember, you have all of the tools you need to solve your problem. I think you're really lacking in the fundamental understand of how LabVIEW functions and its abilities. I've told you this before: I highly suggest you watch some free tutorials to better get your bearing.

"Give me six hours to chop down a tree and I will spend the first four sharpening the axe."  - Abraham Lincoln

 

Here are some free training tools primarily focused on LabVIEW and NI hardware to help get started.

NI Learning Center

NI Getting Started

-Hardware Basics

-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)

-LabVEW Basics

-DAQ Application Tutorials

-cRIO Developer's Guide

Learn NI Training Resource Videos

3 Hour LabVIEW Introduction

6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training

Cheers


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

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


0 Kudos
Message 8 of 19
(4,344 Views)

Well, here is the solution that works.

Thanks.

 

disable_connection_upon_start (5) - working.JPG

0 Kudos
Message 9 of 19
(4,329 Views)
Solution
Accepted by Pavel_47

What the heck....? You're adding "i" to itself exponentially and comparing that to 100... So every time, your code is going to look like this:

0 + 0 = 0 < 100

0 + 1 = 1 < 100

1 + 2 = 3 < 100

3 + 3 = 6 < 100

6 + 4 = 10 < 100

10 + 5 = 15 < 100

15 + 6 = 21 < 100

21 + 7 = 28 < 100

28 + 8 = 36 < 100

...

91 + 14 = 105 > 100

 

This is rediculously round-about. If this reeeaaally works for you, just set the logic to "AND i > 13"

Cheers


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

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


Message 10 of 19
(4,321 Views)