LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Program lost part of functions after 1.5 month?

Thanks Jeff, I create the DAQmx task only once outside the while loop. I attached the screen shot of the block diagram. It's quite busy but it's main part of the code.

 

Rgds,

 

Harry

 

 

0 Kudos
Message 11 of 53
(1,231 Views)

Harry,

 

1. I do not know of any way to speed up the overflow process.

2. The subtraction shown in your image should not cause a problem.  Are you using Tick counts anywhere else?

3. I am not sure what the source of the Tick count timer is.  It is well known that the time of day clock and the tick clock are different.  7% seems high, but I have never tested it.

 

Except for the CycleTime calculation you do not need the sequence structure. Dataflow will manage everything else. And your Cycletime calculation is rather meaningless because you have no way of knowing when the Tick Counts are read relative to everything else in the frames.

 

Lynn

0 Kudos
Message 12 of 53
(1,210 Views)

Lynn,

 

Thanks for your reply. Sounds like I am back to stage 1 again :(.

 

I don't have any Tick Count no more, but I do have a "Wait (ms)" function inside the while loop, which I used to control the execution frequency of the While loop. I normally set it to 5000 millisecond. Will it cause issue?

 

Yes you are right I should remove the sequence structure - always forgot the control of data flow...

 

Any other thoughts? Thanks.

 

Rgds,

 

Harry

0 Kudos
Message 13 of 53
(1,206 Views)

@Harry.W wrote:

Lynn,

 

Thanks for your reply. Sounds like I am back to stage 1 again :(.

 

I don't have any Tick Count no more, but I do have a "Wait (ms)" function inside the while loop, which I used to control the execution frequency of the While loop. I normally set it to 5000 millisecond. Will it cause issue?

 

Rgds,

 

Harry


YUP! replace Wait (ms).vi with the delay routine in the article I linked in my first post on this thread. 

 

Nice find! 


"Should be" isn't "Is" -Jay
0 Kudos
Message 14 of 53
(1,203 Views)

Jeff,

 

I went through your post and you mentioned "the Wait +(mS).vi was called just prior to a millisecond timer rollover" is the condition the error happens. So my questions are,

 

1. What is the "millisecond timer" you refer to? The Tick Count function?

 

2. If answer to 1 is Yes, then if I remove the two Tick Count function but still keep the "Wait (mS)" there, will the rollover issue still exist or not?

 

3. My plan is to get rid of the Tick count and use your CCI.vi to replace the Wait. Is there any way, if possible, that I can simulate the condition when rollover happens? Waiting for 47 days to see the result is really painful...

 

4. BTW, just fyi, this "47 days failure" happened two times already, so it really looks like some sort of pattern.

 

Thanks for your help!

 

Rgds,

 

Harry

0 Kudos
Message 15 of 53
(1,176 Views)

@Harry.W wrote:

 

 

Waiting for 47 days to see the result is really painful...



Suppose instead of using the actual tick count timer and waiting 47 days, you simulate the 47 days by either replacing the timer with a control you manually update, or adding a value to the number coming out of the tick count timer you are using.

 

Be sure you use the correct datatype for the value you are adding.  It may or may not work as a substitute for waiting 47 days, but at least you should be able to simulate rollover conditions and see if your program logic is failing in handling the rollover.

Message 16 of 53
(1,171 Views)

Ravens Fan,

 

Can you please elabrate a little bit more on how to do this? Say if I want to see what the program do when my Tick Counts rollover, how can I add value to the Tick count function? Or how can i edit this function?

 

Thanks

 

Harry

0 Kudos
Message 17 of 53
(1,168 Views)

Jeff/lynn,

 

Attached is the revised block diagram. I replaced the Wait (ms) with Jeff's CCI.vi and got rid of the sequence structure and the Tick count. Not sure you have time to take a quick look but any suggestion is highly appreicated!

 

BTW, do I have to use the error function for the CCI.vi?

 

Rgds,

 

Harry

0 Kudos
Message 18 of 53
(1,169 Views)

Harry,

 

Nice clean up.

 

You do not need to use the error wiring on the CCI VI unless you want to control when the wait starts.  As you have it in your program now, the wait runs in parallel with the other code.  This is probably what you want.

 

As far as general suggestions, I am somewhat hesitant to get into that area.  Your program works except for 1 millisecond every six weeks.  And you have probably dealt with that.  I would do some things differently with regard to style and some functional issues, but given that it works it is probably better to leave it alone rather than introducing new bugs.

 

For your next program consider Event structures for handling user inputs (buttons). Consider Producer/Consumer to separate data acquistion from analysis and file operations.  Keep diagram size small enough to fit on one screen.  Avoid local variables where wires will do.

 

Lynn

Message 19 of 53
(1,156 Views)

@Harry.W wrote:

Ravens Fan,

 

Can you please elabrate a little bit more on how to do this? Say if I want to see what the program do when my Tick Counts rollover, how can I add value to the Tick count function? Or how can i edit this function?

 

Thanks

 

Harry



I thought I explained it clearly enough in words.  But here is a snippet to explain it.

 

One problem I have with what you have shown us so far is that no where in your code to I see where you are using a tick count function in a way that would cause your VI to pause.

 

Message 20 of 53
(1,148 Views)