goldfronts1 Posted March 8, 2012 Author Share Posted March 8, 2012 I'm referring to your post#19 where you state "You can plot it against integral time by setting a variable with the start time and subtracting it from the absolute time. There are a number of recent posts on this forum about doing graphs against dt instead of absolute t." I am trying to plot against the integral time, new_time. I have a conversion on this called dt. Thanks Link to comment Share on other sites More sharing options...
AzeoTech Posted March 8, 2012 Share Posted March 8, 2012 Sorry, missed that. You'll need to set new_time to a streamed channel, say 2 or 3, unless you changed StartStream. You'll still need to initialize starttime. You can then plot vs new_time/60 to get it in minutes. Link to comment Share on other sites More sharing options...
goldfronts1 Posted March 8, 2012 Author Share Posted March 8, 2012 I'm not sure how to initialize startime? So in my StartStream I just need to add a stream again for channel 2, right? For the plotting is it just new_time/60 or (new_time.time - startTime) / 60? Thanks Link to comment Share on other sites More sharing options...
goldfronts1 Posted March 8, 2012 Author Share Posted March 8, 2012 Also the error I was getting before had to do with my conversion dt. Something to do with the GetTime.(Value) Thanks Link to comment Share on other sites More sharing options...
AzeoTech Posted March 8, 2012 Share Posted March 8, 2012 Yes, add a stream channel for the new_time channel. You might also add /60 to your conversion to have it in minutes from the start. You should not - starttime in your graph because you are already subtracting it in the conversion. I doubt you get an error from getTime(value). Conversions don't usually generate error messages, they just don't convert. Link to comment Share on other sites More sharing options...
goldfronts1 Posted March 8, 2012 Author Share Posted March 8, 2012 Ok. Is it (new_time.time)/60 or (new_time)/60 ? Thanks Link to comment Share on other sites More sharing options...
AzeoTech Posted March 9, 2012 Share Posted March 9, 2012 again, think concepts: new_time contains the dt that you calculated and is the value you want to plot, whether you divide by 60 or not. new_time.time is the time stamp for when you set the value. Link to comment Share on other sites More sharing options...
goldfronts1 Posted March 9, 2012 Author Share Posted March 9, 2012 I am getting an error message C1013. Attached The integral time in my x-axis is just a constant number in the table. I have new_time/60 in the x-axis expression. Also the int_v2 data is not consistent to what I am getting if I do the integral by hand. I think this is something to do with the time range that the integral is taking. It should just be from the start of the voltage2 channel time to the stop time. I hope this is not confusing Thanks Link to comment Share on other sites More sharing options...
goldfronts1 Posted March 9, 2012 Author Share Posted March 9, 2012 Attached is my .ctl Setup4_2_.ctl Link to comment Share on other sites More sharing options...
goldfronts1 Posted March 9, 2012 Author Share Posted March 9, 2012 Also, the plotted data is not static. It appears to be floating. As the data is being calculated the previous data disappears from the plot. Thanks Link to comment Share on other sites More sharing options...
AzeoTech Posted March 12, 2012 Share Posted March 12, 2012 The error message is pretty self explanatory. DF can't log the data, probably because you haven't specified a file name in your logging set to actually log to. The integral isn't the same, but is it the same shape, just shifted? This is what would happen if the integral started early. Also, and I guess we are going round in circles on this, but the method of using a channel Event won't work if you are streaming the data. Try doing this without streaming. You'll still need to reset int_v2 to 0 as you do in the 1st line of the startStream sequence. Finally, if older data is disappearing, its because the History parameter for the channel is too small. Its set to 36,000, and if you are streaming at 1khz, that means you only get 36 seconds worth of data before old data gets rolled out. Link to comment Share on other sites More sharing options...
goldfronts1 Posted March 13, 2012 Author Share Posted March 13, 2012 Ok. I know that you are getting frustrated with me, but I do appreciate your help. I followed the integral template you posted regarding doing this integral without streaming. I can see the data in the int_v2 channel however it is not plotting against my new_time channel. The data in the new_time channel is not recording. I have attached a copy of my .ctl file. Again, thanks for your help Setup10.ctl Link to comment Share on other sites More sharing options...
AzeoTech Posted March 14, 2012 Share Posted March 14, 2012 Nah, I'm not getting frustrated with you, though you do probably win the contest for longest forum post thread at 62 posts so far. I'm just trying to get you to think about things rather than just cut / paste what I tell you. For one thing, I usually do this off the cuff and so sometimes have typos, but more importantly, by thinking about it, you will learn the concepts and be able to do other things, where simply copying my work will do nothing to better empower you. I've attached your document, modified to use a Test channel simply so it works without a LabJack. The conversion applied to the voltage channels you can remove as its just to make the Test channel work with the integral. Simply change the two voltage channels back to LabJack channels and you should be good. No where did I see you updating new_time, which is why the plot wouldn't work. Setup10.ctl Link to comment Share on other sites More sharing options...
goldfronts1 Posted March 19, 2012 Author Share Posted March 19, 2012 Thanks so much for all of your help with this. Question: How can I create a button to "stop" or "pause" the recording in all three plots at the same time? Again thanks so much Link to comment Share on other sites More sharing options...
AzeoTech Posted March 19, 2012 Share Posted March 19, 2012 That depends a little on what you mean by stop or pause. Do you mean logging, or actual display? Post your .ctl so I can see where you are. Link to comment Share on other sites More sharing options...
goldfronts1 Posted April 11, 2012 Author Share Posted April 11, 2012 Hi I've attached my .ctl file. My question is that the integral that is not actually the integral of the current vs time graph. It is the integral but when I compare it with a numerical integration of the current vs time data in Originlab the y-axis units are off. I am not sure what is causing the y-axis units to be off. Thanks Link to comment Share on other sites More sharing options...
AzeoTech Posted April 11, 2012 Share Posted April 11, 2012 I couldn't say. How about a screen shot of the two graphs, one from DF, the other from Origin? Link to comment Share on other sites More sharing options...
goldfronts1 Posted April 12, 2012 Author Share Posted April 12, 2012 Attached are the integration plots from matlab and origin just for a comparison (the integral was taken from the current vs time plot). Also attached is the integration plot from DAQ Factory Express and the plot in which the integration was done from (current vs time plot). I just can't seem to figure out what the difference in the units is? Thanks Link to comment Share on other sites More sharing options...
AzeoTech Posted April 12, 2012 Share Posted April 12, 2012 The units in DAQFactory are microA-sec. Your origin and matlab plots are likely in microA-min. Link to comment Share on other sites More sharing options...
goldfronts1 Posted April 12, 2012 Author Share Posted April 12, 2012 If you look at the .ctl file I sent you I have converted the units of the time into mins. but the y-axis units are not in microA. I'm unsure of what units these are? Thanks Link to comment Share on other sites More sharing options...
goldfronts1 Posted April 12, 2012 Author Share Posted April 12, 2012 You see how in DAQFactory it peaks out at 9 in the y-axis. And in matlab and origin it peaks out at 0.15 in the y-axis. I'm not sure what units the y-axis is in and what the difference is? Link to comment Share on other sites More sharing options...
AzeoTech Posted April 12, 2012 Share Posted April 12, 2012 Maybe I have the wrong file, but I don't see where you converted to minutes. int_v2 is in microA-secs. You converted the X axis to minutes (in the trend only), but not the Y. Link to comment Share on other sites More sharing options...
goldfronts1 Posted April 12, 2012 Author Share Posted April 12, 2012 What do you mean by (in the trend only)? Do I need to divide the Y axis by 60? In the plot? Not sure now how to get both the y-axis and the x-axis to show the microA-min? Thanks Link to comment Share on other sites More sharing options...
goldfronts1 Posted April 12, 2012 Author Share Posted April 12, 2012 Sorry here is the .ctl file. Thanks Newest file(1).ctl Link to comment Share on other sites More sharing options...
AzeoTech Posted April 12, 2012 Share Posted April 12, 2012 I mean that you are apply the conversion from secs to min in the trend, not in the channel. And, yes, you need to convert both X and Y. DAQFactory doesn't know what you are measuring and can't apply conversions automatically. It doesn't know what you are thinking. And yes, you need to divide by 60. Just try it and you'll see that the graphs match what you are expecting. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.