Showing results for 
Search instead for 
Did you mean: 

Dequeue not executed

Go to solution

I am the one sending data manually using XBEE module and probe window. I'll work on your suggestion. But how can we check the data of the string queue? do we use "get queue status"?


And, the cases you refer are: 1st case (1A0 and the others) and 2nd case is what?

0 Kudos
Message 11 of 21
Accepted by topic author PJason

Hi PJason,


So what can you suggest with the architecture?

What do you want to achieve?

Using a queue to decouple processes is quite common and recommended.


Maybe you first should make sure your processes (like that VISARead) is running smoothly and correctly…


And, the cases you refer are: 1st case (1A0 and the others) and 2nd case is what?

The other case is "default", when no tag of your tag list is found.

Best regards,

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 12 of 21

Yes, the VISA functions perfectly after I applied the suggestion of 



0 Kudos
Message 13 of 21

I've tried your solution and it seems that VISA read would only send the data once a timeout occurs and the data are in bulk. Also, the middle loop simply just matches the index of the current data and ff its true, the index will increment and starts match again with using the previous index


And as I what have observed, the response of the VI somewhat slows down. I'm confused now, please enlighten me. Please see the attached VI if there are any mistakes I've made

0 Kudos
Message 14 of 21
Accepted by topic author PJason

Even Now It wont work as Expected as you are dequeuing two queues in the same loop, as you wont get data for both queues at same time, so it will wait till both gets dequeued.

Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
Message 15 of 21

Hi PJason,


it seems that VISA read would only send the data once a timeout occurs and the data are in bulk.

You have configured your VISA connection to wait for TermChars. (Read the help for VISAConfigureSerialPort!)

That's why I removed BytesAtPort: the VISARead will output the received string as soon as it receives the configured TermChar! As it seems you don't use such a TermChar (or the wrong one) and VISARead waits until the timeout occurs: either set the correct TermChar or read just 3 chars (as it seems that's what you want)!

When reading just 3 chars: keep an eye on synchronization between your sender and your VISARead loop. (Using a TermChar would make that much easier…)

Best regards,

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 16 of 21

Yes! I got this one taken care already. Thank you so much!

0 Kudos
Message 17 of 21

A frequent comment I have when I look at someone else's LabVIEW code (such as yours) is "What are you trying to do?".  Your code gives very little in the way of clues.  The VI has no documentation of any kind -- there is no VI Description, there are no Free Labels noting the purpose of the loops, variables are named "Cluster" (no clue as contents) or "Data" (duh!), loops are of the "Do Forever" category (so you know this is a non-workable piece of code), there are parallel loops whose purpose is unclear, an Event Structure that appears to be superfluous, etc.


Here's a serious suggestion:  Open your favorite Word Processor and write a page or two description of What you want to accomplish.  Give absolutely no thought to How to accomplish it -- don't think about LabVIEW, think about the Task To Be Done.


One place to start is with the Data.  What is the nature of the data?  From where is it coming?  What do you need to do about it?  Are you simply logging it (to where?), do you need to process it and make decisions as it come in (what decisions?  do certain data change the flow of the program?), are there "Start" or "Stop" controls that you want to use to control the process?  What kind of interaction does the Operator have with the Program and its associated Data?  Do the Data need to be displayed, and if so, what is a useful format for the display?


A very common beginner "Design Pattern" is to place everything on a gigantic Block Diagram that requires multiple large monitors or, alternatively, viewing the Block Diagram through a (relatively) tiny window, making it impossible to see the Big Picture and structure of the Design.  One excellent way to "collapse" huge Block Diagrams is to identify sub-Tasks and write them as sub-VIs.  You apparently have no sub-VIs in your code.


What is the purpose of so many parallel loops (and "because I can" is not a good answer!)?  I can see an initial sub-VI called "Get Logon Credentials" that runs and returns Success or Failure.  If Failure, you simply stop the program (by not doing anything else).  Again, what is the nature of the Data from VISA?  What are you expecting, what do you need to do with it, and what governs when you are done?  It is not acceptable to "Abort" or "Kill" a running Program -- there needs to be a Stop condition, and it needs to be incorporated into the Program so that things that are Started (such as Queues and VISA Resources) are properly Stopped.  You do have "stopping" code in your Block Diagram, but you can never execute it as the code is currently written.


Find someone with at least a year's experience writing serious LabVIEW Programs (someone with LabVIEW Certification of almost any sort would be preferred).  Apprentice yourself to him (or her), and try to Learn from Better Examples.


Bob Schor

Message 18 of 21

I deeply apologize for the 'lack of information' about my questions and formal application VI's . To be honest, I have a very little experience in LabVIEW that is why I unable to relate things right away. 


Furthermore, I have created an unpolished application using state machine only until I figured out that I lack something. That something is that the system should check the recent data from the upcoming queue data if it is available. Because of this, the system identifies if the node is still connected or not anymore. With this feature, I tried different approach that is the use of Queue function, but the problem is that I really lack the knowledge specially it is a high level architecture already (for me).


Please refer to the attached document for the "flow" of the application that I wanted to create. I hope you all understand.

0 Kudos
Message 19 of 21

If you have "very little experience with LabVIEW", then you are definitely not ready to attack a Project of this complexity and potential criticality.  LabVIEW Developers take "Certification Exams" periodically, with the lowest two levels being a Certified LabVIEW Associate Developer (CLAD) and the next being a Certified LabVIEW Developer (CLD).  One usually takes the CLAD after a year or so experience, and the CLD after several years.  This is a Project closer to CLD than to CLAD.


I recommend hiring a Developer who is willing to let you "apprentice" to him (or her) and ask questions as they develop this for you.  You will learn a lot, quickly.


Bob Schor


P.S. -- Kudos to you for providing Documentation that clearly explains the nature of the Problem, and dictates the response I wrote, above.

Message 20 of 21