Average Calculation in Info Window

Discussions and questions about Signal issues not covered above
Grant Rowe
Posts: 10
Joined: 01 Sep 2021, 04:13
Contact:

Re: Average Calculation in Info Window

Unread postby Grant Rowe » 12 Apr 2022, 21:32

The XY trend plot in our configuration has frame number as the X coordinate and peak-peak amplitude between cursor 1 and 2 for the Y coordinate. All frames are included in the trend plot.

User avatar
Tim Bergel
Site Admin
Posts: 2379
Joined: 19 Jun 2008, 14:40
Location: Cambridge, England
Contact:

Re: Average Calculation in Info Window

Unread postby Tim Bergel » 13 Apr 2022, 12:10

Oh yes ... it does that here too. It turns out there was a stupid error in my code, the line "var first% := pts% = last_n;" was incorrect as it was comparing pts% with last_n (the equals sign), not subtracting last_n from pts% as I intended. And I completely failed to see this when I posted the code fragment yesterday...

I have checked the script more carefully and am pretty sure the new version is working correctly.
Attachments
ontrendavg.sgs
With corrected arithmetic
(3.18 KiB) Downloaded 9 times
Tim Bergel Cambridge Electronic Design

Grant Rowe
Posts: 10
Joined: 01 Sep 2021, 04:13
Contact:

Re: Average Calculation in Info Window

Unread postby Grant Rowe » 14 Apr 2022, 11:07

Hi Tim,

The updated script works perfectly :-)

Thank you so much for helping with this.

It’s greatly appreciated

Kindest regards,

Grant Rowe


Return to “General”

Who is online

Users browsing this forum: No registered users and 1 guest

cron