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.

VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

trianglewave with curved edges in stimulus profile editor

Hello,

i use the TriangleWave from the Real-Time Sequence Library for my stimulus profile. Is there any way to curve the edges of this TriangleWave?

 

Is there any filter in the Stimulus Profile Editor i can use for this problem?

 

I hope you can help me. 🙂

With best regards Thomas

0 Kudos
Message 1 of 10
(5,279 Views)

The triangleWave is a sequence file.  You can open it like any other nivsseq file and edit it to make it do what you want.  Just save it under a different name.

0 Kudos
Message 2 of 10
(5,274 Views)

FYI there are some example sequences with advanced alroithms here: https://decibel.ni.com/content/docs/DOC-22522

Stephen B
0 Kudos
Message 3 of 10
(5,253 Views)

Hello joshe,

 

thanks for your feedback. Can you tell me how I edit the code to get curved edges?

 

I found this Code Example for Matlab to get a triangle wave with curved Edges. Can you tell me how I edit this code to use it in the Stimulus Profile Editor?

 

clc;clear;close all
t = linspace(0,pi);
x = zeros(1,100);
m = 5;
c = 1;
n = (1:2:2*m-1);
for k=n
x(c,:) = x(c,:)+cos(k.*pi.*t)./k.^2;
end
plot(t,x)

 http://www.mathworks.com/matlabcentral/answers/58191-generate-triangle-input-with-curve-edge

 

With best regards Thomas

0 Kudos
Message 4 of 10
(5,246 Views)

hello StephenB,

 

in your posted example sequences there is unfortunately no triangle wave with curved eges, only the normal triangle wave.  

 

with best regards Thomas

0 Kudos
Message 5 of 10
(5,242 Views)

You would have to reconfigure the math functions in your script to operate point-by-point to produce the desired value. The Stimulus Profile Editor does not support array operations such as multiplication or linspace. This should be possible with time.

 

One quicker alternative that might work is to just export the data waveform you want to play back to a CSV file and then import it using an Imported Double Array Variable. Then you can play back the data as XY data however you like, including repeating the data.

 

Here is an example.

Jarrod S.
National Instruments
0 Kudos
Message 6 of 10
(5,235 Views)

Hello Jarrod S,

 

thanks for your feedback.

 

I can't use your files ->  PlayCurvedTriangle.nivsseq, PlayXY.nivsseq, RepeatXY.nivsseq

 

Is there a Problem with my old Veristand 2012 Version ?

 

2015_01_16_21_10_26_Stimulus_Profile_Editor.png

0 Kudos
Message 7 of 10
(5,229 Views)

Yes, these files were written in VeriStand 2014.

Jarrod S.
National Instruments
0 Kudos
Message 8 of 10
(5,225 Views)

You might try this. I removed the elements manually from the files that didn't exist in 2012. It might work now, but I don't have VeriStand 2012 handy to test.

Jarrod S.
National Instruments
0 Kudos
Message 9 of 10
(5,222 Views)

Thanks you for your support!

 

But now I can only open the PlayCurvedTriangle.nivsseq and Test.nivsstimprof.

 

I found a workaraund for my problem:

 

- add a custom user channel in the system definition file

- generate a standard triangle wave/ map the output to the custom channel  

- add a calculated channel with a lowpass filter and a cuteoff frequency of 1 Hz

- now the triangle wave on the calculated channel has curved edges Smiley Wink

 

Is there a possibility to use the lowpass filter in the stimulus profile editor?

 

0 Kudos
Message 10 of 10
(5,208 Views)