LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is happenig under the hood ?

Solved!
Go to solution

Hei,

 

in the University I have been programing in C and Labview. So, I tried to understand Labview with C.

For example, if I call the function "obtain a que" what does the compiler really do? From my perspective I would say the compiler is getting some memory (allocate memory) for the buffer and create some pointers in order to pass data. Is this right?

 

Thanks in advantage.

 

0 Kudos
Message 1 of 7
(3,099 Views)

Hi D,

 

probably yes. The compiler needs to allocate memory to store information about the queue…

 

Why do you need to know that? LabVIEW is a rather high-level programming language, so you don't need to fiddle with memory allocations on your own… (Well, most of the time.)

Best regards,
GerdW


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

I assume the system has a list of all queues, so obtain queue would be a search list for name and copy a pointer to the queue for you to use as reference.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 7
(3,055 Views)

@D_1 wrote:

 

For example, if I call the function "obtain a que" what does the compiler really do?  


You are getting serious answer so I'm going to be the NI answer.  Why does it matter.

 

There are many things going on in LabVIEW, and at some point a magic hand is waved and things work.  Now when they stop working we get upset and want to know why but for the most part the compiler does what it should, data flow works as you would think, and the low level nuisance are taken care of.  On other platforms like Real-Time and FPGA there are some more controls, but in Windows so much is done for you, and NI wants it to be that way.  

 

There's still room for computer scientists to write complicated code, and have it be modular scalable reusable, extensible, and there is room for object oriented stuff.  But generally there is more control in lower level programming languages.  Of course when you're dealing with large scale DAQ systems and rapid proto typeing, you generally have bigger things to worry about than where your memory and queues are coming from.

0 Kudos
Message 4 of 7
(3,048 Views)
Solution
Accepted by topic author D_1
A couple points. First, its very human when learning something new to try and relate it to something you already know -- so you are relating LabVIEW to C. Well, Stop It! Trying to relate LabVIEW to primative languages like C, C++ or Java will always mislead you. A perfect example is the issue with queues.

You do not create queues in your LabVIEW code. All.you do is ask for a reference to one. If it doesn't exist, LabVIEW creates it and than gives you a reference to it. If the queue already exists, LabVIEW simply gives you a reference to the queue that is already there. Likewise, you don't destroy queues. You just tell LabVIEW you are done with your reference to it. If LabVIEW sees that no one else is using the queue, it destroys it. If other places in the code are still using the queue, LabVIEW leaves the queue intact.

Second, unless you are pushing the envelope in terms of speed or the size of datasets, don't sweat about what's "really going on".

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 5 of 7
(2,987 Views)

Hei again,

 

The reason why I am asking this is to better understand some Labview code which I am examine. Nothing else. As Mark mentioned,  in order to understand something that I don't know I try to relate something that I know more and the question was just of curiosity. The problem which I am struggling at the moment is the size of the Labview code. The bigger the code the harder is to debug or examine and create a more efficient approach. The solutuion which we are working right now would be to go to OOP, but this still takes time.

 

Anyway, thanks for the contribution with this question.

 

 

 

 

0 Kudos
Message 6 of 7
(2,951 Views)

@D_1 wrote:

The problem which I am struggling at the moment is the size of the Labview code. The bigger the code the harder is to debug or examine and create a more efficient approach.


This says more about the developer than the language.  Many complicated and large LabVIEW projects can be well written so that debugging can still be done effectivly.

0 Kudos
Message 7 of 7
(2,879 Views)