NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
samerham1
Posts: 103
0 Kudos

build a function

Hi,

I need to build a function of time that has the shape below

How could i do that ?

and how could i make a repetition of this function as long as the time goes on ?

Thx
Samer,
Proven Zealot
MikeS81
Posts: 5,371

Re: build a function

Hi Samer,

you can use the build waveform vi´s to create this shape. Or do you have a formula of it? What do you mean with "as long as the time goes on"?

Mike

Member
samerham1
Posts: 103
0 Kudos

Re : Re: build a function

Hi MikeS81,

To answer your questions:

do you have a formula of it?
i don't have a formula of the shape; i want to obtain this shape by specifying couples (y,t) and then i'll have an extrapolation between the points. does build waveform do that ?

What do you mean with "as long as the time goes on"?
I mean how to make it periodic ?


Samer,
Proven Zealot
MikeS81
Posts: 5,371

Re: Re : Re: build a function

Hi Samer,

to draw exactly this shape you can also use a xy graph, but if you need the values you should use a waveform graph. Create an array of your values and use the build waveform function. To make it cyclic, you should use a loop.

Mike

Knight of NI
Posts: 18,064
0 Kudos

Re: build a function

Where is this waveform being used? Are you trying to have it generated by a DAQ board? Are you performing some form of software signal analysis?

A graph will not perfom "interpolation". It plots points, and connects the points. Likewise the "Build Waveform" does not do interpolation. It creates a waveform datatype from the data that you supply. You provide a starting time, a delta t, and the array of Y values.
Member
samerham1
Posts: 103
0 Kudos

Re : Re: build a function

Where is this waveform being used? Are you trying to have it generated by a DAQ board? Are you performing some form of software signal analysis?

I just need to build a waveform and make it cyclic...i don't have a DAG board and i am not doing signal analysis ...What i want is more simple than that:smileywink:

I made an array as an input of a for loop then i used "buil a waveform",
inside the loop, to associate the time to the input values.
At the end a wafeform grah shows me the values in function of time
Samer,
Knight of NI
Posts: 18,064

Re: build a function

OK. So I'm confused now. Do you have what you want, or not?
Knight of NI
Ray.R
Posts: 10,165
0 Kudos

Re: build a function

I thought I was the onlyone who was confused.. :smileywink:
 
.
(starting to) See Life in a brand new way...

b* ^ )
Active Participant
ceties
Posts: 538
0 Kudos

Re: build a function

He is just doing homework I guess. Something similar they gave us when I started couple years ago with LabVIEW. The aim is to create a function that has as input time (or iteration) and it returns actual position of the function. According to what you draw you have to use 'Quotient & Remainder' function and devide the input to five intervals. The reminder is your actual interval. For each interval you specify now it's 'shape'. I can help you with this but you have to provide coordinates of the shape you draw.
LV 2011, Win7
Active Participant
ceties
Posts: 538

Re: build a function

I believe this is close to what you wanted.
LV 2011, Win7
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page