klrk Posted February 6, 2009 Report Share Posted February 6, 2009 Hi, this is my first time posting here. Sorry for I'm not very good in words. I'm building a daq conmprising of getting data, write file, control and calculation for some reactor. Since it'll be running for few days, I need to convert my running time from s to timeline which is as attached below. But the problem is that I made a data sampling time control in the main loop since it'll be running for days, there'll be whole lots of digits if it's in s. As well as to make it more user friendly. Below it's what inside the main loop The data sampling control is to control how long it write once into xls file. So, are there better alternative for this method ? P.S: Since it'll be running for days, I want to know are there recommended ways for codes optimizing ? I'm still green at LabVIEW. Thanks in advance. Quote Link to comment
Neville D Posted February 6, 2009 Report Share Posted February 6, 2009 QUOTE (klrk @ Feb 5 2009, 02:46 AM) I'm building a daq conmprising of The data sampling control is to control how long it write once into xls file. So, are there better alternative for this method ? I would write data as ASCII txt, and then open the text file in Excel. Writing to an xls file is non-trivial and generally is not worth the extra trouble having to deal with ActiveX, DDE etc. to open the file, find the exact spot in the file to write to and then closing the file, all the while, the user could mess with the open file and cause problems. QUOTE (klrk @ Feb 5 2009, 02:46 AM) Since it'll be running for few days, I need to convert my running time from s to timeline which is as attached below. But the problem is that I made a data sampling time control in the main loop since it'll be running for days, there'll be whole lots of digits if it's in s. Right-click on your Time control>Display Format>Relative Time This will let the value of the control still be defined in Seconds, but you can display & select the Time as HH:MM:SS. (I think you can even set it to days). Neville. Quote Link to comment
jdunham Posted February 6, 2009 Report Share Posted February 6, 2009 First I would try to do as much as possible with the "Timestamp" data type. Many LabVIEW analysis and plotting functions can deal with it. Second, I would only have your program operate on timestamps or values in seconds. If you simply must convert to days/hours/minutes/seconds, only do so just before displaying the value to the user. You don't want to do arithmetic on a complicated time data structure. Don't worry about optimization. Just keep you code as simple an clean as possible and only worry about performance if you are having a problem. Good luck. Quote Link to comment
klrk Posted February 7, 2009 Author Report Share Posted February 7, 2009 Thanks for helping out, now I starting to have idea on how to implement it. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.