Tarik Posted November 29, 2016 Share Posted November 29, 2016 Hello Azeotech I currently have a plot of strain vs force on Page 0 and was looking to add some buttons to this page it to make everything user friendly. I need to create buttons on this page that can start my graph plot, stop my graph plot, clear the trend of the plot, log the data to the plot and save the plot. I currently have made the buttons but I do not know what the exact quick sequence would look like to do the actions I need. I was hoping to get directed to a link with the available functions that can support what I am trying to do. Thank you for your time in advance, Tarik Link to comment Share on other sites More sharing options...
AzeoTech Posted December 1, 2016 Share Posted December 1, 2016 It actually requires a little more than just a function call. What you want to do is create two global variables to hold the start and stop time of the graph. You can create an auto-start sequence to declare them, or do it in the button for Start. So, assuming the second, the script might be: global st = systime() global et = st*2 then in your graph, have it subset on time: myStrainChannel[st,et] vs. myForceChannel[st,et] That way only data between the start time (st) and end time (et) will be plotted. We set et to twice st so it plots new data coming in. To stop the plot, we set et to the current time: et = systime() That way any new data will be after et, and won't appear. I don't know what you mean by log the data to the plot, but to save the plot, create an export set where the two items are the same as the trend expressions (myStrainChannel[st,et], etc) and have the button start the export set. Link to comment Share on other sites More sharing options...
Tarik Posted December 12, 2016 Author Share Posted December 12, 2016 Thanks for the help! I made buttons for start and stop with those two corresponding pieces of code you described in your response. I was a little confused on how to start/stop an export set using a button specifically the start and stop button that is mentioned earlier. I saw the option to make a logging set in the logging tab that can log my strain and force data and I was wondering if I could start/stop that log using the same start/stop button for my plot? Link to comment Share on other sites More sharing options...
AzeoTech Posted December 13, 2016 Share Posted December 13, 2016 Sure, but a logging set is continuous logging, so you'd have to start the logging set with the experiment start, and stop it when it stops. Really an export set is better suited for this since the exact start and stop point of a logging set can vary by as much as 1 second. Anyhow, you can use: beginLogging(myLog) and endLogging(myLog) script statements to do what you want. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.