LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

notifiers and queues advice

in my opinion i feel confortable with states machines typdef, using cluster of variants, and even jki.

 

iam trying to incorporate the synchronization palette to my programing,

 

As a result i developed a small program with queues and notifiers added; but it turned out to be a disapointment.

In short it happened because I didnt have the needed understanding.

 

here iam attaching the program and dependencies.

 

iside there will be 341D8003-505 and 341D8003-505_1

341D8003-505 was my first attempt at using the queues (fail) i believe i tried to use them like a state machine but wrongly (i think it couldnt update on the state machine) and also wrong using of notifiers.

 

341D8003-505_1 was the second variant which failed as well because of wrong use of notifiers.

 

 

i will appreaicate any advice in this matter. 

0 Kudos
Message 1 of 14
(2,358 Views)

iam sorry i forgot to post the vis

0 Kudos
Message 2 of 14
(2,357 Views)

i added a time-out case on the 341D8003-505_1 and i send both falses and that makes the top loops to run.

also added a new state for the inittial obtain queue and a enque element (initialize)

but i still cant stop the button loop.

0 Kudos
Message 3 of 14
(2,353 Views)

sorry for posting so many time,

 

that time-out was key, i finally added a enque inside the initialize state and now is working better.

 

so much better the notifier than have a local(s) to control all the loops.

 

i must do maky notifiers and queues, to get the hang of it.

 

still apreaciate any advice.

0 Kudos
Message 4 of 14
(2,352 Views)

Caluctra,

This is a timely topic for me, as I recently had a discussion with a couple of very experienced LV programmers about this very Palette.

 

The crux of our discussion is that not all of the tools there are used very often:

 

1. Queues: One of the most powerful and often used tools in the LabVIEW toolbox
2. Notifiers: Often used, and very powerful, but used for very specific things.
3. Semaphores: Almost never used by anyone I had discussed this with.
4. Rendezvous: No one could recall ever using one. In 18 years of LV development, I have never used, nor seen used, a Rendezvous.
5. Occurrences: Used rarely and in very special ways.

 

So, this is probably a good indication as to how useful each of these tools are. Therefore, if I were you, I'd concentrate my efforts on Queues and Notifiers first. You'll soon see that most of what is done out there is done with these two tools.

 

There are a couple of excellent starting points to introduce you to these tools, and to show you how they are used:

 

LabVIEW ships with a couple of excellent starting point references for Queues:


If you go to "File", then "New" from within LabVIEW, find the following examples:
File/New/VI/From Template/Frameworks
/Producer/Consumer Design Pattern (Data) (A)
/Producer/Consumer Design Pattern (Events) (B)
/Queued Message Handler (C)

(A) This is a great starting point to see how you can use Queues to pass data between loops.
(B) This design pattern is used everywhere, and is one of the most common you will see out there (probably)
(C) Another common framework for machine control.

 

 

AMC Toolkit
NI Publishes a great tool called the Asynchronous Message Communication Toolkit. If you download and install this toolkit, there are a couple of really good examples in there for a Queue-Driven Message State Machine.


http://zone.ni.com/devzone/cda/epd/p/id/6091

 

 

If you need some more specific guidance, please let me know. I hope this was at least a little helpful.


Wes Ramm
Cyth UK


--------------------------------------------------------------------------------------
Wes Ramm, Cyth UK
CLD, CPLI
Message 5 of 14
(2,319 Views)

Wes,

 

Very good message.  I would agree with your assessment on each of those 5 tools.

 

I think there can be some good uses for semaphores.  But I don't think I've actually needed to use them either.  Typically there are other tools that can do what semaphores can do which is blocking execution on sections of code.  For example, putting code in a subVI that is non-reentrant.  The subVI can be called by another section of code until the first call to it has completed.  Also, I would say using a data value reference (a relatively newer tool I haven't needed to use) can also provide protection so that multiple parts of the code can't operate on the same data at the same time.

0 Kudos
Message 6 of 14
(2,313 Views)

much appreaciated for both raven's fan and west for the input.

 

Wes i will defenetly ask you if i have another question regarding this pallette.

 

thanks again

0 Kudos
Message 7 of 14
(2,299 Views)

Correction.  I was thinking can't or cannot, but did not type it correctly.

 


Ravens Fan wrote:

Wes,

 

Very good message.  I would agree with your assessment on each of those 5 tools.

 

I think there can be some good uses for semaphores.  But I don't think I've actually needed to use them either.  Typically there are other tools that can do what semaphores can do which is blocking execution on sections of code.  For example, putting code in a subVI that is non-reentrant.  The subVI cannot be called by another section of code until the first call to it has completed.  Also, I would say using a data value reference (a relatively newer tool I haven't needed to use) can also provide protection so that multiple parts of the code can't operate on the same data at the same time.


 

0 Kudos
Message 8 of 14
(2,280 Views)

Hi all,

 

We are depeloving applications for Automated Test Equipment and the applications are very large. We mostly use PXI systems for the ATEs. Every ATEs contains atleast 20 instruments minimum. We are advised to use the shift registers instead of queue while transferring data between parallel running VIs. Reasons are Shift registers access memory directly and Queues are running in a process/thread to transfer which may load the CPU. Queue may not get updated sometimes as it is in process/thread.

 

I want to understand the background on how queue and shift registers are working and which is the best way to transfer data between VIs running in parallel for such large applications. Please share your thought about about large applications development.

 

Thanks,

Sridhar

0 Kudos
Message 9 of 14
(2,218 Views)

Sridarm, by itself, a shift register is not capable of sending data to another parallel loop. 

 

Check this link out.  It is a sub-set of the Asynchronous Message Communication tools by NI and shows you how to do mutli-loop communications.  The AMC also allows you to do messaging across the network.

 

http://zone.ni.com/devzone/cda/epd/p/id/6091#toc4

 


Wes

 


--------------------------------------------------------------------------------------
Wes Ramm, Cyth UK
CLD, CPLI
Message 10 of 14
(2,216 Views)