LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to set or initialize the integration constant in integral x(t).vi

when integrating by the integral x(t).vi, the output is always getting shifted by the constant...... how can we set the integration constant to 0?? .....thanx....

0 Kudos
Message 1 of 22
(3,254 Views)

Hello,

 

and thank you for posting here.

 

Coud you give me more details please? Where did you find your x(t).vi? Could you post your VI?

 

Regards,

Jérémy C.
NI France

0 Kudos
Message 2 of 22
(3,246 Views)

integral x(t).vi is in the mathematics sub palette.....

details about my code is not an issue now.... i am not even getting the right answer wen i integrate a sine wave..... i should get the negative cosine wave... but its getting shifted by a constant.... i read bout the integral x(t). vi and that it gives the definite integration.... and therefore the constant is also taken into account... my question is how to set that the constant to 0 or any value of our choice????

 

0 Kudos
Message 3 of 22
(3,240 Views)

I suppose that you noticed that integral x(t).vi is for discrete integrations. Depending on the values you have connected to the inputs, results will be different. It is the reason why I'm asking you to post your VI (or a small part) in order to see the implementation of you VI.

 

Regards,

Jérémy C.
NI France

0 Kudos
Message 4 of 22
(3,235 Views)

I have attached a copy of my code and in this case i am not even getting a cosine wave after integration( i atleast got a cosine wave after integration wen i used the sine function from the trigonometric subpalette).

I am acquiring a sine wave from an oscilloscope and storing it in a text file.

the first column is time and the second column is voltage.

It acquired data at 4 instants, therefore there r 8 columns in the text file attached.

now i want to integrate the voltage values.

So i extracted the first 2 columns for integration calculation.

 

can u please help me out with this??

 

Download All
0 Kudos
Message 5 of 22
(3,229 Views)

I suspect the issue is the format string.  The data in the text file has a comma for the decimal separator. The Read from Spreadsheet File VI expects period as the decimal separator unless you tell it otherwise.  Try "%,; %.12f" (without the quotes) as the format string. the %,; part tell ist to use the comma as the decimal separator.

 

Lynn

0 Kudos
Message 6 of 22
(3,216 Views)

 

 The format string is not the issue. I used %.12f only as the format string.

Besides the data in the text file itself was saved through the write to spreadsheet file.vi from an oscilloscope.

 

0 Kudos
Message 7 of 22
(3,205 Views)

The text file you posted has comma separators:

0,000120000000	-0,043750023360	0,000130000000	

It does not matter how the file was saved.  The format of the file does matter.  I think the Read from Spreadsheet File.vi uses period separators unless you tell it otherwise.  Your system settings are not used by this VI.

 

When I tried the format string I posted earlier it read the file fine.  With your format string it does not work. Have you tried it?

 

Lynn

0 Kudos
Message 8 of 22
(3,200 Views)

Hi,

 

I think what Jhonsold told is correct. Kindly have a look on the attached VI.

 

Regards,


Nitzz

(Kudos are always Welcome, Mark as a solution if it is the One;))

0 Kudos
Message 9 of 22
(3,192 Views)

 

with "my format string" ?

The code that i posted has the %.12f as the format only.

Besides if write to spreadsheet.vi saved it in that format then, obviously read from spreadsheet.vi can read the same format.

And yes, i tried it. again its there in the posted code.

When i plot the data from text file on a graph, it shows a sinewave, which is correct,  since that is wat i acquired form the oscilloscope.

But wen i integrate it with the integral x(t).vi i dont get a minus cosine wave. so the problem is not in the format string.

0 Kudos
Message 10 of 22
(3,191 Views)