LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with freeze up

Solved!
Go to solution

Why does my program freeze instantly?

 

As you can see from the attached image with the trace on it stops as soon as it enters the main program loop.

 

I have attached the vi but you will not be able to run it without all the necessary NHR drivers installed, but there must be a glaring error in my programming. I will say right off the bat that producer consumer is not my preferred architecture but I thought I would give it another try.Freeze.PNG

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 1 of 9
(3,006 Views)
Solution
Accepted by topic author RTSLVU

You probably want to first enqueue an element before starting the loop, or the dequeue will wait forever.

 

Overall, the code seems highly convoluted and congested. The timeout case can never complete, so the other big event case event can never be reached. It also seems silly to have events inside events. There has to be a better way!

0 Kudos
Message 2 of 9
(3,001 Views)

Well the event inside an event with both having a timeout case is a definate point of trouble  So is a PC loop inside an event structure.

 

Go look at the Continuous acquisition and logging project template.  then read the additional documentation (including the stuff for the QMH template.)

 

This will help you identify what assumptions you have made wrong about how this design pattern works.  Post back when you have specific questions.


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 9
(2,987 Views)

Thank you, I knew there was something I was forgetting to do. 

 

Queues and event cases drive me nuts because I do not understand how to use them properly keep trying them but end up falling back to old school ways because I can never get them working right. I still got some problems here. I kind of pained myself into a corner choosing this architecture.

 

The code has some holdovers from the original program a contractor wrote. It's still a bit convoluted but I think I have improved it since the original code had 167 local variables and I only have one now...

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 9
(2,982 Views)

@RTSLVU wrote:

Thank you, I knew there was something I was forgetting to do. 

 

Queues and event cases drive me nuts because I do not understand how to use them properly keep trying them but end up falling back to old school ways because I can never get them working right. I still got some problems here. I kind of pained myself into a corner choosing this architecture.

 

The code has some holdovers from the original program a contractor wrote. It's still a bit convoluted but I think I have improved it since the original code had 167 local variables and I only have one now...


166 fewer problems! nice work.   Do take a peak into the sample projects and the developer walk throughs of the projects. You'll thank yourself for all the time you save.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 9
(2,967 Views)

@JÞB wrote:

Go look at the Continuous acquisition and logging project template.  then read the additional documentation (including the stuff for the QMH template.)

 

This will help you identify what assumptions you have made wrong about how this design pattern works.  Post back when you have specific questions.


WOW, I do not understand this at all or even where to begin asking questions..Smiley Sad

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 9
(2,961 Views)

@RTSLVU wrote:

@JÞB wrote:

Go look at the Continuous acquisition and logging project template.  then read the additional documentation (including the stuff for the QMH template.)

 

This will help you identify what assumptions you have made wrong about how this design pattern works.  Post back when you have specific questions.


WOW, I do not understand this at all or even where to begin asking questions..Smiley Sad

 

 




http://www.ni.com/webcast/3197/en/

http://www.ni.com/video/2741/en/

http://www.ni.com/white-paper/14116/en/


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 9
(2,957 Views)

@JÞB wrote:

@RTSLVU wrote:

@JÞB wrote:

Go look at the Continuous acquisition and logging project template.  then read the additional documentation (including the stuff for the QMH template.)

 

This will help you identify what assumptions you have made wrong about how this design pattern works.  Post back when you have specific questions.


WOW, I do not understand this at all or even where to begin asking questions..Smiley Sad

 

 




http://www.ni.com/webcast/3197/en/

http://www.ni.com/video/2741/en/

http://www.ni.com/white-paper/14116/en/


Thanks, I will have to view the video's from home tonight as my company must be on a dialup because I get 5 seconds of video at a time with a 10 second pause in between.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 8 of 9
(2,948 Views)

I watched the video this morning and this is an increadible feat of programing but I am not worthy.

 

Like all of the examples It runs great as it is but it's all magic to me.

 

I do not know how I would modify it to do what I need it to do and if I broke it I would probably never get it running again because I really do not understand how it even does what it does.

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 9 of 9
(2,899 Views)