Jump to content

Syncing Time in different Loops


klrk

Recommended Posts

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.

post-14084-1233830367.jpg?width=400

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

post-14084-1233830615.jpg?width=400

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.

Link to comment

QUOTE (klrk @ Feb 5 2009, 02:46 AM)

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.

Link to comment

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.