From Thursday, May 23rd (05:00 PM CDT) through Friday, April 24th (1:30 AM 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
Did you mean:

Solved!
Go to solution

calcuating continutiy in a data arary

I wanted to calculate the continuity in data array. And I used the following logic

C=0;

J=0;

A=[1 2 3 4 10 11 12 15 16 19];

B()=0;

For(i=0,i<=size of A ,i++)

{

If [A(i+1)-A(i)==1]

C=C+1;

Else

{

B(J)=C;

J=J+1;

C=0

}

}

My output should be

3

2

1

0

I tried to build this in Labview but i am facing problem if the “else” part of logic.

Kindly help me,

Message 1 of 7
(2,590 Views)

Re: calcuating continutiy in a data arary

Hi Rajesh,

Can you please explain what actually you are trying to achieve without providing your text based code?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
Message 2 of 7
(2,585 Views)
Solution
Accepted by Rajeshkumarc

Re: calcuating continutiy in a data arary

Hi Rajesh,

Please check the attached vi. I tried to build the logic you explained.

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
Message 3 of 7
(2,583 Views)

Re: calcuating continutiy in a data arary

Hi Rajesh,

Please check the attached vi. I tried to build the logic you explained.

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
Message 4 of 7
(2,582 Views)

Re: calcuating continutiy in a data arary

@danil33 wrote:

Hi Rajesh,

Can you please explain what actually you are trying to achieve without providing your text based code?

It seems to me a kind of homework application 🙂

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
Message 5 of 7
(2,577 Views)

Re: calcuating continutiy in a data arary

Hi Rajesh,

Use this vi to get all the continuities for your given data array.

Anand kumar SP
Senior Project Engineer
Soliton Technologies Pvt Ltd
Message 6 of 7
(2,564 Views)

Re: calcuating continutiy in a data arary

Thanks a lot for your support. . its working. .

Message 7 of 7
(2,534 Views)