BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

It has been a while since I've written code in "C"

Highlighted

YUP,  I'm at a loss

 

Essentially, I found--

 Main()

Init ()

While(1)

}

Clean-up()

 Unreachable code(????)

"1" sort-of "IS" doesn't it?  how do you reach the "Clean-up()"?

"Should be" isn't "Is" -Jay
0 Kudos
Message 1 of 15
(5,282 Views)
Highlighted

There could be some "break" command in the loop, or even better: goto 😄

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 15
(5,257 Views)
Highlighted

When it comes to Booleans, 0 is FALSE, everything else is a TRUE.  But I do see that you are missing the open bracket for the WHILE.

 

Watch out for Breaks.  The C developer I inherited a lot of bad code from loved the Break.  Also watch for a Try...Catch.  They might be depending on an error to break out of the loop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 3 of 15
(5,249 Views)
Highlighted

There are no gotos and no breaks

 

No returns

 

just nice clean-up code that can't be executd while the univere has unity.

"Should be" isn't "Is" -Jay
Message 4 of 15
(5,235 Views)
Highlighted

Jeff·Þ·Bohrer wrote:

just nice clean-up code that can't be executd while the univere has unity.


Good thing we've never seen people do that in LabVIEW...


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 5 of 15
(5,228 Views)
Highlighted

@crossrulz wrote:

Jeff·Þ·Bohrer wrote:

just nice clean-up code that can't be executd while the univere has unity.


Good thing we've never seen people do that in LabVIEW...


Ctrl+. (Period) exists in LabVIEW so its not exactly the same.  and do you have down stream code when you use that construct?

 

Reminds me of a movie I saw

 

"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 15
(5,218 Views)
Highlighted

Jeff·Þ·Bohrer wrote:

Ctrl+. (Period) exists in LabVIEW so its not exactly the same.  and do you have down stream code when you use that construct?


I found a post this morning that had the infinate loop and then cleanup code afterwards.  Oh, and it ran on RT.  I have since deleted it and I don't feel like finding it again.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 7 of 15
(5,209 Views)
Highlighted

@JÞB wrote:

Ctrl+. (Period) exists in LabVIEW so its not exactly the same.  and do you have down stream code when you use that construct?

 

Reminds me of a movie I saw

 


Doesn't always work though. 

Found a case where the producer loop stopped, leaving the consumer waiting... and waiting... and waiting... Ctrl-period did nothing.

There's probably other poorly-coded problems in that project too... :uhoh

0 Kudos
Message 8 of 15
(5,184 Views)
Highlighted

Oh sure, CTRL + . doesn't always do what you want.  Here is a fun one.  Create a subVI that has the window appearance setup to be a dialog which a modal display.  Then place that subVI in a main VI in a case structure, in a while loop.  Add a boolean control set to false on the case selector, and have the model dialog subVI in the true case.  Then open the front panel on both VIs before running the main. (with a constant on the while loop to not stop).

 

What do you get?  Well the model dialog is in memory so it is shown, and it is model so it is brought forward.  But it never is running so CTRL . won't stop it.  Also being model you won't be able to click into the Main to stop it, or CTRL . into the main.

 

The solution?  Task kill LabVIEW, or use some kind of Abort All similar to this one.

 

http://lavag.org/files/file/117-abort-vi/

Message 9 of 15
(5,172 Views)
Highlighted

CRTL + . does not work on VIs which do not have an abort button. It also does not work on modal VIs. There may be other combinations as well.

 

The Help page for keyboard shortcuts does not mention these limitations.

 

Lynn

Message 10 of 15
(5,163 Views)