11-22-2013 11:09 AM
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.
Solved! Go to Solution.
11-22-2013 11:15 AM - edited 11-22-2013 11:19 AM
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!
11-22-2013 11:53 AM
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.
11-22-2013 12:00 PM
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...
11-22-2013 12:23 PM
@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.
11-22-2013 12:36 PM
@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..
11-22-2013
12:42 PM
- last edited on
11-14-2024
06:35 PM
by
Content Cleaner
@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..
http://www.ni.com/webcast/3197/en/
http://www.ni.com/video/2741/en/
http://www.ni.com/white-paper/14116/en/
11-22-2013
01:13 PM
- last edited on
11-14-2024
06:35 PM
by
Content Cleaner
@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..
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.
11-25-2013 10:28 AM
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.