graphing against systime()


Lockie

Recommended Posts

Hi 

I am trying to create a graph that begins at zero at a zero time stamp.  However when I change the graph x expression (in graph properties) from "time" to anything referencing "systime()" the trace disappears.

My approach was to use the start time from a button that runs the below code:

global expStartTime1 = systime() // Test Phase Timer
global expStopTime1 = 0
global GraphTime = Time()

and create a graph using the x expression "systime()-expStartTime1" (with bottom axis set to time and date).  I have tried heaps of things but it appears that when systime() is used I lose the data?

Any help would be really appreciated.

 

Link to comment
Share on other sites

You have the right idea, but the problem is that systime() - expStartTime1 is a scalar and you can't plot a single data point.  You need an array of times, and the best place for that is in your Y data.  So if your Y Expression is "MyChannel", your X expression would be "MyChannel.time - expStartTime1".

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.