LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The queue is some time miss && memory leak

Hello,

I don't know what I did wrong,

I make a program with 4 loop that communicate with each other by using notifies the queue

but sometime when I click on a button the queue is not change, the program enter to the event structure but don't change the queue.

 

And I also have a memory leak after an hour of working the ram rise by 7mb-10mb

 

hope that you can help me

thanks

johnny.

0 Kudos
Message 1 of 6
(3,055 Views)

Hi Johnny,

 

you really want someone else to dig into such code (as seen in the navigation window)?

check.png

With clusters made of 32 booleans named boolean0 to boolean31? Come on...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(3,051 Views)

hi GerdW

if you have good comment please give it to me,

The main problem in labview is there is no good tutorial about how to make things right, all the tutorial i readed is only about the feature in labview.
the only i manage to taught my self is from this forum.

 

hoop you will understand

0 Kudos
Message 3 of 6
(3,039 Views)

Let's start a little slower.

 

Your architecture appears to use a queued state machine. Do a search on the forums to look at the general recommendations for using a QSM and common pitfalls.

 

The general LabVIEW recommendations for keeping blocksize diagram sizes small are there to facilitate debugging. It's good advice and your VI is almost scrollable vertically so my criticism is less harsh than Gerd's.

 

I think you're dequeuing in too many places. You really should only dequeue in your state machine handler(top loop) and your event structure should only be used for enqueing states.

 

I will take the time to note my own pet peeve though: Don't ever put an E-stop button on a SW interface! It's misleading and potentially dangerous. E-stops should always be implemented with failsafe hardware.

0 Kudos
Message 4 of 6
(3,029 Views)

I think I figure out the problem,(when the queue is miss)

 

if I click on one of the button in the front panel, and the sequence loop(upper loop) is in a middle of waiting (on delay) the upper loop is missing the change of the queue,

 

I did change my code to be more readable,

 

about the memory leak: I also figure it out, I really think is the daq assistant.

 

how now you can help me with that.

0 Kudos
Message 5 of 6
(2,988 Views)

Hi Johnny1986,

It might be easier if you isolated your issues and made smaller sample VIs for us to help you. This might also help you realise where you went wrong. As far as the daq assistant is concerned, you should probably be using the DAQmx read/write functions instead of the DAQ Assistant. I've attached a link to this at the bottom of this post of a community of DAQmx examples. I hope this helps!

https://decibel.ni.com/content/groups/ni-daqmx-examples

Regards,

Michelle G
Applications Engineering
National Instruments
0 Kudos
Message 6 of 6
(2,945 Views)