• RELEVANCY SCORE 4.04

    DB:4.04:State Machine Vs Producer Consumer Architecture - Time Analysis cm






    After learning various methods to program efficiently and learn how to use SM and Producer consumer. I built a program to control stepper motor in both these techniques.

    Here is the RESULT. As we can see a simple state machine without any complicated producer consumer technique performs faster than the second one.

    I am not sure which is still the best based on performance and optimization. Please advise which one should I keep and why.




    Abhilash S NairResearch Assistant @ Photonic Devices and Systems lab[ LabView professional Development System - Version 11.0 - 32-bit ]LabView Gear:1. NI PXI-7951R NI 57612. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]MEMORY - [ 16.0 GB RAM ]GPU - [ NVIDIA GeForce GT 530 ]

    DB:4.04:State Machine Vs Producer Consumer Architecture - Time Analysis cm


    Damn!! Yes ... Never gave a thought to that!.

    How can I start the executiuon by default in producer loop event structure ?

    I dont want to trigger the event by clicking on the Run button. Instead just running the VI should start it. Is there a way to do that ? So that I can do the time analysis automatically.




    Abhilash S NairResearch Assistant @ Photonic Devices and Systems lab[ LabView professional Development System - Version 11.0 - 32-bit ]LabView Gear:1. NI PXI-7951R NI 57612. The Imaging Source USB 3.0 monochrome camera with trigger : DMK 23UM021OPERATING SYSTEM - [ MS windows 7 Home Premium 64-bit SP-1 ]CPU - [Intel Core i7-2600 CPU @ 3.40Ghz ]MEMORY - [ 16.0 GB RAM ]GPU - [ NVIDIA GeForce GT 530 ]

  • RELEVANCY SCORE 3.67

    DB:3.67:Does Race Conditions Occur In Queued State Machine 8x






    hII'am developing a vi in which i use a producer consumer design pattern.the producer enqueue's the states for the consumer. but at some point of excecution i wish to enqueue the next state of the consumer statemachine, from within the consumer state itself. does this cause any problem??.in other words can i enqueue data within the consumer loop also. so thet the next state of consumer will depend on the data enqueuedThanks




    Waiting For the inner calling

    DB:3.67:Does Race Conditions Occur In Queued State Machine 8x


    I make extensive use of Queued Message Handleres where both the "Producer" and consumer enqueue to the same queue.

    A "Firinstance" from work today: here are two captures of a part of the same code

    The top loop controls the Stateof a semi autonomous process where data is gathered.

    a event is detected triggering start of measurement cycle
    Data begins to be gathered
    Another event tells the top loop that it is time to stop gathering data and "Analize" is sent to the consumer At Opposite end
    Analize flushes the buffer, formats the data and continues to the "Log" state

    The thing to remember is to use a priority queue. Enqueue to self and flush as appropriate, enqueue opposite end from the controler. See also "A Trip To Grandma's House"

    It is a very powerful technique for large applications where you want to abstract out the "what" and "When" from the how and just let a loop "Do"

    And Yes, If I had chosen a unrestricted datatype (string, var) rather than an enum and built the lower loop as a child class you have an "Actor"




    Jeff

  • RELEVANCY SCORE 3.60

    DB:3.60:Stopping Parallel Loops... am



    Ok,

    So I realize that this is probably one of the most common quesitons on this board, however I would like to stop parallel loops in a specific way, and am having trouble comming up with an elegant solution.

    I have a VI with 4 loops, one producer, one consumer, and two other state machines. When I press stop, I would like each of the non-producer loops to finish their tasks, return to a "null" state, then stop. When all three are stopped, I would like the main loop to stop, and release any queues.

    The way I have accomplished this so far is to send a stop notification to each of the consumer loops. The "Wait on Notification" function is placed in the null state, so that it can not stop unless it is finished.

    Each of the 3 consumer loops has it's own notifier to send a message back to the producer loop when stopped.

    The producer loop is event driven, and the stop event waits for all three "True"s to come back before stopping.

    This just feels cluttered and ugly to me.

    DB:3.60:Stopping Parallel Loops... am

    krwlz101 wrote:

    Well,

    I did have everything in 2 loops at first. The main issue I was running into was that when trying to sample the DAQ at 10000 Hz, I kept getting errors. I seperated out the DAQ part so that nothing could slow it down. Do I need to run it at 10000 Hz? Probably not, but I am thinking long term with this app.

    I will agree that the update screen could be part of another loop. That said, even with two loops, my main question remains unanswered.

    If I am understanding the question as "How Can I know that a VI is DONE if that vi is contains a queue. In my recient Community Nugget series: Application Development- I Propossed a model with 3 queues, 1 Event Queue and 2 message queues! It was brought up in installment 1 that it is desirable to shut down a queue with a specific "Exit" command AND to provide some means of letting the caller know that the consumer finished.

    "Queue Basics.vi" from the shipping examples shows a queue example. The "Producer-Consumer (Data)" template is even better BUT, if you NAME the queue you can get a reference in a sub-vi, Here is a modified PC data template---

    When the consumer EXITS its Error chain becomes valid! so, If we sent an "Exit" command to the consumer AND we set STOP we close the execution of the consumer loop and the Producer loop. Since both (error) chains are now populated the "merge error" primative can execute.

    HOLD IT ! "Naming" the queue lets me access a reference to that named queue ANYWHERE (in the app space) !!!

    Destyoying that queue makes any consumers execute the queue "default," but, a specific "Exit" command can execute shutdown code (like "stop- while loop") and do clean-up

    Two way communications ("exit done") can be done via queue BUT LabVIEW is a dataflow language!!!!!! so the caller does not need a "Exit complete" message. just a valid Output of the consumer. Error merge works well in this situation




    Jeff

  • RELEVANCY SCORE 3.36

    DB:3.36:Pass A Parameter To A Task 1c


    I get an integer from the console.
    Console.WriteLine(Please input the number);
    int count = Console.Read();
    var producer = Producer(count);
    var consumer = Consumer();
    Task.WaitAll(producer, consumer);
    Now I input a number 3, count should be 3.
    static async Task Producer(int count)
    {
    try
    {
    for (int i = 0; i count; i)
    {
    //
    However I found count became 51 in the Producer method, it loops 51 times. Why?

    DB:3.36:Pass A Parameter To A Task 1c

    Console.WriteLine(Please input the number);
    string input = Console.ReadLine();
    int count = Convert.ToInt16(input);
    var producer = Producer(count);
    var consumer = Consumer();
    Task.WaitAll(producer, consumer);
    when you use console.read itr reads the charecter value not the actual value of inserter element .
    so if you want to read the value the use readline .if you want to read the internal value for a input itemm the we can use read ().

    Console.Read()reads
    only the next character from standard input, andConsole.ReadLine()reads
    the next line of characters from the standard input stream.

    Standard input in case of Console Application is input from the user typed words in console UI of your application. Try to create it by Visual studio, and see by yourself.

  • RELEVANCY SCORE 3.25

    DB:3.25:Producer Consumer Architecture Functionality a3



    I was wondering if the consumer loop in a producer consumer architecture only works when the producer loop sends something to it, or is it always working, even if it doesn't receive anything from the producer loop?







    Solved!
    Go to Solution.

    DB:3.25:Producer Consumer Architecture Functionality a3


    In a "pure" producer/consumer, there is no timeout on the queue. So as long as there is no data waiting in the queue, the Dequeue Element will "sleep" until the is data available.

    As Greg stated, if you have a timeout, then the Dequeue Element will "sleep" until the timeout is reached (assuming no data is available during the timeout time). There is an output of the Dequeue Element that will tell you if it did timeout. This is sometimes useful if you want to pull an instrument every so often or keep an ethernet port active. But that is getting more into the Queued Message Handler than a Producer/Consumer.




    There are only two ways to tell somebody thanks: Kudos and Marked Solutions

  • RELEVANCY SCORE 3.21

    DB:3.21:Producer Consumer Loops Vs Local Variables 33


    I am needing to collect data from multiple loops that are running at varied rates. However, I want to collect data at a constant rate. I am using a seperate loop to poll the data from the other loops to get the most recent data. Something tells me not to use local variables, but to instead use a queue. What are the disadvantages to using local variables and the advantages to using a queue?



    Doug Fergusonwww.southerndaqsolutions.com

    DB:3.21:Producer Consumer Loops Vs Local Variables 33

    All controls/indicators "live" in the user interface thread, so all access to them must go through that thread. Locals are far more efficient than property nodes because they use the normal update methods while property nodes force a front panel update on each use. The normal update method caches changes to the front panel and updates periodically. You can see this in action by writing a simple loop which feeds a changing value to a front panel control. As you change the access from the control to a local variable to a property node value, the time to execute the program will increase. In the picture below, this is the left to right sequence.
    Message Edited by DFGray on 03-26-2007 08:20 AM




    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • RELEVANCY SCORE 3.20

    DB:3.20:Looking For A Good Queue Tutorial 93



    I am looking for a good tutorial on using queues, specially in the producer consumer program model.

    I have use a couple queued state machines and did not really see much of an advantage over the standard state machinebeyond it saves you the two minutes it takes to create the typedef.

    I have looked at the producer consumer examples and sure they work but I do not understand why. The producer consumer model does not seem to follow the data flow paradigm. The data collected in the producer loop just getsmagically transported to the consumer loop? I can't accept that.

    DB:3.20:Looking For A Good Queue Tutorial 93


    Jeff,

    You may want to post your code and create a new thread. Is this array preallocated? If you are constantly appending new elements to the array LabVIEW memory manager is having to constantly find new locations for the array. This takes alot of time when you are dealing with large data sets.

    If you have more cpu resources you could try having two consumer loops pulling off data and see if that helps, the arrays will end up being a shared resource and may stall out one of the loops.




    Kyle HartleyRIO Product Support EngineerNational Instruments

  • RELEVANCY SCORE 3.16

    DB:3.16:Producer Consumer Refnum Error 7f


    Hi allI have a Producer/Consumer structer in my Program. On the Frontpanel there are a couple of elements. When I change the state of one of this elements I deliver the refnum of this element to the consumer loop. With the variant to data i can recive the corrsponding refnum. My Problem is :This will just work with one kind of the frontpanel elemnts but not with the others. ( See the attached VI)I hope someone can help me.regards









    Attachments:







    test1.vi ‏114 KB

    DB:3.16:Producer Consumer Refnum Error 7f

    Hi evanThank you for the answer. At this moment I found this solution at:http://wiki.lavag.org/index.php/Image:Typecasttoanotherclass.pngregards

  • RELEVANCY SCORE 3.16

    DB:3.16:Producer/Consumer Notifications? 8x


    Hi,I'm trying to implement a producer/consumer pattern in a multithreaded application.I have three threads:  thread 1: producer  thread 2: producer  thread 3: consumerThe producers are listening to incoming data and processing it into their own structures.They also put the incoming data into a QueueMessage.Pseudo code:

    //This is a variable in the main class  

    AutoResetEvent AutoReset = new AutoResetEvent(false);  

    QueueMessage queue = new QueueMessage();  

     

    //Both producer threads have events that get forwarded here  

    public void GrabIncomingMessageOnEvent(object state, Message msg)  

    {  

        ProcessMessage(msg);  

        ProcessQueue();      AutoReset.WaitOne(); 

    }  

     

    //Puts the message in the appropriate list and queue  

    public void ProcessMessage(Message msg)  

    {  

          int owner = GetTheOwnerOfTheMessage(msg);  

          OwnerList[owner].Messages.Add(msg);  

          queue.Enqueue(msg);  

    }  

     

    //Processes the queue  

    public void ProcessQueue();  

    {  

             

        while (queue.count  0)  

        {  

            //Dequeue the items in the queue  

            //Aggregate messages by a specific property  

        }  

        AutoReset.Set();  

    DB:3.16:Producer/Consumer Notifications? 8x

    Thank you, I think I got it working :)regards, nisbus

  • RELEVANCY SCORE 3.15

    DB:3.15:Event Producer Vs Event Consumer.(Component-Driven Events) m3



    How does a component raise an event. Seam provides a built-in component for this.Events.instance().raiseEvent("EventType"); is used to call the events.My question is; Can Event Producer send data to event Consumer? and How.Thanks

    DB:3.15:Event Producer Vs Event Consumer.(Component-Driven Events) m3


    I have used component driven events a few times in my application and have found having the payload in contexts to be good.I think that it 'fits' well with seam design: the data/objects required by the consumer may be from the payload, or from session or application contexts. By using the event context for the payload it provides a single method for accessing the data required.It is (I think) less easy to understand so perhaps could benefit from an example?

  • RELEVANCY SCORE 3.15

    DB:3.15:Register Event In Producer Consumer Design Pattern fp


    Hello wire workers,I am fairly green when it comes to dynamic event registration, so my understanding of it is probably quite flawed, but what I have implemented seems to work fine.Assuming a fairly typical queued producer/consumer state machine architecture.Up till now, I have done the dynamic event registration outside (i.e. to the left of) the UI loop, so all events get registered before the UI loop starts to run.My question is:How can I register events from inside one of the consumer loops? I cannot wire it...Maybe an example will make my scenario more clear.I have a DAQ loop (queued state machine). In the init state of this loop I want to register a digital input such that changes on a line are handled by my main event structure (in the totally separate UI loop). Is this possible?I look forward to hearing positive answers



    nrpCLA

    DB:3.15:Register Event In Producer Consumer Design Pattern fp

    I never did figure out how to coerce an array generated using build array
    into having its own name that the IDE picked up on.

    Perhaps if you concatenate an empty array constant with a name? I never ran
    into this problem, but I usually get my control arrays form a sub VI.

    Regards,

    Wiebe.

  • RELEVANCY SCORE 3.14

    DB:3.14:Unbounded Multi-Producer/Consumer Queue... fc



    I am presenting pseudo-code for the most efficient unbounded multi-producer/consumer queues I have seen. It has wait-free pushes, and lock-free pops. One atomic RMW operation per-operation, and one release barrier for push and one acquire barrier for pop. Here is some crude pseudo-code:

    struct node {
    node* next;
    void* state;
    };

    struct dwcas_anchor {
    int32 aba;
    struct node* node;
    };

    struct mpmcq {
    struct dwcas_anchor tail;
    struct node* head;
    };

    void
    mpmcq_init(
    struct mpmcq* const self,
    struct node* dummy
    ) {
    dummy-next = NULL;
    self-head = dummy;
    self-tail.node = dummy;
    }

    void
    mpmcq_push(
    struct mpmcq* const self,
    struct node* node
    ) {
    struct node* prev;
    node-m_next = NULL;
    prev = ATOMIC_SWAP_REL(self-head, node);
    ATOMIC_STORE(prev-next, node);
    }

    struct node*
    mpmcq_pop(
    struct mpmcq* const self
    ) {
    void* state;
    struct dwcas_anchor cmp, xchg;
    cmp = self-tail;
    do {
    struct node* next = ATOMIC_LOAD(cmp.node-next);
    if (! next) return NULL;
    state = next-state;
    xchg.node = next;
    xchg.aba = cmp.aba + 1;
    } while (! ATOMIC_DWCAS_ACQ(self-tail, cmp, xchg));
    cmp.node-state = state;
    return cmp.node;
    }

    Please note that the function `ATOMIC_DWCAS_ACQ()' is assumed to automatically update the comperand on failure.

    This has the same memory management properties as a lock-free stack. It beats the heck out of all the other unbounded multi-producer consumer queues I have seen to date.

    Enjoy!

    ;^)

    DB:3.14:Unbounded Multi-Producer/Consumer Queue... fc

    Quoting - Dmitriy Vyukov


    I think the fences here must be different:
    A - relaxed
    B - release
    C - acquire
    D - acq_rel (but not seq_cst, i.e. no #StoreLoad)

    Humm... Relacy seems to disagree. Here is example code which uses the memory barriers you laid out:

    http://relacy.pastebin.com/f21025123

    This bites the dust with a memory leak, which means the queue lost nodes.

    Here is a version that uses sequential consistency and all is good:

    http://relacy.pastebin.com/f2ce9aab8

    Could you please help me create a version of the example code which does not use sequential consistency? Please note that if I change one of those seq_cst membars to any other membar, I get lost nodes and a memory leak...

    Interesting...

    BTW, I am using Relacy version 1.5.0

  • RELEVANCY SCORE 3.10

    DB:3.10:Jki Way-Cld 1m



    Hi,

    I just started preparing for CLD exam. On looking different design pattern, Ihave seen(http://blog.jki.net/community/pass-your-cldcla-exa​ms-the-jki-way/) that there is one option of using JKI state machine tocrack CLD exam. But I am not clear how much it will be useful to solve our CLD exam when compared to other design patterns like QSM,producer consumer or SM. I couldn't see anyCLD sampleproblems solved using JKI state machine in the forum. Please provide your feedback/sample solutions for JKI state machine.

    Vijay.







    Solved!
    Go to Solution.

    DB:3.10:Jki Way-Cld 1m


    The JKI state machine is a good example of using 1 of several possible approaches. The best advice I can offer is to know as many design patterns as possible and be comfortable with at least the PC(Data), PC(Events) and Queues and Notifiers, Timing and file IO. You won't know what the requirements are untill your 4 hours starts having a bag full of tools means you can select the best one to meet your requirements. Selecting the best design pattern for the job puts you that much closer to finishing in the alloted time.




    Jeff

  • RELEVANCY SCORE 3.09

    DB:3.09:Break Out Of Timer At Stop Event pj



    Hello,

    I have a producer/consumer architecture. In the consumer loop I have a elapse timer which runs within a while loop as shown in the attachment. My quesiton is how to break the elapse timer when stop button is pressed? The way I have done is by using a global for stop and then have the Elapse Time loop stop if stop is pressed. Are there any other way to perform this and avoid globals? I have looked into events but the timer needs to be in consumer loop within the state machine.

    Are there any drawbacks of using Elapsed Time express VI for example overhead, momory usage, polling etc?

    Thanks.




    *************************************************CLD,CTD*************************************************

    DB:3.09:Break Out Of Timer At Stop Event pj


    Get rid of the inner while loop in the consumer. Make the consumer a state machine. One state (case) checks the Elapsed Time. If Time has Elapsed is False, then exit the case but make the next state the same state (and case). Thus this state will be entered and exited repeatedly until the Time has Elapsed but opportunities to check for Stop occur on each iteration. If the Stop was pressed in the Producer, use a notifier or queue to transfer the command to the consumer. On each iteration of the consumer state machine the queue/notifier is checked for the Stop command. If it is not present the next state in the shift register is used. If it is present, go to the Halt state. The timeout on the Dequeue/Wait for Notifier defines the maximum time before entering the next state.

    Lynn

  • RELEVANCY SCORE 3.08

    DB:3.08:Producer Consumer Loop Question aa


    Hi,In a producer consumer design pattern, I notice that the consumer loop runs 1 more iteration than the producer loop. Does anyone know a way around this.Thank you,-Tim

    DB:3.08:Producer Consumer Loop Question aa

    Nice answer Jarrod,I've only recently upgraded to LV 8.20 from 6.1 (where there are no producer consumer templates AFAIK) so I've been rolling my own so to speak, hence my answer.Either way, my post just got irrelevant. I think Jarrod's got it nailed.Shane.



    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

  • RELEVANCY SCORE 3.07

    DB:3.07:Chat Between Multiple Users Using Producer/Consumer x8



    Hi All,

    I'm working on a chat application between multiple users using producer/consumer in flex(pure flex). But i found that this was basically a broadcast service. How do i make sure that i maintain a private chat between any two users using producer/consumer scenario?

    DB:3.07:Chat Between Multiple Users Using Producer/Consumer x8


    Hey Shivang,

    Thanks for that input. I have made those changes.

    But how do i make this work in a multi user scenario?

    Should everybody subscribe to everyone????? How do i use multiple selectors or headers? Is it even possible.

    Finally will i be able to implement a simple multi user chat with this Producer/Consumer?

  • RELEVANCY SCORE 3.07

    DB:3.07:Federating Books/Pages Vs Portlets kj


    Hi

    Is there any advantage in federating the Books or page over federating portlets individually ?

    Federating book ... Does it has any limitation like we can not move the remote portlets/pages placed under the remote books to other pages ?

    The WLP 9.2 Federation guide states,

    + Changes to remoteable pages and books made on the producer cannot be propagated to consumers of those pages and books. This means that if you change a remoteable page or book in a producer application, and that page or book has already been consumed by consumer applications, the changes will not show up in the consumers. +

    Does this mean every time we change something in the producer we need to recreated the remote book in the consumer side ?

    +Portal Look Feel elements that are used in .page and .book files must be replicated on the consumer. This means that Look Feel files, such as .layout, .theme, and supporting JSP files that are used in a remoteable book or page must exist on both the producer and the consumer. +

    Why do we need the skins and skeleton files in the producer ?

    Thanks
    Rajesh ar

    Edited by: RajeshAr on 5/03/2009 10:56

    DB:3.07:Federating Books/Pages Vs Portlets kj

    Hello Rajesh,

    There is no real advantage to federating books or pages over individual portlets, unless you wanted to set up the same book / page structure on multiple consumers. In this case, bringing over the remote book or page would save the (slight) trouble of setting it up on each consumer. But other than administrative set-up time when multiple consumers hit the same producer, there is no performance or functionality reason to use federated books or pages; it is just an alternate way of setting things up.

    When a remote book or page is set up on a consumer, a copy of the producer's book or page is essentially made on the consumer, and then the individual portlets on the book/page are consumed over WSRP from the consumer. Each federated book or page description is sent over to the consumer, where it is set up on the consumer in a way identical to how it was set up on the producer, but after this point there is nothing tying the consumer's copy to the producer's book or page. So if you made a change to the book / page on the producer, you would need to re-consume that book or page from the consumer to see the changes. Any preferences you had set on portlets on the consumer side would not show up in the newly-copied book or page's portlets, as the portlets would be "fresh", uncustomized copies of the remote portlets (POP handles, to use WSRP terminology).

    The skin and skeleton files are needed on the producer only to set up the definition of the book or page that can be offered as a federated book / page. When a consumer consumes a remote book or page, a copy of the description, including references to the skin and skeleton files-- but not the skin and skeleton files themseleves-- is sent to the consumer; this is why both the producer and consumer must have the same versions of these files.

    Kevin

  • RELEVANCY SCORE 3.06

    DB:3.06:State Machine Data Type Matching Help mf



    Hello everyone,

    I am a LabView novice and I am trying to create a program that generates, acquires, and graphs a waveform. The program will use DAQmx blocks corresponding to the compact DAQ AI and AO modules.

    I decided to use a state machine after running into some data type difficulties using producer/consumer loops and some physical channel difficulties when using a simple series structure.

    My problem is that I cannot wire the case selector to either the AO or AI voltage blocks in separate cases. This doesn't allow me to actually create my wfm generation and aquisition cases so my program is broken.

    I keep getting the error: "you are trying to connect two terminals with different data types. the type of the source is an unsigned word and the type of the sink is a user defined refnum tag". My AO and AI type is a voltage that I selected from the drop down menu. I do not know how to change these DAQmx data types to something other than "user defined refnum tags". This is the same error that I got when I tried to connect my producer/consumer queues.

    I am pretty sure that there is a simple solution to this and I would really appreciate some help .

    DB:3.06:State Machine Data Type Matching Help mf


    Thanks everyone!

    I'm sort of figuring it all out now. I got the enumerated constant down in my new program and I am currently learning about why all of my case names disappeared haha...

    Once I started over from scratch, everything became a little easier to understand. The template was good but starting fresh with all of your tips has helped.

    Conceptually, the data flow makes sense but LabVIEW seems to be a bit more demanding than a lot of other programs I've used.

    Good luck

  • RELEVANCY SCORE 3.05

    DB:3.05:Queue Vs Property Node: Update Problem In Event Structure Qsmpc m1



    Hi,

    I am using queued statemachine as consumer and event structure as producer . events are giving some data to a graph which are read in consumer. but i require the consumer to run in a certain state since i will bedoing some operation on the data. please look at the attachment.

    I am using a property node to get the data that event structure emitted and also circulating the queue with the same data in same state, but for some reason the queue operation is getting the previous event data and cycling between the new data.

    observe both the graphs. how can i make the queue graph not cycle and display only the current data as the property node graph in my attachment.

    attached LV8.2 ver

    Thanks










    Attachments:






    Queue vs property node.vi ‏57 KB

    DB:3.05:Queue Vs Property Node: Update Problem In Event Structure Qsmpc m1


    I'm glad to hear it is starting to work the way you want now.

    Don't forget to wire up the error wires on your queue functions.

  • RELEVANCY SCORE 3.04

    DB:3.04:Basic Of Working With Multi Pxi Devices? 7j



    Hi,

    I've tried to search, but havent found anything that satisfied me. Maybe anyone knows, what is the basic programming structure (in Labview) of working with multi pxi/pxie devices?

    For example, I have some pxie devices:

    DAQmx: generate analog signals and counter

    Timing Module: generate clock and sync

    HSDIO: generate acquire digital signals

    NiSCOPE: acquire analog signals

    I found so many examples how to use them one by one, but I found its quite difficult to make them working together as a system. Event structure? state machine? producer consumer? which one is it the best I can use? I want to simply able to generate/acquire analog/digital signals independent from each other. Any help would be great.

    Regards,

    Yan.

    DB:3.04:Basic Of Working With Multi Pxi Devices? 7j


    Hello Yan,

    i think you mean the master slave framework, which uses notifier instead of queues.

    You have to know that notifier do not store the message, so if the master generates faster

    the messages then the slave respond to, the message are lost. This is the reason, why often

    are queues in use to prevent a lost of messages.




    best regards Alexander GlasnerAE NIE

  • RELEVANCY SCORE 3.03

    DB:3.03:State Machine And Producer Consumer Design Patterns 3d


    Hi! In my application I am using state machine(for top level VI) and producer consumer(for subVIs) design patterns throught out.If there is no activity on the front panel for 1min then the ideal state is invoked. Following are the situation of the ideal state:1. It checks for any hardware present on the network . If no hardware is found on the network within 1 min then the application and LabVIEW exits.2. While the ideal state checks for the hardware, and user clicks on any front panel button then it should exit the ideal state. The controlshould be in the respective button state.I am able to achive the point#1 mentioned above but could not get the point #2 to work. I am including the snap shot of the state machine(default case) and prouducer consumer(deafualt state).Each screen has the concept of the ideal state. The only additional step in the subVIs is that when the ideal state is reached and the time has expired then it will close the subVIfront panel.It will go to the exit state of the Main(top level) VI. Thus closing the application and quitting LabVIEW.Any ideas or suggestions. Will multithreading and notifiers help?TIARachana









    Attachments:







    Sanpshot_Of_Design.zip ‏75 KB

    DB:3.03:State Machine And Producer Consumer Design Patterns 3d

    Hi! In my application I am using state machine(for top level VI) and producer consumer(for subVIs) design patterns throught out.If there is no activity on the front panel for 1min then the ideal state is invoked. Following are the situation of the ideal state:1. It checks for any hardware present on the network . If no hardware is found on the network within 1 min then the application and LabVIEW exits.2. While the ideal state checks for the hardware, and user clicks on any front panel button then it should exit the ideal state. The controlshould be in the respective button state.I am able to achive the point#1 mentioned above but could not get the point #2 to work. I am including the snap shot of the state machine(default case) and prouducer consumer(deafualt state).Each screen has the concept of the ideal state. The only additional step in the subVIs is that when the ideal state is reached and the time has expired then it will close the subVIfront panel.It will go to the exit state of the Main(top level) VI. Thus closing the application and quitting LabVIEW.Any ideas or suggestions. Will multithreading and notifiers help?TIARachana









    Attachments:







    Sanpshot_Of_Design.zip ‏75 KB

  • RELEVANCY SCORE 3.01

    DB:3.01:Acquiring Data Serially With A Producer Consumer Loop 99


    I am fairly new to LabVIEW and am working on a project where I need to continually read data from a serial port and process the data in nearly real time. I have researched the producer consumer architecture, however I am not sure if it is feasible for what I am attempting to do. The data collected from the serial port is in a 1D string array where I will search the string for the first occurrence of the packet type byte. The packet type byte will be 0x00, 0x01, or 0x02, and after i find this byte i must check the following byte which contains the packet length to ensure that I am at the beginning of the message. If this starting point is invalid, i must pass this index to another state where I begin searching for the packet type byte beginning at the new index. After the valid starting point has been found i must parse the data and look at the next byte to continue parsing until I can no longer parse the message. Whatever data is left at the end of the message that can not be parsed into a complete packet must then be concatenated to the beginning of the new data that will be read from the serial port.Does anyone have any suggestions at the approach i should take and is the producer/consumer architecture the right choice? I read about the queued state machine architecture, however some of it seems like it is unnecessary for this application. Should i be using a state machine since the data can be parsed into 3 different types of packets?ThanksGary Still

    DB:3.01:Acquiring Data Serially With A Producer Consumer Loop 99

    In the example shown to me above, there is a case structure which is true or false based on the dequeue element timing out. This is in the consumer loop. Can I create a state machine within this case structure for parsing my data, since it can be parsed into 3 different types of data packets? I was thinking this may work as long as my last state exits the state machine each time it is finished so the outer while loop (consumer loop) can dequeue the next chunk of data.A flowchart of what the state machine within the true/false case structure would look like is attached below.









    Attachments:







    parsing_flowchart.JPG ‏202 KB

  • RELEVANCY SCORE 3.00

    DB:3.00:Producer Consumer Problem Using Sockets mp


    Hello,
    Can anybody help me how to implement the Producer Consumer Problem using java sockets? Or any resources you've, pls forward it to me

    Cheers.

    DB:3.00:Producer Consumer Problem Using Sockets mp

    Neg wrote:
    You just tell me if there is any means to do it.Yes, Just use a fixed length ArrayBlockingQueue on either end (or both ends) Use offer() to offer more data and this will return false when the queue is full.
    Note: the use of a Socket is entirely optional.

  • RELEVANCY SCORE 2.97

    DB:2.97:Advanced Producer Consumer Architecture cd



    Dear all,

    I am working on an application in which I have to process large amounts of data obtained from a data acquisition system (blocks of ~ 30MB coming in at a rate of 5 times per second). There's quite a bit of hardware involved (2 synced data acquisition boards, 5 DAQmx USB interfaces, etc.). The data processing involves a lot of FFTs and interpolations and is computationally intensive.

    I already have a first version running, but I would like to strip it from all the unnecessary stuff that was added for testing purposes and optimize it for performance.

    Even although I have a good idea of the possibilities (I like to think I have),I'm struggling with many questions and I'm a bit lost how to tackle this problem.I was hoping you could point me in the right direction.

    First of all:The data packages come from 11 channels, 1.25MS each, 2 bytes per sample and are (currently) converted to DBLs for further processing.I have a powerful workstation with 2 CPUs (Xeon 5660, 6 cores each) and 24 GB of RAM, but I'm not sure the data processing can keep up with the data acquisition. I figured a producer consumer architecture would be the best approach to this problem. Is this correct?

    Secondly: What is the best way to handle these large data sets? I have used lossy queues so far (to prevent memory overflow), but I was thinking of using queues in combination with DVRs, so I can process the data in it's own memory space, without creating copies.

    Thirdly: Currently I see large changes in CPU usage. Is it possible to somehow dynamically direct more processing power to the data processing, if the system has idle threads?

    Fourth: Each process (consumer producer) needs configuration...at the start of the program, but preferably changes to this configuration can be made at run-tim. The producer requires settings for the data acquisition system and peripheral hardware used in the system. The consumer requires some files to be loaded and calculations to be performed on these files, before the actual data processing can begin.

    At the moment, both producer and consumer loop run a state machine with, in the Idle state, an Event Case. The Event Cases handle changes to settings or the loading of files if the appropriate buttons on the front panel are pressed.This results in a huge frontpanel with many different controls. I doubt that the huge front panel and specially the event cases in both the producer and consumer loops are best practice.Is it possible to handle all this in for example a separate GUI thread, which opens the appropriate configuration panel if requested from a menu bar and performs the necessary actions?

    And if this is possible: how do I make sure the settings become available in the appropriate process? And how do I get access to handles to my data acquisition hardware in both the GUI and producer loop without wires going all over the place?

    I think I will leave it at this for now, more questions might come up later. I'm not looking for complete solutions, but a couple of pointers in the right direction are very welcome. Hope you can help.

    Thanks in advance!

    Milan

    DB:2.97:Advanced Producer Consumer Architecture cd


    I would keep them separate and using messaging to indicate the configuration changes. Each of your tasks should be focused on a particular task. Things can start to get messy when you spread the stuff around. Also, keeping them separate means it is easier for you to change the UI, run headless or change your processing tasks without impacting other parts of your system.




    Mark Yedinak"Does anyone know where the love of God goes when the waves turn the minutes to hours?"Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • RELEVANCY SCORE 2.96

    DB:2.96:Timeout In Event Structure Doesn't Occur 1d



    Hey there,

    I've a producer consumer structure in which one event triggers a sequence contained in a state machine (the other events trigger a state that immediatly shuts it down). This state machine enqueues new parameters at specific intervals (set by timers that the user can specify). The idea is that, if the timeout occurs, the event structure enqueues the new value and the state machine switches over to the next step in the sequence (that I haven't filled out yet). If I hit "stop", the event structure sends out "stop method" to the state machine and the whole loop finishes executing after queueing "stop". But for some reason, the event structure doesn't time out, can anybody tell me why?

    Have a nice day.










    Attachments:






    QSM PC 1.0 MAIN.vi ‏48 KB

    DB:2.96:Timeout In Event Structure Doesn't Occur 1d


    I think your challenge already is with defining components in your software.

    Each loop in your code can be understood as a single component of the software (architecture). So the first task for development is to define the components you require to build your complete software architecture.

    Each component should have a single task and a single interface.

    In your case, you have two components (both 'producer') which refer to the same interface: The UI. This is not recommended because of possible race conditions, deadlocks and other unpredictible occurrances of issues.

    Please try, using pen and paper if necessary, to split your whole application requirements into components where you can define flow charts or "behavioral diagrams" to identify possible redundancies and interaction between components. If you find those, the design of your components is no good.

    If the design is free of redundancies, chances are high to get a robust software.

    Long story short:

    - Avoid using multiple event structures in a single VI as beginner of LV!

    - Avoid using event structures within case structures as long as you are not aware of possible pitfalls!

    Norbert




    ----------------------------------------------------------------------------------------------------CEO: What exactly is stopping us from doing this?Expert: GeometryMarketing Manager: Just ignore it.

  • RELEVANCY SCORE 2.95

    DB:2.95:Servicebus Over Amqp/Qpid Client Closes Consumer ax


    Hi,
    We have on-premise installation of ServiceBus and Java JMS QPID client 0.26. It seems that there is bug in SB - it sends END command to consumer when producer closes connection. Both producer and consumer must run on the same machine.
    First start consumer that listens on a queue:
    static void consumeFromQueueForStackOverflow(Connection connection, Context context)
    throws JMSException, NamingException, InterruptedException {
    Session session = null;
    MessageConsumer consumer = null;
    long RECEIVE_TIMEOUT_MS = 30000;

    try {
    session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);

    Queue queue = (Queue) context.lookup(JBA_QUEUE);
    consumer = session.createConsumer(queue);

    connection.start();

    int consumed = 0;
    while (true) {
    long startMS = System.currentTimeMillis();
    Message message = consumer.receive(RECEIVE_TIMEOUT_MS);
    if (message != null) {
    consumed;
    message.acknowledge();
    continue;
    }

    long durationMS = System.currentTimeMillis() - startMS;
    if (durationMS RECEIVE_TIMEOUT_MS) {
    log.info(String.format(
    Connection is closed, timeout: %d[ms], waited: %s[ms] (consumed: %d),
    RECEIVE_TIMEOUT_MS, durationMS, consumed));

    break;
    }

    log.info(String.format(Receive timeout, retrying (consumed: %d), consumed));
    consumed = 0;
    }
    } finally {
    connection.stop();

    if(null != consumer)
    consumer.close();
    if(null != session)
    session.close();
    }
    }
    Then post 1 message to the queue:
    static void publishToQueueForStackOverflow(Connection connection, Context context)
    throws JMSException, NamingException, InterruptedException {
    Session session = null;
    MessageProducer producer = null;

    try {
    session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

    Queue queue = (Queue) context.lookup(JBA_QUEUE);

    producer = session.createProducer(queue);
    producer.setDeliveryMode(DeliveryMode.PERSISTENT);

    TextMessage message = session.createTextMessage(My Message);
    producer.send(message);
    } finally {
    if(producer != null)
    producer.close();
    if(session != null)
    session.close();
    }

    log.info(String.format(Sent %d messages, count));
    }
    As soon as the producer process ends, the consumer will end too with waiting time smaller then timeout. The receive(timeout) method returns null prior to timeout expiration meaning (javadoc) message consumer is concurrently closed. Alternatively
    you may see IllegalStateException: Closed during call to acknowledge().
    Here is log from consumer. You can see that server sent unexpected End{} to client:

    RECV[5671|0] : Open{containerId=087d0b7b8a8e4809a686f8b20d5376f5_GPRGXIT002,maxFrameSize=65536,channelMax=255,idleTimeOut=240000}
    SEND[5671|0] : null
    SEND[5671|0] : Begin{nextOutgoingId=0,incomingWindow=2048,outgoingWindow=2048,handleMax=4294967295}
    SEND[5671|0] : Attach{name=IntegrationServiceBus/jba_testing_queue- (48ff030e-c7be-42b2-9c22-4d0db13aec8f),handle=0,role=receiver,sndSettleMode=unsettled,rcvSettleMode=first,source=Source{address=IntegrationServiceBus/jba_testing_queue,durable=none,expiryPolicy=link-detach},target=Target{}}
    RECV[5671|0] : Begin{remoteChannel=0,nextOutgoingId=1,incomingWindow=2048,outgoingWindow=2048,handleMax=7}
    RECV[5671|0] : Attach{name=IntegrationServiceBus/jba_testing_queue- (48ff030e-c7be-42b2-9c22-4d0db13aec8f),handle=0,role=sender,sndSettleMode=unsettled,rcvSettleMode=first,source=Source{address=IntegrationServiceBus/jba_testing_queue,durable=none,expiryPolicy=link-detach},target=Target{},initialDeliveryCount=0,maxMessageSize=262144,properties={com.microsoft:tracking-id=087d0b7b8a8e4809a686f8b20d5376f5_GPRGXIT002_BPRGXIT003;2411:54:55}}
    SEND[5671|0] : Flow{nextIncomingId=1,incomingWindow=2048,nextOutgoingId=0,outgoingWindow=2048,handle=0,deliveryCount=0,linkCredit=100,drain=false,echo=false}
    RECV[5671|0] : Transfer{handle=0,deliveryId=0,deliveryTag=\x84\xb8.\xf5\xda3\xafF\x89J\x1bj\xda{,messageFormat=0,more=false,batchable=true}
    RECV[5671|0] : End{}
    SEND[5671|0] : Detach{handle=0}
    SEND[5671|0] : Disposition{role=receiver,first=0,last=0,settled=true,state=Released{}}
    SEND[5671|0] : End{}
    SEND[5671|0] : End{}
    SEND[5671|0] : Close{}
    RECV[5671|0] : Close{}

    Can anybody help us with this issue?
    Thanks a lot,

    DB:2.95:Servicebus Over Amqp/Qpid Client Closes Consumer ax

    Hi Markus,
    This workaround works, correct syntax is:sync_publish=’all’.
    Thanks for your help.
    Best regards,
    Jiri

  • RELEVANCY SCORE 2.95

    DB:2.95:State Machine And Producer Consumer Design Patterns 3s


    Hi! In my application I am using state machine(for top level VI) and producer consumer(for subVIs) design patterns throught out.If there is no activity on the front panel for 1min then the ideal state is invoked. Following are the situation of the ideal state:1. It checks for any hardware present on the network . If no hardware is found on the network within 1 min then the application and LabVIEW exits.2. While the ideal state checks for the hardware, and user clicks on any front panel button then it should exit the ideal state. The controlshould be in the respective button state.I am able to achive the point#1 mentioned above but could not get the point #2 to work. I am including the snap shot of the state machine(default case) and prouducer consumer(deafualt state).Each screen has the concept of the ideal state. The only additional step in the subVIs is that when the ideal state is reached and the time has expired then it will close the subVIfront panel.It will go to the exit state of the Main(top level) VI. Thus closing the application and quitting LabVIEW.The application is designed for PDA using LabVIEW 7.1.Any ideas or suggestions. Will multithreading and notifiers help?TIARachana









    Attachments:







    Sanpshot_Of_Design.zip ‏75 KB

    DB:2.95:State Machine And Producer Consumer Design Patterns 3s

    Hi Rachana,I was thinking about using event structures wherein there would an event case that would handle any value change event for any of the buttons on the front panel. But before suggesting that, I would need to know more about the Ideal State subvi( more specifically, how is it checking for any hardware present on the network and where is the one minute wait coming from?). Please feel free to respond to this post with your questions/comments.Regards,Ankita A.

  • RELEVANCY SCORE 2.94

    DB:2.94:Producer - Consumer Problem mc


    Hi,
    Can anyone tell me what is the problem with the below program. Its following the traditional producer consumer concept. For the first time the producer is executed correctly , followed by the consumer printing the consumed value. But for the next time, its hanging at the producer wait loop.
    Thanks in advance,

    Cochu

    DB:2.94:Producer - Consumer Problem mc

    Hi All,
    I found out the problem. Actually I forgot to put the getShared() method in loop!!!

    Cochu

  • RELEVANCY SCORE 2.90

    DB:2.90:Producer Content Is Not Visible In Consumer Portal In Fpn 9f



    Hi All,

    we have configured FPN and the connection is successful, but we are not able to see the Producer content in Consumer portal.

    and we are not able to search the producer roles from Identity Management of Consumer also.

    We did,

    1. we configured trust between two portals.

    2. Registered Producer.

    3. Remote_role with actions aslo added in Producer.

    Thank you.

    DB:2.90:Producer Content Is Not Visible In Consumer Portal In Fpn 9f


    Hi

    Have you set the permission for the remote RRA? Once you do this you should be able to successfully establish fpn. See this link [Setting Permissions on the Producer for 'Remote Role Assignment' |http://help.sap.com/saphelp_nw04s/helpdata/en/43/2236fc0b413fe1e10000000a11466f/content.htm]

  • RELEVANCY SCORE 2.90

    DB:2.90:Queued State Machine With Producer Consumer 38



    Hello, I am trying to build a VI where the user enables some boolean controls on the front panel. The VI uses a producer consumer architecture wherein based on the booleans clicked, certain states get queued an saved into an array. After the user is done selecting, the booleans should get disabled and the array of states should be indexed one after the other. This is an attempt to solve the car wash sample exam. However, the VI is not generating the required results. Can someone please help me figure out what is the correct way to implement this. Thanks,

    --






    Solved!
    Go to Solution.

    DB:2.90:Queued State Machine With Producer Consumer 38


    I have tried to debug it but am stuck at one stage..

    I am not able to get the timer to count up continuously. The states get queued alright, but the timer just counts to some randome time

    and then the code seems to halt.

    Can anyone please help me debug ?










    Attachments:







    Queued SM_Sprinkler.vi ‏39 KB

  • RELEVANCY SCORE 2.89

    DB:2.89:String State Machine Not Working jz



    I have a producer/consumer architecture, and am having problems with the state machine recognizing the new state.

    According to the probe, when the event structure triggers, the input into the case selector is:

    "HV OFF

    "

    (with the carriage return), but the case is called "HV OFF".

    My strings are combined into an array with the build array function.

    One of the states is working correctly, and the probe shows the state into the case selector is "serial number" with the ending quote on the same line.

    Has anyone encountered this?




    metzler CLAD

    DB:2.89:String State Machine Not Working jz


    Thanks for the detailed information about how to show the slash codes, and how to change to a type def'd enum. I know this little example vi does not have the stop wired -this was just aquick example of my code.




    metzler CLAD

  • RELEVANCY SCORE 2.88

    DB:2.88:Info Needed On Web Services Using Jbossesb sj



    Hello,I have created web service by following couple of examples provided within ESB's quickstarts directory.I have got both web service producer and consumer that consumes this web service running on a single machine.Now what i want to do is to run web service producer on one machine and consumer on the other machine so that they can communicate over a single esb channel.How do i do this ? I am quite new to this area and correct me if i have gone wrong somewhere ?ThanksR.Naik

    DB:2.88:Info Needed On Web Services Using Jbossesb sj


    Hi,First of all let me thank you for the reply.As you said i entered proper machine details within jboss-esb.xml for web service producer.Web service producer:==============The machines name where the web service hosted is : ie10dtcgs4ks1sAnd accordingly its jboss-esb.xml file contents are as follows?xml version = "1.0" encoding = "UTF-8"? jms-provider name="JBossMQ" connection-factory="ConnectionFactory" jndi-context-factory="org.jnp.interfaces.NamingContextFactory" jndi-URL="ie10dtcgs4k1s" jms-bus busid="quickstartEsbChannel" jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_webservice_consumer1_esb" / /jms-bus /jms-provider jms-listener name="JMS-ESBListener" busidref="quickstartEsbChannel" maxThreads="1" /Web service consumer:===============Now the consumer is running in different machine and in its jboss-esb.xml file i have provided web service producer's m/c details so that it can retrieve data from web service hosted producer machine.But when i tried running the consumer i got following errors :( [java] 17:24:09,359 DEBUG [main][NamingContext] Failed to connect to ie10dtcgs4k1s:8080 [java] javax.naming.CommunicationException: Failed to retrieve stub from server ie10dtcgs4k1s:8080 [Root exceptionis java.io.EOFException] [java] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:263) [java] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1387) [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:596) [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589) [java] at javax.naming.InitialContext.lookup(InitialContext.java:351) [java] at org.apache.ws.scout.transport.RMITransport.send(RMITransport.java:80) [java] at org.apache.ws.scout.registry.RegistryImpl.execute(RegistryImpl.java:271) [java] at org.apache.ws.scout.registry.RegistryImpl.findTModel(RegistryImpl.java:793) [java] at org.apache.ws.scout.registry.BusinessQueryManagerImpl.findClassificationSchemeByName(BusinessQueryManagerImpl.java:440) [java] at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findService(JAXRRegistryImpl.java:488) [java] at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:338) [java] at org.jboss.soa.esb.listeners.RegistryUtil.getEprs(RegistryUtil.java:216) [java] at org.jboss.soa.esb.client.ServiceInvoker.loadServiceClusterInfo(ServiceInvoker.java:351) [java] at org.jboss.soa.esb.client.ServiceInvoker.(ServiceInvoker.java:114) [java] at org.jboss.soa.esb.client.ServiceInvoker.(ServiceInvoker.java:137) [java] at org.jboss.soa.esb.samples.quickstart.webservice_consumer1.test.SendEsbMessage.sendMessage(SendEsbMessage.java:42) [java] at org.jboss.soa.esb.samples.quickstart.webservice_consumer1.test.SendEsbMessage.main(SendEsbMessage.java:61) [java] Caused by: java.io.EOFException [java] at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2228) [java] at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2694) [java] at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:761) [java] at java.io.ObjectInputStream.(ObjectInputStream.java:277) [java] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:250) [java] ... 16 more [java] javax.naming.CommunicationException: Could not obtain connection to any of these urls: ie10dtcgs4k1s:8080 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to retrieve stub from server ie10dtcgs4k1s:8080 [Root exception is java.io.EOFException]] [java] at org.apache.ws.scout.transport.RMITransport.send(RMITransport.java:91) [java] at org.apache.ws.scout.registry.RegistryImpl.execute(RegistryImpl.java:271) [java] at org.apache.ws.scout.registry.RegistryImpl.findTModel(RegistryImpl.java:793) [java] at org.apache.ws.scout.registry.BusinessQueryManagerImpl.findClassificationSchemeByName(BusinessQueryManagerImpl.java:440) [java] at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findService(JAXRRegistryImpl.java:488) [java] at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:338) [java] at org.jboss.soa.esb.listeners.RegistryUtil.getEprs(RegistryUtil.java:216) [java] at org.jboss.soa.esb.client.ServiceInvoker.loadServiceClusterInfo(ServiceInvoker.java:351) [java] at org.jboss.soa.esb.client.ServiceInvoker.(ServiceInvoker.java:114) [java] at org.jboss.soa.esb.client.ServiceInvoker.(ServiceInvoker.java:137) [java] at org.jboss.soa.esb.samples.quickstart.webservice_consumer1.test.SendEsbMessage.sendMessage(SendEsbMessage.java:42) [java] at org.jboss.soa.esb.samples.quickstart.webservice_consumer1.test.SendEsbMessage.main(SendEsbMessage.java:61)Please help me

  • RELEVANCY SCORE 2.88

    DB:2.88:Programmatically Create New Consumers In A Qsm ac



    Howdy, I'm struggling with a concept for a QSM setup. Say I have a main VI composed of a single producer and single consumer sharing one queue, which can be populated by inputs/actions from the main VI's front panel. The consumer's sub-VIs call by reference reentrant VIs each of which open their own front panels and run their own QSM or other state machine until closed by the user. This occupies the main VI's consumer until the loaded VI is closed, as the consumer would be waiting for the output of the call by reference node, even though the called VI may not have any outputs. So the main VI would be able to queue further elements, but those elements wouldn't be excecuted until the first element's execution completed (the called VI), and further input from the main VI's front panel wouldn't be executed until the new front panel was closed.

    To fix this, I figured adding more consumers (with the same sub-VIs) to the same producer, creating new queues for each consumer, and then when a new element is added from the event structure in the producer, it would poll each queue looking for a queue (and thus a consumer) with zero elements queued and add the new queues to that. This should ensure that if more main VI front panel events occured, they would execute even with another front panel open.

    But this means I can only have as many windows open as I do consumers in my main VI. My question is, is there a way to call a VI in such a way that it does not occupy the while loop containing its call by reference node until the called VI's front panel is closed?

    Thank you in advance!







    Solved!
    Go to Solution.

    DB:2.88:Programmatically Create New Consumers In A Qsm ac


    Thanks very much, I'll also try the asynchronous call feature!

  • RELEVANCY SCORE 2.87

    DB:2.87:State Machine Lost State jm



    Hello!

    I have a producer/consumer pattern mixed with state machine in the consumer. I'm saving data to TDMS file with that structure. I would like to add a button, which would go to a state New File, to close the current file and continue saving into a new one. I created the state, in which I close the previous file, and try to open a new one, but when I click on the button nothing happens. The strange thing is, when I press the button the new state shows at the END of the while loop (in the shift register), but after it goes to the NEXT new iteration, the shift register has the old state in it, so that I miss the new state.

    What do I do wrong? Where should I place the button, to make the state change?

    Thank you in advance!

    DB:2.87:State Machine Lost State jm


    Well, I don't see it, that's why I don't understand.




    LabVIEW Champion . Do more with less code and in less time .

  • RELEVANCY SCORE 2.87

    DB:2.87:Eclipse Vs Console Output Help s1


    Well i have this program of producer consumer where bith classes share a common data class and both producer consumer have a thread implemented to have their respective functionality... here is the data class

    public class Data {

    private String content;
    private boolean avaliable=false;

    synchronized public void putContent(String part){
    if(avaliable==true){
    try{
    wait(1000);
    }catch(InterruptedException ie){
    ie.printStackTrace();
    }
    }
    content=part;
    avaliable=true;
    notifyAll();
    }
    synchronized public String getContents(){
    while(avaliable==false){
    try{
    wait(1000);
    }catch(InterruptedException ie){
    ie.printStackTrace();
    }
    }
    avaliable=false;
    return content;

    }
    }Now here both the producer consumer threads access the synchronized methods, now when i run the whole program through command line in console iam getting requried result , but when iam running same thing in eclipse its not synchronizing and ouptut isnt coming correct.... i wonder what the reason could be, anyone who can help me through this? Thank you

    DB:2.87:Eclipse Vs Console Output Help s1

    never rely on threads running in any particular order or sequence.
    You'll need to guard against the queue being in a state either producer or consumer can't handle explicitly by checking if it's for example empty and going back to sleep if it is.

  • RELEVANCY SCORE 2.86

    DB:2.86:Weblogic Topic - Producer In Weblogic Ps2 And Consumer In Ps5--Messag Bridg 7d


    Hi All,

    Our Requirement is:
    1. We have a JMS Topic in Weblogic PS2 (http://d812-soa-01d:7001/console domain soa_domain).
    2. There is a producer(SOA Composite) deployed in Weblogic PS2.
    3. There is a consumer (SOA Composite) deployed in Weblogic PS5 (http://d812-soa-01d:8001/console domain soa_domainps5).

    We are able to produce the message to Topic from producer. But, consumer in PS5 is not consuming it.

    I have tested by creating a dummy consumer2 in PS2 and it can consume the message.

    Problem here is both PS2 and PS5 are on same physical machine except that the port and domains are different.

    Do i have to use Mesaging bridge in this requirement, if yes could any one please explain me the messaging bridge.

    Thanks...

    Edited by: 947423 on Feb 14, 2013 4:12 AM

    DB:2.86:Weblogic Topic - Producer In Weblogic Ps2 And Consumer In Ps5--Messag Bridg 7d

    I don't think you have to use the messaging bridge feature to achieve your goal, although it is an alternative. Remote consumption should work between a client that is running on a newer release and a server that is running on an older release.

    Is there any error message or exception on either side? You need to check the server log files. You can also turn on debugging and see if the debugging messages give any clue on what is going on.
    -Dweblogic.debug.DebugJMSFrontEnd=true
    -Dweblogic.debug.DebugJMSBackEnd=true

    Meanwhile there are a couple of things that you can check and try:
    1. make sure that all resources (WL server, JMS server and stores) are uniquely named cross the two domains
    2. if the resources are secure, make sure the security configuration of the SOA component is correct
    3. make sure that you consumer component is up running before your producer sends any messages unless you are using durable subscribers
    4. you can run the same application on two domains that both run the same WL release and see if the behavior is different.

    The following link contains information about the messaging bridge in case you would like to know it better.
    http://docs.oracle.com/cd/E17904_01/web.1111/e13741/toc.htm

    Regards,
    Dongbo

  • RELEVANCY SCORE 2.86

    DB:2.86:Producer Consumers Questions da



    I am developing an application that reads and processes serial data from a prototype device. The data is transferred from my device at 160 Hz and is comprised of about 200 bytes of data. Each data packet has header, data, and checksum bytes. A illustration of my data packets would be the following: [Header bytes][Data bytes][Checksum bytes].

    The main design pattern I am using in my application is the producer consumer design pattern. The producer reads in the data byte-by-byte (via VISA Read) and enqueues it for the consumer loop. The consumer loop dequeues the data byte-by-byte and then passes each byte through a state machine that finds the header, forms the data bytes into an array, and then finally parses, processes, and saves the data. The states of my state machine are: find header, build packet array, and process and save.

    I've used this approach in the past and it has always worked for me, but I've always wondered if it is the best solution for this type of application. Are there better solutions out there? Reading and processing data in byte-by-byte doesn't seem like a good idea, but it is simple and straightforward.

    I have been considering pushing all of the parsing, checking, processing, and saving into a third loop. In this approach, my current consumer would act as both a consumer and a producer. It would consume data by finding packet headers and building data packet arrays, and it would produce data by enqueuing data packet arrays for a new, second consumer loop. The reasoning behind this approach is that it would separate tasks and allow me to only have to change the second consumer for different projects that use my base hardware. Is this kind of approach reasonable or is it too complex and/or ill advised?

    DB:2.86:Producer Consumers Questions da


    Will something like this work?

    It looks like it should, but Match Regular Expression is throwing null character errors.










    Attachments:







    full.png ‏94 KB

  • RELEVANCY SCORE 2.85

    DB:2.85:Re-Start Producer While Loop fx



    Hi,

    I'm trying to figure out the best way to implement a producer/consumer architecture. I'm hoping there is something simple that I don't understand.

    I have a state machine executing in it's while loop, doing things like saving and processing data. The data is being passed through a queue from a separate while loop. I'm currently starting that producer loop using occurrences, and I can stop it with a local variable.

    What I can't figure out is how to restart that loop from within the state machine? In essence, I'd like to have a switch that says "Collect Data" and it will turn the producer while loop on and off but leave the main program running in the meantime.

    Thanks for any suggestions.

    mike

    DB:2.85:Re-Start Producer While Loop fx


    Thanks very much for all the help. I've spent a lot of time reading about action engines and it's been very informative.

    cheers,

    mike

  • RELEVANCY SCORE 2.85

    DB:2.85:Advice On Restructuring Code To Prevent Slowdown Over Time zp



    Hi there, I am a new LabView user looking for advice on how to better structure this program I wrote that is used to run a hydrostatic test fixture. Data is collected on a cDAQ 9207 AI module and a cDAQ 9474 DO module is used to control two solenoid valves which subsequently controls pressure into and out of the test chamber. I have attached my initial version of the code for reference.

    What the VI is suppose to do is when the user arms the system and subsequently hits the run switch, the program will transition the test chamber through several states corresponding to different pressure levels for certain durations. The pressure vs time plot is written to a measurement file. I built this using a state machine structure.

    My problem is, during initial testing, when the test duration was roughly 5 minutes or so, the program ran fine. However, once I started testing at actual test duration of 2.5 hours, I noticed the program running slower and slower as time progressed to the point where it would take several seconds for each loop iteration and eventually crash about an hour or so into the test. After scouring articles and posts, I suspect the primary culprit is the waveform chart and to a lesser extent the DAQ assistant.

    While I need the data collection and case structure loop to run relatively rapidly (preferably on the order of a few hundred S/s) as I need the code to be able to react to changing pressure in the chamber pretty quickly, the actual data I need to store and display on the chart can be as slow as one sample every second or even longer. My guess at this point is I should rebuild the program using a some sort of producer/consumer architecture so I am looking for some advice on how best to structure the program.

    The data acquisition obviously belongs in the producer loop that'll run at a pretty fast clip and there will be a consumer loop that will run at a much slower rate for the chart display the write to measurement file vi, but where should I put the case structure state machine that currently controls the valves? Should that be put in the producer loop since it should run at the same fast rate as the data collection so it can react to changes in pressure or should I build another consumer loop for it? What about the other indicators (pressure and bolean) and controls on the front panel, should they be on another loop running at some intermediate speed as I want them to react at a faster rate than the chart/data write loop but they don't need to be as fast as the DAQ loop?

    Finally, I am not quite sure what the best way would be to reduce the sampling rate of the data that I actually display on the chart and store into file, it wouldn't make sense to create another measurement task that samples at a lower rate just for that purpose. Any suggestions and advice would be greatly appreciated! Thanks in advance!

    Bob







    Solved!
    Go to Solution.

    DB:2.85:Advice On Restructuring Code To Prevent Slowdown Over Time zp


    Have a look at the following article, helped me alot

    optimise memory usage

    Hope it helps

    TD




    Please remember to accept any solutions and give kudos, ThanksLV 8.6.1, LV2010,LV2011SP1, FPGA, Win7

  • RELEVANCY SCORE 2.85

    DB:2.85:Instr. And Daq Assistants - Time To Take Off The Training Wheels? xf


    Hi everyone,I have written a control system program using a producer/consumer with state machine architecture - textbook LabVIEW beginner intermediate.In the producer, I have 6 different DAQ assistants taking AI and DI data from PXI mounted data acquisiton cards and two Instr. Assistants taking data from PXI serial ports. In the consumer, I have a similar situation. There are 7 DAQ assistants sending digital and analog requests to 3 different PXI chassis and one Instr. asssistant sending requests to a PXI serial port. Is this frowned upon? Would any of you pros call this a finished job if it is still bound with Assistants? I have looked at the code involved in making these assistants into LabVIEW code (writing them out, so to speak), but it is complex and I haven't been able to put in the time to learn all of the different DAQmx and VISA functions and subVI's. However, I have some difficulties that arise when, for instance, a component that is monitored/written to by a serial port is turned to manual control and the assistant times out. It times out the entire control system, which is not desirable. Is the fix in error handling, or getting rid of the assistants altogether?Any responses are appreciated - even if you are the bearer of bad news!Brad

    DB:2.85:Instr. And Daq Assistants - Time To Take Off The Training Wheels? xf

    Hey CFAMS Brad,You can use Traditional DAQ and DAQmx in the same VI but not on the same device. Ie. You cannot use two drivers to access the same device. So if you had two boards in your computer, you could control one with Traditional DAQ and one with DAQmx from the same program. VISA is generally used for communicating with instruments. So if you wanted to use VISA to communicate with the serial port and use DAQmx to acquire data from your DAQ board, it will not be a problem.CheersMalay DuggarNI

  • RELEVANCY SCORE 2.85

    DB:2.85:Problem With Dequeue, Preview Works Okay dd


    Hi there,I am trying to use the Queued State Machine - Producer Consumer design in LabView 8.2. It is overkill for my application but I'm using it deliberately as a learning tool...As you can see in the image attached, the subvi tries to initialise the serial port/device. At the moment it's not connected so it generates an error. The queue manager correctly adds the ERROR state to the front of the queue. I dropped in a preview queue block and I see that it is there at the front of the queue.On the next loop iteration, I expect the dequeue element block to dequeue the state ERROR off the queue. However it doesn't, it removes a dummy state called 'startup'. This is the default state of the state machine.If I drop a preview queue block into the vi at the same point as the dequeue element, it correctly shows that the ERROR state. I can preview the correct element, but not actually dequeue it. I therefore of course never go to the ERROR state.I hope this makes sense, please can anybody offer any advice? It would be very much appreciated.Best regards,Martin









    Attachments:







    subvi1.PNG ‏46 KB

    DB:2.85:Problem With Dequeue, Preview Works Okay dd

    Martin,the link you provide here seems very elaborate on the matter and covers quite many features. But without reading it, i am wondering why the dequeue is not connected with the error handler. I would think that the originator ran inot the same issue like you did and decided to drop this dequeue out of error handling. This is not correct in regard of proper (stable) programming, but might be suitable for a whitepaper like this.For the application itself, i'd suggest you to observe the errors very closely and decide how to react on them. The originator of the whitepaper already gave one example for a possible error, but there could be more.hope this helps,NorbertPS: Please don't pass wires behind structures!



    ----------------------------------------------------------------------------------------------------CEO: What exactly is stopping us from doing this?Expert: GeometryMarketing Manager: Just ignore it.

  • RELEVANCY SCORE 2.85

    DB:2.85:Behaviour Of Session.Client_Acknowledge When The Producer And Consumer Are In Different Timezones c3



    Is there any known issue in JBossMessaging when the producer is at a future date than the consumer in session.CLIENT_ACKNOWLEDGE mode? We observe that the socket between the producer and consumer gets closed in this scenario.

    We are using JBossAS4.2.3 with JBossMessaging 1.4.4 on Linux.

    Thanks,

    kusuma

    DB:2.85:Behaviour Of Session.Client_Acknowledge When The Producer And Consumer Are In Different Timezones c3


    Is there any known issue in JBossMessaging when the producer is at a future date than the consumer in session.CLIENT_ACKNOWLEDGE mode? We observe that the socket between the producer and consumer gets closed in this scenario.

    We are using JBossAS4.2.3 with JBossMessaging 1.4.4 on Linux.

    Thanks,

    kusuma

  • RELEVANCY SCORE 2.85

    DB:2.85:Producer Consumer And Threads 8j


    Has anyone ever seen an example of a producer/consumer in which the producer cannot "produce" again until after the previous production has been "consumed" by the consumer? If so, I hope you can point me to it.

    Thanks

    DB:2.85:Producer Consumer And Threads 8j

    You mean something like this:

    public class ProducerConsumer{

    private boolean available = false;

    private String contents = null;

    public void setAvailable(boolean available){
    this.available = available;
    }

    public boolean getAvailable(){
    return this.available;
    }

    public synchronized void setContents(String contents){
    while(available){
    try{
    // wait for Consumer to get value
    System.out.println("Producer waiting");
    wait();
    } catch(InterruptedException e){
    e.printStackTrace();
    }
    }
    this.contents = contents;
    available = true;
    System.out.println("Produced: " + contents);
    notifyAll();
    }

    public synchronized String getContents(){
    while(!available){
    try{
    // wait for Producer to set value
    System.out.println("Consumer waiting");
    wait();
    } catch(InterruptedException e){
    e.printStackTrace();
    }
    }
    System.out.println("Consumed: " + contents);
    available = false;

    notifyAll();

    return this.contents;
    }

    public static void main(String[] args){
    ProducerConsumer pc = new ProducerConsumer();

    Producer p = new Producer(pc);
    Consumer c = new Consumer(pc);

    p.start();
    c.start();
    }

    }

    class Producer extends Thread{

    int counter = 0;

    private String[] data = {
    "Message 1", "Message 2", "Message 3", "Message 4", "Message 5",
    "Message 6",
    "Message 7", "Message 8", "Message 9", "Message 10"};

    private ProducerConsumer pc = null;

    private int mainCounter = 0;

    public Producer(ProducerConsumer pc){
    this.pc = pc;
    }

    public void run(){
    while(mainCounter 10){
    produce();
    mainCounter++;
    }
    }

    public void produce(){
    if(counter = data.length){
    counter = 0;
    }

    pc.setContents(data[counter++]);
    }

    }

    class Consumer extends Thread{

    private String contents = null;

    private ProducerConsumer pc = null;

    private int mainCounter = 0;

    public Consumer(ProducerConsumer pc){
    this.pc = pc;
    }

    public void run(){
    while(mainCounter 10){
    consume();
    mainCounter++;
    }
    }

    public void consume(){
    contents = pc.getContents();
    }

    }The same example can be found in the Java Tutorial:

    http://java.sun.com/docs/books/tutorial/essential/threads/synchronization.html

  • RELEVANCY SCORE 2.85

    DB:2.85:Updating Front Panel Controls In Producer Consumer 9c



    Hi,

    I wanted to ask for some advice.

    Usually when I implement a producer consumer I use the producer to create queue elements with an enum state and pack all the data necessary to process the event in a variant.

    Then the consumer does all the work.

    There are two areas where I feel like I might not be using the best approaches..

    1) When I have to update a front panel control I pack a reference to that front panel control into the variant so I can access the property nodes in the consumer and update it.

    I attached pictures with an example. It is simplified code where the user has to run some DAQ task while scanning some parameter. The code increases the parameter by a set amount with every run to aid the user in his scan.

    Is there any better way of doing this?

    2) When events require the same control to be wired into the variant for handling by the consumer loop I create local variables or references to that control in other events. Would it be better to have a shift register running through the producer loop that gets updated front panel values at every while loop iteration?

    Thank you.







    Solved!
    Go to Solution.

    DB:2.85:Updating Front Panel Controls In Producer Consumer 9c

    pulsed_power wrote:When events require the same control to be wired into the variant for handling by the consumer loop I create local variables or references to that control in other events. Is that a good approach?

    This is one of those perfectly acceptable places for a local variable, but only within the event structure. Just be careful if you are reading and writing with locals. That could get into a weird race condition based on when certain events are fired. I discourage the use of references unless you are setting more than just the value. They do cause thread swaps and slow down your program.




    There are only two ways to tell somebody thanks: Kudos and Marked Solutions

  • RELEVANCY SCORE 2.83

    DB:2.83:Producer Consumer a8



    How can the attached VI make use of producer consumer loop?

    That is the functioning will be done in one loop and getting the data that is writing it to the .csv file, how can it be done?







    Solved!
    Go to Solution.

    DB:2.83:Producer Consumer a8


    Have you read how a Produce Consumer pattern can work for you?

    http://www.ni.com/white-paper/3023/en




    Thoric (CLA, CLED, CTD and LabVIEW Champion)

  • RELEVANCY SCORE 2.83

    DB:2.83:Pid Control In Producer/Consumer Mode ? 73



    Hello guys,

    Could i use pid control in producer/consumer mode ?

    Now in our lab, we use pid control the fuel pressure in producer/consumer mode.

    I put the data acquisition in the producer loop and the pid control in consumer mode.

    I found there will be delay between the value acquired in the producer loop and the value sent to pid.

    Is that because there are delay between the producer/consumer ?

    Thanks.

    DB:2.83:Pid Control In Producer/Consumer Mode ? 73


    Hi Proven

    Thank you for your post.

    I already sloved this problem.

    Yes, you are right put the producer loop and the PID loop in one loop the problem will be solved if they run at the same rate.

  • RELEVANCY SCORE 2.82

    DB:2.82:Producer/Consumer Vs Master/Slave 8j


    In comparing the Producer/Consumer design pattern template to the Master/Slave, it appers to me the only difference between the two is one uses Notifiers and the other uses a Q.

    What are the pros and cons of this difference? Under what conditions would you choose one over the other?

    Thanks,
    Bill F

    DB:2.82:Producer/Consumer Vs Master/Slave 8j

    To add to Analog Kid's answer,an extract from defination of producer consumer pattern

    The Producer/Consumer design pattern is based on the Master/Slave pattern, and is geared towards enhanced data sharing between multiple loops running at different rates.As with the standard Master/Slave design pattern, the Producer/Consumer pattern is used to decouple processes that produce and consume data at different rates. The Producer/Consumer pattern’s parallel loops are broken down into two categories; those that produce data, and those that consume the data produced. Data queues (which are covered more in-depth in the Queued Message Handler section) are used to communicate data between loops in the Producer/Consumer design pattern. These queues offer the advantage of data buffering between producer and consumer loops.

    Regards

    Dev

  • RELEVANCY SCORE 2.82

    DB:2.82:Need For Speed - Property Nodes Are Killing Me! 9a


    Hi everyone,

    I am trying to manage a control system with a large number of controls
    that I want to act as indicators simultaneously. The system is a
    state machine in a consumer loop feeding from a data queue from a
    producer loop. I want this Producer to run at 10-20 Hz, meaning
    that the consumer has to be faster than this.

    I am wiring cases to the properties of the controls so that they change
    colors and blink etc when certain states occur in our system.
    This front panel design is desired so that several users can control
    the system in a straightforward manner. I have a created a state
    that I call "Draw Front Panel" where some queued data are accessed and
    compared to data from the "Process UI" state via shift register.
    As soon as I started implementing this state, the machine slowed down
    to a crawl. I have an indicator to tell me what state is active,
    and the "draw front panel" state is taking the most time. As a
    result, I build up a data queue and my indicators travel in time and
    become useless, even fraudulent, to the user.

    A few specific questions:
    Is there any faster way to do this than property nodes? I am
    aware of some other posts
    (http://forums.ni.com/ni/board/message?board.id=17​0message.id=153572query.id=48999#M153572)
    that deal with property node molasses. but the options seem
    limited.

    Is there a way to flush a data queue when the state machine gets held up in a certain state?

    Is there a difference in processing time for different
    properties? Why? Blinking seems the worse, and I have
    recently written my own blinker that is just as slow even though it
    only accesses the color property.

    Any help will be greatly appreciated.

    DB:2.82:Need For Speed - Property Nodes Are Killing Me! 9a

    Thank you Michael. This I don't understand. What if the properties are different, i.e. some buttons are red and some are green depending on the inputs coming from the consumer loop? Maybe I'm just not understanding what you are meaning by the thread swap.I have found that some of the overhead on the front panel was due to a large sized-picture that I had imported onto the panel. This of course was resized according to LabVIEW's resolution algorithm, and I guess that every time one button had to blink, the whole picture had to be redrawn. That meant that the UI state was redrawing this large picture 3 times in one frame if there were 3 blinking buttons. This problem was easily resolved once I changed the picture out (the picture is not interactive, it is just a sort of template). Now the VI is running between 5-10 Hz, which is close to where I want it to run.I still haven't tried the update front panel option because I am not sure what loop this belongs in.

  • RELEVANCY SCORE 2.82

    DB:2.82:Push Vs Pull Cluster Distribution kx



    It seems like in the current implementation of cluster distribution producer does distribution immedietly when a message is created. This means that a message is send to the consumer regardless of the speed that they can consume it with.

    It also means that once a message was delivered to consumer, even when additional consumer is added, the messages will not be redistributed.

    Am I missing something again?

    Is there a way to do distribution only on demand? When a consumer is ready to process it is pulling a message from producer.

    DB:2.82:Push Vs Pull Cluster Distribution kx


    Slow consumers (setting consumer-window-size to zero) just means that each consumer will not buffer any messages from a queue. This allows for deterministic round robining between multiple consumers on the same queue.

    Consumers simply connect to a local queue, they have no knowledge of any other nodes in the cluster.

    With a cluster connection - this is not a consumer connection. Each cluster connection is composed of a core bridge which forwards messages. This is currently done in a round robin fashion too.

    Like I mentioned before, there is no "pull" distribution of messages between nodes like there was in JBoss Messaging. It is strictly "push" round robin.

    Hope that answers your question

  • RELEVANCY SCORE 2.81

    DB:2.81:Shared Memory Usage Of Producer Consumer Problem jd


    Hai,

    I am able to write the Producer-Consumer problem as a interthread communication. But I don't know how to write it using shared memory. (i.e. I wish to start Producer and consumer as a different process). Please help me, sorry for the Temp file idea.

    Thanks
    MOHAN

    DB:2.81:Shared Memory Usage Of Producer Consumer Problem jd

    Hi.

    You should use RMI to notify threads running on different JVMs.

  • RELEVANCY SCORE 2.80

    DB:2.80:Jndi Setup f3



    Hello,I'm trying to run a simple JMS program. JBoss, the message producer, and the message consumer are all running in separate VMs on the same machine. When I run either the producer or consumer after starting JBoss, I get:"javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]"The "jndi.properties" file used by all 3 is the default:java.naming.factory.initial=org.jnp.interfaces.NamingContextFactoryjava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfacesAny thoughts on how to fix this?Thanks!

    DB:2.80:Jndi Setup f3


    That was it. Thanks Adrian!

  • RELEVANCY SCORE 2.80

    DB:2.80:In Topic : How To Regain The Messages If One Of The Consumer Is Down 8k



    Hi Team,

    Thanks for the support for my last question which was answer.

    I need one more clarification/suggestion.

    Assume that I am having 1 producer and 3 consumers in three different machines. As per topic, Consumer(s) has to be started before than Producer and should be running state.

    My question is, if one my consumer is down for any of the maintenance/other activity, then how come I regain the missing messages from the server.

    Thanks in advance.

    S

  • RELEVANCY SCORE 2.80

    DB:2.80:Passing Parameters From Wlp As A Consumer To Jboss As A Producer. cf


    Hi,

    I am trying to pass the parameters from WSRP portlet as a consumer to a Jboss producer.
    I have added a backing file and added the following code in it.

    SimpleStateHolder state = new SimpleStateHolder();
    state.addParameter("name", "data1");
    request.setAttribute(MarkupRequestState.KEY, state);

    Now when i am trying to get the state in the producer side , I am getting state as NULL
    the code written on producer side is

    SimpleStateHolder state = (SimpleStateHolder)request.getAttribute(MarkupRequestState.KEY);
    state.getParam......

    Please tell me if I am making any mistake or
    Please tell me if there is any other way to do this.

    Thanks
    V.K.Singla

    DB:2.80:Passing Parameters From Wlp As A Consumer To Jboss As A Producer. cf

    Thanks a lot Kevin

    I got a better understanding of the Data transfer from WLP consumer to Jboss Producer. I have marked it as answered.
    I have one more Question Overriding or Adding CSS on a remote portlet
    please check if you can help me that

  • RELEVANCY SCORE 2.79

    DB:2.79:Am I The Only Wierd One Here? z9



    I am studying for the CLD exam and doing the 4 sample exams...my problem is and I don't know if it is one to begin with: Is it wrong for me tocode the exam in a number of different flavors (producer/consumer,queue state machine, and state machine). I know there are many different ways to "skin a cat," am I thinking wierd here? How do I know which is the most correct way in styling a program. The different flavors mentioned are from complex to simple, so what I guess that I am saying here depends on what you need in solving an objective. Just my thoughts..

    DB:2.79:Am I The Only Wierd One Here? z9


    Not sure if you have seen this already, butfollow the belowlink to practicaladvice from an experienced person.

    http://labviewartisan.blogspot.com/2009/01/labview​-certification-preparing-for-cld.html

    Best!!

    Zaki Chasmawala | Certification Development Group Manager | Training Certification | National Instruments

  • RELEVANCY SCORE 2.79

    DB:2.79:Producer/Consumer Architecture 8d


    Hello All,
    I am currently working on an application using State Machine Architecture where I have to monitor various parameters (7 temperature values 3 pressure values), along with this I have to On/Offa Clutch using a digital Output for set time (e.g. On for "X" seconds OFF for "Y" seconds), but as soon as the pressure and temperature values go beyond upper or lower limits or whenever the user presses the Emergency Stop (that means I have to monitor Digital Input as well) so I am moving to different error cases depending on which values go beyond limits or emregency pressed etc..
    But this realisation is not working fine as I have to monitor and control several other things in addition to acquiring data....till now I just have used State Machine Architecture, I have seen Producer/Consumer Template but not quite sure how to realise such kind of application which involves data acquisition along with user interaction and monitoring.

    Could someone please put some light on giving similar kind of example or what else I can try with this problem.

    Regards
    James

    DB:2.79:Producer/Consumer Architecture 8d

    Hi Jamie,There are a lot of files in the zip file. Can you please specify which is the topmost VI or the one you are experiencing problems with?



    Warm regards,Karunya RNational InstrumentsApplications Engineer

  • RELEVANCY SCORE 2.78

    DB:2.78:Producer Consumer Queued State Machine With Subvi dk



    Hello all,

    I have a rather standard producer consumer queued state machine. Many of the states are for serial communication with an air flow controller and a series of solenoids. I have a subVI which I am having some trouble with. The subVI opens its own front panel, sends commands to the queue in the main program to adjust the air flow (which can take 10-20 seconds), then after it is prepared, there is a for loop to alternate turning a solenoid on (which is a command to the queue), wait, turn solenoid off (a command to the queue), wait, repeat. The front panel of the subVI displays a few LEDs indicating which iteration of the for loop is occurring. When this is run, the prepare air flow and solenoid switching commands are sent to the queue and executed, but the for loop continues before the first command to the queue (adjust air flow) is even finished. So the visual display and the machinery are out of sync.

    This result all makes sense.

    So I am wondering what is a correct way to do this?

    What comes to my mind is:

    1) put all this functionality in the main program and allocate part of the front panel to this protocol. This is not desirable.

    2) use notifiers so that once the air flow is all prepared, the main program tells the subVI "OK" you can continue to switch the solenoids, and update the LED display.

    Or is there some other solution?

    Thank you for any feedback,

    Jason.

    DB:2.78:Producer Consumer Queued State Machine With Subvi dk


    Because vis that display it's front panel contain event structures in most cases, I use user events to report the status to them. See my community nugget.

    Felix




    www.aescusoft.deMy latest community nugget on producer/consumer designMy current blog: A journey through uml

  • RELEVANCY SCORE 2.78

    DB:2.78:Interprocess Communications dp


    Hi,
    I have couple of processes running on machine as one collecting some data (producer) and other would be processing data (consumer)...
    These aretwo separate apps (Vb.net). Now I want to share/transfer data from producer in consumer in efficient way w/o writing to disk.
    Wondering what technologies I can use to make this happen in clean/reliable/efficient way.
    Regards

    DB:2.78:Interprocess Communications dp

    Hi Me.Saqib,
    Thank you for your post.
    This queue is about Visual Basic. Im afraid that the topic about VB6 is off topic here. For better support, I will move this thread to off topic forum. You can find the correct forum with the help of this link:

    http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/6a0719fe-14af-47f7-9f51-a8ea2b9c8d6b. Sorry for any inconvenience.Mark lxf [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • RELEVANCY SCORE 2.78

    DB:2.78:Synchronous Consumer - Asynchronous Producer (Using An Enumerable) 1p


    I have been looking at the consumer, producer threads in the forums and can't quite solve my problem.

  • RELEVANCY SCORE 2.77

    DB:2.77:How To Get A List Of Case States xf



    I have a LARGE state machine that uses a producer consumer configuration. I need to do some "paper" documentation. Is there a simple way to export or otherwise get a list of the states in the case statement so I can stuff them into Word and expound on what each does?

    I guess I can write a code snippet that takes the case and converts it to an array of strings and then display them, highlight, copy and paste, but I was hoping not to have to modify my code.

    DB:2.77:How To Get A List Of Case States xf


    IF the enum is a type def then you can write external code (so your traget code in unchaged) to open the type def get a ref to the enum and then list its strings.

    Put a stirng on the FP to select diffeent type-defs and you have a re-uable tool that does NOT change your code.

    Ben




    Ben RaynerI am currently active on.. MainStream Preppers Rayner's Ridge is under construction

  • RELEVANCY SCORE 2.77

    DB:2.77:Producer/Consumer Design Pattern And Timed Loop p9


    Dear All!
    Thebuilt-in templatefor the Producer/Consumer design pattern is based on while loop structure.

    Is it better to use timed loop instead of while loop?

    There is an example Modes for the timedloop.vithat offers Producer/Consumer feature built aroundtimed loop.

    With best regards,

    Mikhail Kozlov

    DB:2.77:Producer/Consumer Design Pattern And Timed Loop p9

    Dear Chris,
    thank you for your assistance very much.

    Asyoumentioned

    "If queue becomes invalid (for example, the queue reference is released), the function stops waiting and returns error code 1122"

    it means that I have received an error message after stoping Producer/Consumer if I use error handler VI. In general it is possible to remove this error messagehowever I am looking for a better solution. I will try to send by queue a stop commandto Consumer loop.

  • RELEVANCY SCORE 2.75

    DB:2.75:Producer/Consumer State Machine kc



    Hello,

    I have a State Machine with anIdle state that has an Event Structure to handle user eventsin it. I would like to include in that state, and in parallel with the Event Structure, a VI that polls for data every 10 seconds. Is there a way to have the Event Structure respond automatically to User events without having to wait 10 seconds before polling new data? Is the Producer/Consumer the way to go and how am I going to program this?

    Thank you,

    Richard










    Attachments:







    Tombeau_NewArchitecture1.vi ‏171 KB

    DB:2.75:Producer/Consumer State Machine kc

    RavensFan wrote:

    You can have a timeout case on your event structure which will effectively cause it to poll.

    If you have a separate while loop, you could have it use a Value(signalling) property node to fire an event within the event structure. Or you could actually dynamically register for user events and fire on them.

    My concern with that is it would only poll on timeout event. If the user is actively interacting with the program, I don't see a 10 second timeout occoring that frequently.

    I personally would go with a second loop and a message handler of some sort to take care of the polling. Just have a "wait until next ms multiple" in the second loop for 10 sec, and every iteration just poll the data and send a message back to the first loop. You could use a queue with a state, or with the data. You could also open a data value reference and send that type as the queue message, simply saying "new data in this memory location."

  • RELEVANCY SCORE 2.75

    DB:2.75:Consumer And Producer Relationship In Clustered Hornetq Environment ds



    Hello,

    I am getting confusion regarding the consumer and producer relationship in clustered environment. I've read book, guide and forum but still confuse how to establish consumer and producer relationship.

    In standalone hornetq instance, we can provide it's only IP address and respective port through JNDI to both producer and consumer , so consumer will get all the message from the queue deployed in that particular instance of hornetq.

    While working in clustered environment, for message load balancing we use different instances of hornetq in different machine with different IP.

    Should consumer have to know all machine's IP to retreive message that are distributed in different machines?

    I think consumer shouldn't have to hesistate either machine is clustered or not.It should get all the message from one instance of any machine that are in clustered.

    if it is right how could this can be accomplished?

    Please any suggestions are warmly welcome!

    -deep

    DB:2.75:Consumer And Producer Relationship In Clustered Hornetq Environment ds


    Hello Andy,

    Docx file consist simple diagram..i don't know what happen there, from here i can see the diagram.

    Cluster connection is ok with all the node and the queue deployed on each node contain messages send by producer.The clustered environment is working properly, problem is in consumer side.Do i have to mention all the node IP and port address for consumer? Here i do have only one consumer which retrieve message from queue that is deployed in node (192.168.72.11:1099) as defined in jndi.properties file. The messages of other nodes in clustered apart from that particular node(192.168.72.11:1099) are still not dequeued by consumer.

    I am confused what might be the problem?

    I've attached configuration file of all instances of hornetq.

    Please how can i fix this problem.

  • RELEVANCY SCORE 2.73

    DB:2.73:Stopping A For Loop Inside An Event Structure Vs. Producer Consumer sf



    Hi,

    I keep hearing how it's bad coding to place loops within an event structure however I am not understanding how else I may accomplish my task.

    So basically the code I have now cycles through 16 different measurements in a for loop with parameters changed on each iteration. I'd like to have a stop button also that halts the measurements but most suggestions I have researched on the forums indicate that I should change my program altogether in order to do this and use something like the producer consumer setup.

    Any suggestions other than shifting to producer consumer?I'd rather not change the program with the loop inside the event,as it is pretty much large and has 3 different event cases already coded up and I also don't fully get producer consumer anyways. It seems like a pain to change any overall programming architecture now and not worth the effort since I am almost done creating it.

    I can attach my code if needed - so please let me know if that is necessary.

    Thanks

    DB:2.73:Stopping A For Loop Inside An Event Structure Vs. Producer Consumer sf


    This would be a great time to watch a 13 minute demo

    Also do check out the documentation for the project template. You will understand what that implementation of a Producer Consumer loop does and how to use tthose te3mplates to get up and running FAST! The last time I whipped out a "Demo" for my favorite NI Rep I had one of those templates up and running in about 15 minutes on simulated equipment. The customer did decide that the NI solution wouldn't pose a problem overcomming the "LabVIEW Learning curve" since the solution arrived before the PO was cut.




    Jeff

  • RELEVANCY SCORE 2.73

    DB:2.73:Input And Output On Same Device, Producer/Consumer Structure ak


    Hello interested people,

    I have a question about using the same device for both digital inputs
    and outputs. I have written a simple program of one while loop
    that continuously polls the device, processes, and requests. I
    have addressed the device using two DAQmx Asst. and I have attached
    them with their error in/out cluster terminals to provide data flow and
    eliminate the chance of addressing the devices at the same time (which
    produces an error). Now I want to change this program structure
    to a producer/consumer loop foundation with state machine.
    In this design, I will have the DI in the producer loop and the DO in
    the consumer loop, under one of the states. I can't simply
    connect the error in/out ports in this configuration, so my question is
    how to avoid the error caused by addressing the same device
    simultaneously with two different tasks (input and output)? I
    have attached two VI's, the "One Loop" vi is the original configuration
    (simplified), and the Producer-Consumer vi is a NONSENSICAL program
    that simply represents the desired configuration. (I don't need
    any comments on the programming of this vi, it is only an example for
    illustration of the problem).

    I am thinking about bundling the input data and the error cluster, both
    from the PXI 6528 DI, into one cluster, queueing that up, and
    unbundling the de-queued elements for some kind of data flow between
    the producer loop and the "Request" state of the consumer loop.
    Is this the right approach, or am I barking up the wrong tree?

    Thanks










    Attachments:







    One Loop DO DI.vi ‏102 KB

    DB:2.73:Input And Output On Same Device, Producer/Consumer Structure ak

    Thanks for the help everyone. I have implemented this stucture
    and addressing the same PXI board in both the producer and consumer
    loops is perfectly viable so long as the board's error cluster is
    queued in the producer and accessed in the consumer. This
    provides the necessary data flow to avoid errors pertaining to the
    device being reserved or occupied.

  • RELEVANCY SCORE 2.73

    DB:2.73:Documenting Event-Driven Queued State Machine In Uml f1


    I'm frequently using the design pattern of an Event-Driven State Machine and I would like to document the behaviour in proper uml. I would by happy if someone shows me to do that.Having an event-driven QSM, the event structure will put one (or more) states into the queue (shown as orange arrows in the pic, imagine a 'SaveExit' behaviour for multiple states). The state machine itself will also put some states into the queue for transition. In the implementation, there is no 'idle' state defined (dequeue element).So the questions:* How to uml-code the event-to-queue* How to handle the multiple states fired case (*)* What about the 'Idle' state(*) that's the reason here for not using a simple state machine. I want to have 'Save', 'Exit' and 'Save and Exit'.FelixMessage Edited by F. Schubert on 08-08-2008 05:52 AM



    www.aescusoft.deMy latest community nugget on producer/consumer designMy current blog: A journey through uml

    DB:2.73:Documenting Event-Driven Queued State Machine In Uml f1


    I use UML since several years to describe my LV programs. In my opinion, the sequence diagram notation is the best way to describe processes over several VIs. In my applications the UML "synchronous message" is an event by queue, the UML "message return" is a notifier. The UML "object" can be an object (a VI called from a template - class) or a code part inside an own while loop. Each UML "activation" can have its own flow chart. Idle states (if needed?) can be drawn by an arrow of its activation.










    Attachments:







    temp.png ‏62 KB

  • RELEVANCY SCORE 2.72

    DB:2.72:Fpn-Producer Portl Content Not Showing The In Consumer Portal sm



    Hi All,

    Trying to acheive FPN. Using Portal-700-SP21 and Portal-701-SP05.

    Scenario 1: Portal-701-SP05 as Consumer and Portal-700-SP21 as Producer. I'm getting producer content in the consumer portal.

    Scenario 2: Portal-700-SP21 as Consumer and Portal-701-SP05 as Producer. I'm not getting producer content in the consumer portal content admin-portal content-NW Content Producer.

    I have checked:-Trust in working, proxy setting is done

    Please share your views.

    Deepak!!!

    DB:2.72:Fpn-Producer Portl Content Not Showing The In Consumer Portal sm


    Hi Deepak,

    In your Scenario #2, is your application FPN compliant? Please refer to the doc "FPN Version Interoperability.ppt" attached to SAP Note 1295662.

    Hope it helps.

    Regards,

    Dao

  • RELEVANCY SCORE 2.72

    DB:2.72:Is This Vi The Right Procedure To Multiple Boolean Button? xf



    Hello everyone. I made this VI's to use multiple boolean buttons for my scale (a "Open/Close" button and a "reset to zero" button). I want to make all commands from my device as boolean (ON/OFF) switches or buttons. Im asking for this procedure using while loop. Is this the right procedure. My VI is uploaded.

    In my previous post, a user helped me and said, that i can use a Producer/Consumer state machine in this situation, but that program seems a bit advanced and difficult to me, because i'm inexperienced with Labview.

    Thanks in advance

    Oesen




    Best regardsOesen

    DB:2.72:Is This Vi The Right Procedure To Multiple Boolean Button? xf

    Dennis_Knutson wrote:

    Your image does not show the event actually running.

    That's what he meant by "not responding". Took me awhile to figure that out too. I corrected the VI to have the event point to the correct control.




    There are only two ways to tell somebody thanks: Kudos and Marked Solutions

  • RELEVANCY SCORE 2.72

    DB:2.72:Understanding Code Complexity dj



    I recently refactored a legacy VI which was programmed in 7.1 days. It involved the usage of about 20 occurrences to trigger many parallel loops, each of which contained a simple operation.

    The code had a complexity of 7.3 (2012 property).

    I refactored the code to include a nice producer consumer architecture, got rid of FP elements for temporary data storage, introduced a state machine for handling UI updates and generally optimised what I could according to my understanding of good coding.

    After all that I have a code complexity of 6.8. I was expecting a MUCH larger drop than that.

    What exactly determines code complexity? What has a large impact, what has a small impact? If I compare the VI I modified with a version of the OLD VI which a colleague changed (a lot lot less than I changed) his version gives a code complexity of 4.3 (with 20 parallel loops coordinated with occurrences, each with their FP component and using Locals everywhere).

    Both the memory footprint of my version is about 50% higher than before and the code size is double that from before. How can this be?

    The one major change I made was using user events to communicate between my consumer and producer. My API has a total of 40 user events, not exactly a lot really.




    Say hello to my little friend.RFC 2323 FHE-Compliant

    DB:2.72:Understanding Code Complexity dj


    But on a more serious note.

    Spoiler (Highlight to read)

    C#

    Spoiler (Highlight to read)No, seriously serious, I'll try copying everything into an empty VI to see if things improve. I'm skeptical to be honest, but we'll see.

  • RELEVANCY SCORE 2.72

    DB:2.72:@Producer/@Consumer Question 3k



    This may sound stupid, but why does the @Consumer specify the @ActivationConfigProperty destination? This seems backwards to me. Shouldn't the @Producer decide where it is sending messages rather than the @Consumer controlling where the @Producer sends messages by defining the destination?I probably missed something, but the syntax is not clear.

    DB:2.72:@Producer/@Consumer Question 3k


    This may sound stupid, but why does the @Consumer specify the @ActivationConfigProperty destination? This seems backwards to me. Shouldn't the @Producer decide where it is sending messages rather than the @Consumer controlling where the @Producer sends messages by defining the destination?I probably missed something, but the syntax is not clear.

  • RELEVANCY SCORE 2.72

    DB:2.72:Producer Consumer Loop Only Execute Once? fd



    Hello here,

    In my VI, the producer loop seems working continuously, but the consumer loop only execute once.

    I haven't used producer/consumer pattern before, could someone give me some ideas why this happens?

    My code is in attachment.

    Thank you in advance.

    Yaqiong







    Solved!
    Go to Solution.

    DB:2.72:Producer Consumer Loop Only Execute Once? fd


    Thanks you it works!

    I was trying to use event loop so that when my mouse is on the chart the scroll bar doesn't automatically scroll to the newest updates so I can see the previous waveform. Is there a way to achieve this within a consumer loop?

    Yaqiong

  • RELEVANCY SCORE 2.72

    DB:2.72:Wizard Vs Record Producer 9z



    Hi All,

    what is the diff between Wizard vs Record producer? Are both the same

    Thanks

    Charliee

    DB:2.72:Wizard Vs Record Producer 9z


    Hi Charliee,

    I agree with Mark, but would add that a Wizard is like a record producer except that you can assign the resulting record based on responses by the user to each wizard panel. It can begin with a simple question like "reporting an incident" or "requesting a change", and by the end you might result in an incident record, change request, or other. You can set different transitions based on different conditions, either related to the question from a wizard variable or referenced from another value (user, cmdb_ci, etc). Also, wizard variables can be used more than once, where with record producers have a one-to-one relationship with their variables.

    When you really get into doing wizards, make sure to draw yourself a map to refer to... because the transitions can get to be a little confusing when they branch out in various ways. :-)

    Best regards,David

  • RELEVANCY SCORE 2.71

    DB:2.71:Wsrp Consumer Not Retaining Portlet Handle After Implicit Clone sj


    It appears that the 8.1 SP3 BEA consumer is not accepting implicit cloning from the WSRP4j producer. I have included the relevant information from the SOAP bodies below.

    The initial request that changes persistant state.
    urn:portletContext
    urn:portletHandle5.1/urn:portletHandle
    /urn:portletContext
    .
    .
    .
    urn:interactionParams
    urn:portletStateChangecloneBeforeWrite/urn:portletStateChange
    ...
    /urn:interactionParams

    The WSRP4j producer's response with the new handle after the clone. The response does not include markup.
    portletContext
    portletHandle5.192.168.130.176_1107271360729_2/portletHandle
    portletState/
    /portletContext

    The markup request for the results of the blocking action.
    urn:portletContext
    urn:portletHandle5.192.168.130.176_1107271360729_2/urn:portletHandle
    /urn:portletContext

    (Omitting successful response to markup request)

    Next request to the WSRP4j producer from the same portlet returns to the original portlet handle and loses consumer configured state. This occurs for requests generated by a form submission and for a request generated by clicking the Edit mode button in the portal itself.
    urn:portletContext
    urn:portletHandle5.1/urn:portletHandle
    /urn:portletContext

    This xml is from interactions with the WSRP4j producer; however, similar behavior has intermittently been observed when using the BEA WSRP producer. I have so far been unable to determine what exactly determines the appearance of this behavior with the BEA WSRP producer. I am currently testing on SP4 to determine if the issues still exist.

    Has anyone else experienced similar issues or have any experience with solutions to these problems?

    Message was edited by dvaleri at Feb 1, 2005 8:28 AM

    DB:2.71:Wsrp Consumer Not Retaining Portlet Handle After Implicit Clone sj

    I have seen the same problem on both SP3 and SP4. If
    you stop and start the Portal the clone did take
    place and things work as they should from that point
    on. It's as if the newly cloned handle is written to
    storage but not to the cache. When the Portal is
    restarted the cache is correctly loaded with the
    newly saved handle.I just started the server up again to capture the entire set of SOAP messages as subbu had requested and observed the exact behavior you describe here. I then unregistered the producer, registered the same producer again and observed the original handle issue as before.

    Thank you for both for the help.

  • RELEVANCY SCORE 2.71

    DB:2.71:Producer Consumer Problem - Semaphores pf


    problem solved.

    Message was edited by:
    nasher

    DB:2.71:Producer Consumer Problem - Semaphores pf

    problem solved.

    Message was edited by:
    nasher

  • RELEVANCY SCORE 2.71

    DB:2.71:Thread - Producerconsumertest - Results Are Not The Same dk


    Hi,

    I tried thread examples at
    "http://java.sun.com/docs/books/tutorial/essential/threads/synchronization.html"

    There are 4 classes

    1 - Producer
    2 - Consumer
    3 - CubbyHole
    4 - ProducerConsumerTest

    when i compile all .java files and run ProducerConsumerTest
    ( c: java ProducerConsumerTest )

    the output comes like that

    Producer #1 put: 0 -- ok
    Consumer #1 got: 0 -- ok
    Consumer #1 got: 1 -- something wrong
    Producer #1 put: 1
    Consumer #1 got: 2 -- something wrong
    Producer #1 put: 2
    Consumer #1 got: 3
    Producer #1 put: 3
    Producer #1 put: 4 -- ok
    Consumer #1 got: 4
    Consumer #1 got: 5
    Producer #1 put: 5
    Consumer #1 got: 6
    Producer #1 put: 6
    Consumer #1 got: 7
    Producer #1 put: 7
    Consumer #1 got: 8
    Producer #1 put: 8
    Producer #1 put: 9
    Consumer #1 got: 9

    like that (which is wrong), but at "http://java.sun.com/docs/books/tutorial/essential/threads/synchronization.html" the output is different (which is true output)

    Producer #1 put: 0
    Consumer #1 got: 0
    Producer #1 put: 1
    Consumer #1 got: 1
    Producer #1 put: 2
    Consumer #1 got: 2
    Producer #1 put: 3
    Consumer #1 got: 3
    Producer #1 put: 4
    Consumer #1 got: 4
    Producer #1 put: 5
    Consumer #1 got: 5
    Producer #1 put: 6
    Consumer #1 got: 6
    Producer #1 put: 7
    Consumer #1 got: 7
    Producer #1 put: 8
    Consumer #1 got: 8
    Producer #1 put: 9
    Consumer #1 got: 9

    My operating system is : Microsoft Windows 2000 [Version 5.00.2195]
    My Java version : Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-rc-b19)
    Java HotSpot(TM) Client VM (build 1.4.1-rc-b19, mixed mode)

    My question : Something wrong about my operating system or Java version or this example is wrong ?

    Regards
    Altug.

  • RELEVANCY SCORE 2.71

    DB:2.71:Producer/Consumer(Events) xk



    I am trying to practice using Producer/Consumer(Events) design pattern. In the attached VI I'm trying to control 3 LED's using front panel controls. I'm not sure how to extend the time that the LEDs remain lit. My first guess would be to continue queing a given state until a timer expires. But, from what I understand, it's not good practice to add to the que in both the producer and consumer loops. Any advice will be appreciated. Also, is there a possibility for a race condition in the way I terminate the program on STOP?

    Thanks in advance.










    Attachments:







    Prod_Cons Lites.vi ‏16 KB

    DB:2.71:Producer/Consumer(Events) xk


    I would:

    stop consumer with Error (it didn't stop, just kept going to init when queue was released)
    remove ES timeout (this kept enquing waits, making the consumer not respond when the button was pressed)

    What a way to spend New Years Day.




    JimYou're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

  • RELEVANCY SCORE 2.70

    DB:2.70:Progmatically Stop Vi With Producer/Consumer Architecture m1


    I can't seem to get my VI to fully stop, so that I can go on to do some more things in the program. I am trying to progmatically stop the vi (pictured below), so that I can return to my main gui (not pictured). The main gui just consists of a login, exit test system, and run test. Once the user presses run test, the vi pictured below opens.I am using a producer/consumer architecture with a state machine. The problem I run into is that when I press the "Main Menu" button, it should close the pictured vi and return to the main gui. I tried using the vi server, and when the user presses the Main Menu button, it fires an event and then it goes to the Stop state in the consumer loop, which opens a reference to the vi's (one for the strip chart vi and another for the gage vi), closes the front panel using an invoke node and then closing the reference. I also tried adding in the abort vi method after the close front panel and it still gave me the same result.Here is the catch, it does close the vi's, but it does not stop the while loops (producer and consumer), or it stops only one of the loops. I thought of putting in a constant in the event structure for when the Main Menu event is fired, but that will stop the producer loop before the consumer loop reveices the info to go to the stop state, so the consumer loop does not end.I also tried a "dummy" control that was connected to the comsumer loop Stop terminal (for the while loop), and then progmatically changed the value in the stop case to true and then read that value in the producer loop to, hopefully, stop both loops, but it did not work either.I am sure that it is something so stuipidly simple that I cant see it right nowKenny



    Kenny

    DB:2.70:Progmatically Stop Vi With Producer/Consumer Architecture m1

    Tim C. wrote:

    How can I use a cancel button when using a producer consumewr que to cancel a for loop in a consumer event?

    Duplicate Post. This question has been asked and answered here.

  • RELEVANCY SCORE 2.70

    DB:2.70:Coherence * Web Session Sharing Consumer Producer Wsrp Weblogic Portal 7k


    Hi All,
    I have issue with sharing session between consumer and producer, with Coherence * Web in Weblogic portal WSRP environment. Both consumer and producer sharing same Coherence cluster. I am able to send data from consumer to Producer through request object but not through session object. Session Id for consumer and producer are different.

    Here is the code in consumer

    public class AccountBacking extends AbstractJspBacking {

    /**
    *
    */
    private static final long serialVersionUID = 1970428633761226976L;

    @Override
    public boolean preRender(HttpServletRequest request,
    HttpServletResponse response) {
    HttpSession session = request.getSession(true);
    session.setAttribute("MYNAME", "RAVI");
    Account account = new Account();
    account.setName("Ravi " + new Random().nextLong());
    account.setNumber("123456");

    session.setAttribute("account-handler", new AccountHandle());

    NamedCache cache = CacheFactory.getCache("account");

    cache.put(session.getId(), account);

    SimpleStateHolder state = new SimpleStateHolder();

    state.addParameter("account-session-id", session.getId());
    request.setAttribute(MarkupRequestState.KEY, state);
    return super.preRender(request, response);
    }

    }

    Here is the code for AccountHandle.java
    public class AccountHandle implements HttpSessionBindingListener, Serializable {

    /**
    *
    */
    private static final long serialVersionUID = -5261549874262010616L;

    @Override
    public void valueBound(HttpSessionBindingEvent arg0) {
    // TODO Auto-generated method stub

    }

    @Override
    public void valueUnbound(HttpSessionBindingEvent event) {
    String sId = event.getSession().getId();
    CacheFactory.getCache("account").remove(sId);
    }

    }

    In producer code
    public class AccountBacking extends AbstractJspBacking {

    /**
    *
    */
    private static final long serialVersionUID = 8369878915673738986L;

    @Override
    public boolean preRender(HttpServletRequest request,
    HttpServletResponse response) {
    HttpSession session = request.getSession(true);
    System.out.println("MYNAME \t"+session.getAttribute("MYNAME"));
    SimpleStateHolder state = (SimpleStateHolder)
    request.getAttribute(MarkupRequestState.KEY);
    if (state != null)
    {
    String sId = (String) state.getParameter("account-session-id");
    NamedCache cache = CacheFactory.getCache("account");

    Account account = (Account) cache.get(sId);
    if (account!= null )
    {
    System.out.println("My Name \t ["+account.getName());
    System.out.println("My Account Number \t ["+account.getNumber());
    }
    }
    return true;
    }

    }

    I am able to get values of Account object in producer through CacheFactory. But I am not able to receive "MYNAME" attribute from producer session object which is set in consumer session.

    Is it possible to set a attribute in consumer session object and receive this attribute in producer session using Cohrence * Web,in Weblogic Portal WSRP environment ..?

    Your help is greatly appreciated..
    Thanks

    Ravi

    DB:2.70:Coherence * Web Session Sharing Consumer Producer Wsrp Weblogic Portal 7k

    Hi All,
    I have issue with sharing session between consumer and producer, with Coherence * Web in Weblogic portal WSRP environment. Both consumer and producer sharing same Coherence cluster. I am able to send data from consumer to Producer through request object but not through session object. Session Id for consumer and producer are different.

    Here is the code in consumer

    public class AccountBacking extends AbstractJspBacking {

    /**
    *
    */
    private static final long serialVersionUID = 1970428633761226976L;

    @Override
    public boolean preRender(HttpServletRequest request,
    HttpServletResponse response) {
    HttpSession session = request.getSession(true);
    session.setAttribute("MYNAME", "RAVI");
    Account account = new Account();
    account.setName("Ravi " + new Random().nextLong());
    account.setNumber("123456");

    session.setAttribute("account-handler", new AccountHandle());

    NamedCache cache = CacheFactory.getCache("account");

    cache.put(session.getId(), account);

    SimpleStateHolder state = new SimpleStateHolder();

    state.addParameter("account-session-id", session.getId());
    request.setAttribute(MarkupRequestState.KEY, state);
    return super.preRender(request, response);
    }

    }

    Here is the code for AccountHandle.java
    public class AccountHandle implements HttpSessionBindingListener, Serializable {

    /**
    *
    */
    private static final long serialVersionUID = -5261549874262010616L;

    @Override
    public void valueBound(HttpSessionBindingEvent arg0) {
    // TODO Auto-generated method stub

    }

    @Override
    public void valueUnbound(HttpSessionBindingEvent event) {
    String sId = event.getSession().getId();
    CacheFactory.getCache("account").remove(sId);
    }

    }

    In producer code
    public class AccountBacking extends AbstractJspBacking {

    /**
    *
    */
    private static final long serialVersionUID = 8369878915673738986L;

    @Override
    public boolean preRender(HttpServletRequest request,
    HttpServletResponse response) {
    HttpSession session = request.getSession(true);
    System.out.println("MYNAME \t"+session.getAttribute("MYNAME"));
    SimpleStateHolder state = (SimpleStateHolder)
    request.getAttribute(MarkupRequestState.KEY);
    if (state != null)
    {
    String sId = (String) state.getParameter("account-session-id");
    NamedCache cache = CacheFactory.getCache("account");

    Account account = (Account) cache.get(sId);
    if (account!= null )
    {
    System.out.println("My Name \t ["+account.getName());
    System.out.println("My Account Number \t ["+account.getNumber());
    }
    }
    return true;
    }

    }

    I am able to get values of Account object in producer through CacheFactory. But I am not able to receive "MYNAME" attribute from producer session object which is set in consumer session.

    Is it possible to set a attribute in consumer session object and receive this attribute in producer session using Cohrence * Web,in Weblogic Portal WSRP environment ..?

    Your help is greatly appreciated..
    Thanks

    Ravi

  • RELEVANCY SCORE 2.70

    DB:2.70:Imaq Vision: Not An Image Error When Using Producer/Consumer f1



    Hi veryone

    I have used Vision Express to solve Patern Machine problem.

    I want to put Assistant and Aquistion in 2 parallel loop. So I have used Producer/Consumer to transfer data

    After Running VI, I have pressed Stop button and I met this error

    I think Obtain Queue has a problem. I changed Image Control to Contant and wire it to Element data type. I think this way is correct.

    So when error occur, it address to IMAQ Coppy in Assistant. So I think I have used Queue Comunication not correctly.

    How can I fix it

    thank

    you can see more detail in follow video:https://www.youtube.com/watch?v=i6FOQ2jypXcfeature=youtu.be







    Solved!
    Go to Solution.

    DB:2.70:Imaq Vision: Not An Image Error When Using Producer/Consumer f1


    HI xaxa9ztb,

    I believe that Bob is correct. The queue is not being destroyed by the the Queue Release function, and so the Consumer loop never errors out. You can pass a queue reference around the Producer loop so that the queue will be destroyed and release the Consumer. If you go to File - New ... then you can use the premade application templates.




    Thanks,Frank Application EngineerNational Instruments

  • RELEVANCY SCORE 2.70

    DB:2.70:Producer Content Doesn't Appear In Consumer 1m



    Hi,

    Though the connection test of the producer in the consumer is fine, I am not able to see the producer content in the consumer. Can somebody help me out with the issue.

    Thanks.

    DB:2.70:Producer Content Doesn't Appear In Consumer 1m


    Hi jyothi,

    Create 1 role in producer portal and get the role in consumer portal from producer in useradmin administration role(for test).

    U will get the content .

    Surekha.

  • RELEVANCY SCORE 2.70

    DB:2.70:Comment On Design Selection xd


    Hi,

    Please comment and advise on design selection. I have a producer and consumer design. The producer contains a state machine that would be the work horse of the program. The consumer loop will get a queue with a 2D array element. Each row in the array represents one type of energy (out of six types). The consumer will poll the energy type (enum) and determine which row of energy to display.

    Questions:

    1. I used preview queue instead of dequeue at the consumer loop, because I want the consumer loop to update the GUI even without new data. For example, the queue is a one element queue, but the element is a 2D array with six rows for six types of energies. I want the user to select which type of energy (which row) to display during run time, so I am polling in the consumer loop, which I don't want to.

    I want to use dequeue element, so the loop will only run when there is a new element, but I want the loop to poll the user input for display energy and update accordingly. Can I somehow use a even struture in there? I want to update when there is a new element or when there is an value change event (enum) from the boolean.

    2. For example, let's say I set a queue to a one element queue, and I don't dequeue that element. After the queue has obtained one element, if I want to queue another element on it, I believe I would get an error, since the queue is full. However, is there a way overwrite the one element with another element? Lossy Enqueue should work, but is this a good way?




    ------------------------------------------------------------------Kudos and Accepted as Solution are welcome!

    DB:2.70:Comment On Design Selection xd


    jyang72211,

    It could be very possible that I'm missing something about what you're trying to do too

    From what I understand, you need to update your UI based on data generated by a producer loop OR UI events. Correct?

    What the structure I posted does, is process queued data generated by a producer loop and by an event structure in one consumer loop. This would allow you to send updates from the loop you are processing data in (what I understand to be your producer loop) and also send updates based on UI events (the lower loop with the event structure).

    Does this make more sense and answer your question? Or am I thoroughly confused (my gut says this is more likely!).

    Have a great day,

    Chris




    Applications EngineerNational Instruments

  • RELEVANCY SCORE 2.70

    DB:2.70:Producer Consumer With A State Machine Within The Consumer ks


    Hi All,I have been trying to develop a data acquisition system with the producer consumer architecture. To the left of the two main loops I initialize the serial port and any constants and variables im using. I also have an obtain queue VI needed for enqueue and dequeue. Then in the producer loop i have a state machine. The first state is where I wait for a button press on the front panel to write a GO signal on the serial line which will tell the device connected to the serial port to begin sampling data. After this button press I go into the next state which is called my read state. In the read state I use a property node to read all of the available bytes at the serial port and then enqueue this collected data into a queue. The state machine then is directed to continously go to the read state again and collect more data.Now this is where my dilemma is...... The consumer loop has the dequeue VI inside it and after this VI i have a state machine (while loop and case structure) which contains the following states1. Build Array - build an array from the dequeue element and if there is any left over data from the parsing states it will build an array with the left over data and the dequeued data2. Determine packet type - this state looks for the packet type byte(not necessarily the first byte in the message) and also check the next byte (packet length) to ensure that I am at the begininng of this chunk of data. This state may be a little slow because there can be three different packet types and based on this byte and the packet length it may have to search the array several time to find the valid starting point. This state also determine the next state to go to based on the packet type.3 packet type 1 parsing - parse data and store the remaining data it leftOver array. Go to exit state.4 packet type 2 parsing - "" ""5 packet type 3 parsing - "" ""6 exit - leave this state machine and fall back to the consumer while loop.After it exit I think it should fall back to the consumer while loop and dequeue more data and enter the state machine again to build a new array with the dequeued data and leftover data. It seems to work when I trace the execution using the Highlight execution feature, however when I run this all at full speed, it seems to go into the consumers 1st and 2nd states back and forth and not completely go through the state machine. I tried adding in a delay in the producer loop to give the consumer loop time, but I didnt notice any difference. Is it possible that my dequeue element is retreiving more data while im still in the state machine, causing the execution to leave the state machine before it finished all states?Is there a better approach to take to solve this problem. Basically I need to read data at a 1,000,000 baudrate and parse it as quickly as possible so that I can break it up into 3 different packet types, write the data to a file, and graph the actual data (header info removed) in realtime. I need to also ensure that I am not losing any of the collected data. Data loss cannnot occur.

    DB:2.70:Producer Consumer With A State Machine Within The Consumer ks

    A couple of things more to go along with Ben's pointers:You convert your data from a string, to a U8 array, to a Hex string array in the producer loop, then convert back to a integer to determine what to do with it. In the process, you create two or three copies of your data, slowing yourself down quite a bit. The code would be quite a bit more efficient if you left the data as a U8 array. You can change the format of the controls and indicators to show hex values instead of integer by right clicking on them and selecting Format and Precision...Your search code is fairly inefficient. I made a whack at making it a bit better. See attachment below.If you continue to run into race conditions, you can debug them using a calls to the Windows debug write sprinkled liberally about your code. Check out the post here for more information.Don't let your lack of format LabVIEW training stop you. The biggest thing to get is the data flow paradigm (aka data is wires, not registers). Once you get past that and learn how to pass data around using shift registers, queues, events, etc, you are most of the way to mastering LabVIEW. The rest is just learning the plethora of functionality LabVIEW gives you (yes, I have reimplemented LabVIEW native code more than once in the process of learning).Let us know if you need more help.



    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • RELEVANCY SCORE 2.70

    DB:2.70:State Machine Doubt mc



    Hi,

    I am using JKI state machine with 4 states(read DAQ USB 6008, write some value to Serial device, display message, display message2) but now, I would like to implement more states on existing code.

    Those are read serial(save some data), read daq, write some value to serial, again do same thing with before two states depend on some condition(may be three times) and then last write the value to serial device and display the message.

    Later, I need to copy the same code and put is in event structure with two buttons(possibly both cases code is same but with different working conditions).

    Can I go ahead in this way or may I need togo for Producer consumer loop. I am afraid to go with Producer consumer loop. Iam working on only with few serial commands(3 or 4). Can any one suggest me.

    DB:2.70:State Machine Doubt mc


    If you need to duplicate code a subvi is the way to go.

    And never, i really mean never, add code that executes in an event structure.




    greetings from the Netherlands

  • RELEVANCY SCORE 2.70

    DB:2.70:Best Way To Handle This Producer-Consumer Situation ac



    This is, i'm sure a common thing, however, I never really thought about it before. I can't post my VI so a description will have to do. It should go without saying, but I will repeat it's producer-consumer architecture. Let's say you have a signal generator and all the controls for it are in a cluster. A value changes, fires an event in the producer loop and you compare new and old values to determine which button changed. Cool, all good. So then I queue up a read front panel state in my prodcuer loop which is dequeued in my consumer loop. The read front panel stateloads all the new values into a cluster which then is fed into a shift register to be accessed from anywhere in my code (see here).

    Now my question is, what should my next state be that I queue up? If I have a single "send commands to sig gen" state, in my consumer loop I again have to determine which value changed in order to know which command to send (because the original determination of what changed was in the producer loop).However, if I have an individual state for each command I want to send, my case structure will get very big, very fast.

    Final option is have one send command state and just write all dataon a single control'svalue change, whether it's new or not (this seems overkill).

    Suggestions please?




    CLA, LabVIEW Versions 2010-2013

    DB:2.70:Best Way To Handle This Producer-Consumer Situation ac

    for(imstuck) wrote:

    A value changes, fires an event in the producer loop and you compare new and old values to determine which button changed. ).

    Instead of doing your compare in the producer loop, why not do the compare in the consumer loop and send the proper command? Your consumer loop already reads the front panel to form a new cluster.




    - tbobInventor of the WORM Global

  • RELEVANCY SCORE 2.70

    DB:2.70:Jbm Bridge Connect / Re-Connect Issues 1m



    Hello everyone !We are currently attempting to migrate from JBoss MQ to JBM,Using JBoss 4.2.1.GA, JBM 1.4.0.SP1, and JBoss Remoting 2.2.2.SP1.We have been testing the JBM Bridge service between a couple of machines,a producer machine with a mix of queues and topics,and a consumer machine which runs the bridge service(s).the consumer bridge service listens to two queues and one topic on the remote producer - and then puts the messages into local queues.as part of our testing we have unplugged the network cable from the consumer machine for a few minutes,then reconnected - and checked that the message delivery resumes -- and it does - which is great !HOWEVER -- after this - if we add messages into one of the Queues/Topics on the producer which was previously empty,the messages _never_ get delivered to the consumer.The only way they get delivered is if we re-start JBoss on the consumer, or if we restart the individual Bridge Servicevia the web-console and JMX-Beans view.below is a transcript of a test we tried :Started the producer JBoss instance - and once it was started - then started the consumer JBoss instance.(unfortunately the clock on the two machines is slighty out - the consumer seems to be approx 2 minutes behind the producer)
    producer 02:42:05 JBoss (MX MicroKernel) [4.2.1.GA ...] Started in 40s:622ms

    consumer 03:17:12 Started bridge BridgeService. Source: /queue/consumerPinNetDataQueue Target: /queue/PinnacleNetIncomingData

    consumer 03:17:16 Started bridge BridgeService. Source: /queue/testQueue Target: /queue/testQueue

    consumer 03:17:18 Started bridge BridgeService. Source: /topic/PinnacleNetTopic Target: /queue/PinnacleNetIncomingData

    consumer 03:17:19 JBoss (MX MicroKernel) [4.2.1.GA ...] Started in 22s:563ms

    producer Added 20,000 100 bytes messages to testQueue
    consumer Can see from web-console that consumer has so far received 7,500 messages

    consumer *** Network cable removed from consumer machine

    producer Can see that sending of messages has stalled in web-console, MessageCount = 12,500, DeliveringCount = 0, Consumers = 0

    consumer 03:48:49 Failed to send + acknowledge batch, closing JMS objects

    consumer **** Network cable put back in consumer machine

    consumer 03:49:26 Succeeded in reconnecting to servers

    consumer Can see number of messages in testQueue increasing after sucessful re-connect
    producer Can correspondingly see number of messages in testQueue decreasing

    producer **** started adding 20,000 100 byte messages to consumerPinNetDataQueue which was previously empty

    producer 03:52:29 [...CommsTestBean] sendTestMessages(queue/consumerPinNetDataQueue,20000,100)
    producer **** finnished adding 20,000 messages to consumerPinNetDataQueue (in a Transaction)
    producer 03:53:02 [...CommsTestBean] sendMessage(queue/consumerPinNetDataQueue,19999,false,false,false,100)

    producer Checked web-console -- consumerPinNetDataQueue shows 20,000 messages exactly - even after several minutes
    consumer Checked web-console -- PinnacleNetIncomingDataQueue shows 0 messages

    DB:2.70:Jbm Bridge Connect / Re-Connect Issues 1m


    JBoss 4.2.0.GA, 4.2.1.GA, 4.2.2.GA, JBM 1.4.0, JBM 1.4.0.SP1we have tested what you have given on the given platforms. it works fine without any issues. i personally setup my environment and checked this to make sure that the things are working fine or not. but it does. if you require, i can give you my configuration to try it out.please check your source/message consumer. i have used an EJB3 MDB as the consumer of messages at the destination server.thanksTyronne Wickramarathne

  • RELEVANCY SCORE 2.70

    DB:2.70:Modifying My Consumer Producer Pattern With Different Types Of Commands 7j


    Hi,

    I have a VI working using the producer / consumer pattern.

    I have a set of liquid pumps controlled by an Arduino. Labview sends commands through serial port (VISA) to the Arduino, and this Arduino actuate the pumps.

    The producer loop produces the commands. Stuff like "use pump 1 at speed 50 to absorb 10ml". It is a sequence of actions, and I am using a state machine. There are 4 or 5 steps, where in every step different pumps are actuated. All these commands are place in a queue.

    The consumer reads the queue, and executes the commands. It basically sends the parameters to the Arduino, and waits for its OK.

    This is 100% working. As expected the loops run in parallel. The producer loop is done like in 1 second, while the consumer loop takes like five minutes.

    You can see the VI here:

    http://imgur.com/6qDCC28

    In the producer all the steps are very similar to the one you can see. In the consumer, there's a wait state which waits until there's something in the queue, and then execute 4 steps, as the one you can see, to actuate the plunger and valve within the valve.

    The problem I have, is that as described, my VI is simply producing pump commands, and executing them. At the moment I need to do other actions that are not pump related, or even Arduino related. For example, something as simple as wait like 1 minute between some states, or execute any other action. I need the producer to produce this, and then in the consumer, do something else than just actuating the pumps (but I still need how to actuate them)

    Any help or guidance would be very helpful. I have been writing code for years, but just started with Labview.







    Solved!
    Go to Solution.

  • RELEVANCY SCORE 2.69

    DB:2.69:Consumer Producer - Acquisiton Image But Only Producer Loop Run cz



    Dear all

    I try acquire and save image from Basler camera L301kc and NI PCe 1427 framegrabber.I create a producer/ consumer loop because the save take more time that the acquisition and if I do both in the same loop I lose frames.But I have problem: only producer loop run.

    I have read all the threads but I didn't manage to solve my problem.

    I have attached a VI code of how I was trying to do it. I am using LabView 2011.

    Please any comments or help is deeply appreciated.

    Thank in advance

    XuanThuy







    Solved!
    Go to Solution.

    DB:2.69:Consumer Producer - Acquisiton Image But Only Producer Loop Run cz


    Hi XuanThuy,

    Attached is the location of the Dispose VI in your program. It is currently located in the producer loop. I think that it would help for you to move this to the consumer loop, so that you do not remove the image from memory before you save it to jpeg. Please let me know if this helps with your program. Thanks.

    Regards,

    Kira T










    Attachments:







    Dispose VI.png ‏22 KB