Producer consumer Start Trigger

Short explanation: I use a party apparatus 3rd signal a TTL to use as my trigger early in my VI. My cDAQ and modules seem to have the ability to send a trigger start regardless, but I could not track down the how to do this in a system of producer/consumer.  I have an idea at the bottom of the long explanation.

Long explanation:

I am running a test system that monitors the pressure wave by an inflammation of the hydrogen/oxygen. The components are a cDAQ-9188 with modules 9222 (x 3 HAVE broadband), 9481 (x 2 relays), 9402 (x 1 i/o Module), 9221 ('Low' speed HERE).

Based on the recommendations contained in this forum, I placed my DAQ in a producer/consumer architecture.

At this point the system works for the most part, I still have some more things to add for all the information I want to collect. However, it records at high speed and the 9221 and the 9222 modules are synchronized. He collected reliable data to date successfully.

When the system boots it will follow, but not save. I need to fill the structure tested with gas at a specific concentration before I switch on/registration. When I press the record button I have a TTL of the 9402 signal to my high-speed camera and I close a relay on a 9481 who engages in an ignition system. Ignition system takes a variable amount of time to load and shoot so I have a timer that leaves the TTL and the active relay for half a second.

My problem and it is a small, comes up with the system monitoring and synchronization. In order to get the system to synchronize properly, I had to generate an external impulse in PFI0 to use as a trigger. I tried to assign the different clocks available as a trigger of the beginning, but I found myself with unsynchronized data.

Is there a way to generate a pulse on my 9402 to use as a trigger? It feels stupid for me to use an external device, when I have something that can generate the signal that I need.

Thinking about this post, I have solved my problem, at least in my head. I think I can move the output TTL VI (that I'll eventually change to DAQmx) in the loop of producer and move my statements true or false for the consumer in the form of a 1 d array loop in my queue to start recording. Probably more than that, but I can only learn by experimentation on the right?

Thoughts? Recommendations?

VI attached.

You cannot generate a pulse with the 9402 himself. The pulse would be actually generated by the 9188. You must create a task of meter output to generate a pulse train. Try the attached example as a starting point to experiment with the meter.

This Vi is for LabVIEW 2013, if you have an older version let me know and I'll try to convert.

Tags: NI Software

Similar Questions

  • Trigger consumer in a producer consumer architecture

    I want to trigger the loop of consumer in a producer consumer architecture, so that it can do what it should do, until he receives something new producer loop.

    Can someone tell me please how to do this?

    Thanks in advance!

    If the Dequeue-1 item timeout entry turns off the timeout.  That means he'll stay there forever until the data is available in the queue.

  • trigger several events to user in an architecture of producer/consumer

    Hi all

    I use a producer/consumer architecture, where the case within the property are selected with enums sent via a queue.

    Enums are queued in the producer, which is a Structure of the event inside a While loop. Then each of the events in the producer is associated with a case in the well (to make it easier).

    Now I would like to run several events in the producer, programmatically in a given sequence. The events involved in the sequence are basically all triggered by changing the value of a Boolean value (button).

    Please find attached a schematic representation of the sequence, I would like to implement.

    I heard of 2 solutions:

    -"Writing to the node (Sgnl) Value property of the variable [I] want change."

    -Dynamic user events

    In any case, I don't know how to make sure this is done for several events in a specific sequence?

    Thank you.

    Florian


  • Restart waveform immediately start trigger

    I create a waveform 50 ms with an SMU-5451 in SMU-1078 chassis with a controller of SMU-8840 running Labview RT.  The waveform is currently triggered by a pulse of a counter of data acquisition because the timing of the wave must be closely synchronized with data on the acquisition of data collection.  However, this approach is problematic because it is difficult to produce a continuous of the 5451 signal when it is triggered in this way.  If the waveform is exactly 50 ms long, will miss the start trigger.  I can tolerate losing at the end of the wave, but I can't tolerate having a gap in the output, and I need the waveform to start exactly on the edge of outbreak of 50 ms.  I can configure the 5451 to accept a trigger start and restart the wave immediately rather than wait for the current iteration of the waveform to complete?

    I guess I could use a complete the 5451 event to trigger the acquisition of data instead, but I guess there is a way for me to do what I want.

    Are you familiar with the mode "script"? You might be able to use this example script:

    script restartWhenTriggeredScript
    Repeat forever
    generate wfm
    break on scriptTrigger0
    Repeat forever
    generate wfm
    end repeat
    end break
    end repeat
    end of script

    Basically, the idea is that, when it receives a trigger, it stops the execution of the inner loop and finish the iteration of the outer loop. Then it will start again from the beginning and to the inner loop.

    Please let us know if that fixes the problem.

  • What is the fastest method producer consumer. Queue, RT-FIFO, event

    Hi all

    Another question completed for the pro:

    I recently inherited the labview code that uses RT-FIFO for the transfer mechanism in the architecture of the producer consumer.

    The code was first written in 3-4 years and is currently in LV8.6. It is possible that the reasons for the architectural decision no longer exists.

    I am qualified using a producer consumer queued architecture,

    I understand the RT-FIFO Architecture.

    I started using an architecture based on events from the user.

    (I have attached samples of each)

    I also see the existence of a priority queue

    Each method has its own capabilities and gaps, that hand, nobody knows the relative performance of each method.

    (Assuming that the only process)

    I would expect RT-FIFO to be faster, there seems to be a version of low characteristic of a standard queue.

    What is the perfornace hit to use a coding user-friendly queue more

    RT-FIFO description talks about commications between the time-critical and lower priority threads.

    Until today, I thought that the queues had the same capacity.

    I've included an event method that I commonly use for review by peers and help from other users...

    It allows to:

    1. several producers with different types of data

    2. process 37 production order.

    3 allows asynchronous verification of functional notifiers such as stop, start and abort.

    4. in a system not real-time, it can include interactions of façade.

    What I do not understand on this subject, that's what are overhead or thread priority changes that may occur using this architecture (it solves a lot of problems for me).

    Thanks in advance,

    Hi Timmar,

    Here's a KB article on some frequently asked questions about the RT FIFO: http://digital.ni.com/public.nsf/allkb/7AE7075AF1B2C58486256AED006A029F?OpenDocument

    The more relevant question is #4, I posted below.

    What is the difference between RT FIFO and queues? 
    Functionally, RT FIFO and LabVIEW queues are two pads of first in, first out. However, here are the main differences between them:

    • RT FIFOs run deterministically in LabVIEW and evanescent code queues are not. This comes from the fact that queues use block calls during read/write to the resource shared, while RT FIFOs use non-blocking calls.
    • RT FIFO are fixed size while queues develop when items are added to them.
    • RT FIFOs will execute the code, even if there are input errors. They can (and will) produce new errors and spread the existing errors.
    • Queues work with any type of data, while the data types that can be used with RT FIFOs are limited. Generally any type of data involving allocations of extra memory can be used with RT FIFOs to preserve determinism.

    Let us know if you have persistent questions!

    Ryan

  • Funky producer/consumer behavior

    If it's a weird thing...

    I have a loop of producer/consumer taken (especially) of the labview model is based.

    For some reason when I click on the button stop to stop the program, instead he wants to run through the case of default (shown in picture) a second time.  That is, I run the program, that my event, the event takes place through, I click the button stop, then the event goes smoothly once again and finally stops.

    In addition, there are 2 times in my program where I record data, in the beginning where I implemented headers, and after all the data is taken.  If I have the program stops after clicking on the stop button, but before the event through even once (there that while loop which is idling until I click on 'accept the level') if I abandon execution, then the previous run data not saved.  (Although the 1st write to spreadsheet.vi may be overwriting the previous run data, which might be the reason why he is absent).

    What I've done wrong, what makes my program run it twice?

    If you are relying on the destruction of the reference of the queue to stop the loop at the bottom, wrap the structure from the bottom case with another structure of case that starts on the Dequeue elements error - use cases existing in the State without error and any special in the case of the error and discontinuing treatment.

  • Timed loop in loop of producer/consumer

    Hello!

    I have a loop of producer/consumer LabVIEW program configuration to allow me to properly capture the images that are large enough (8MP) at about 14 frames per second (FPS). The program works very well when the consumer loop is a while 'loop' (recorded at 14fps without problem), but I wanted to do a loop timed, so that I can vary the FPS as requires it. A curiosity arises when I do that. Anywhere under 12 fps, the loop works very well and the data is saved correctly. However, when I bump it up to 13fps, the calculated consumer FPS goes haywire and starts to jump between 9 ~ and ~ 13fps (processing of data gets bogged down?). When I set the FPS at 14, the loop runs at a constant maximum 7 fps. Is there something I can do to remedy this situation?

    I have attached my .VI

    Thanks in advance!

    Palanski,

    Are you using LabVIEW Real-time? Loops clocked to a windows OS do really increase determinism more than a while loop with a wait until the next timer multiple. Before you change the loop of producer-consumer in order to include a while loop was programming works correctly? You can also vUtiliser the VI analyizer to see how long things take to run. I let the loop of consumer to the producer in the traditional game upward and change the FPS by controlling the timer to wait, after benchmarking your code, it should be done in the same way as you did for the timed loop

  • overflow memory for the producer consumer

    I'm trying to save data from 4 ports to 40.96 Mhz. using a producer consumer architecture and a PCIe NI 6527 B using an external clock.

    I inherited code which works for 2 ports.  I tried to add additional ports and changed the size of the data to the DAQ.mx queue and data.  Launch the program several times, reach conflicting error messages after less than 2 seconds from the beginning:

    Error 200284: Some or all of the requested samples are not yet acquired.  [...] To make available samples more quickly, increase your sampling rate

    200361 error: Overflow memory device on board.  Due to the limitations of system and/or the bandwidth of the bus, the driver could not read the device fast enough to follow the flow of the unit.  Reduce your sampling rate.

    What is a race condition between the error messages, a problem of timing of start or something else?

    I approach, how to debug these types of problems?  How can I determine what is causing the error?  I can't single step through because I'm at the wheel of sampling with an external clock.

    Running on labview 2012 Windows XP on the machine who's 3.17 GB of ram.

    Try to reduce the size of your buffer.  In fact, simply leave the calendar DAQmx unwired.  The size of the buffer must be large enough by default.  And then also try to read less data at a time, as data instead of data 500ms 10ms.  What I suspect here, it's that the DAQmx buffer is too large and therefore must use the hard drive for part of the buffer, to slow things down a lot.

    Other notes here:

    1. do not use the time-out to stop your loop of consumer.  Your producer should send an order of a certain type to your consumption by telling it to stop.  In this case, I would use an empty array.  And then, you must release the queue after the loop of the consumer.

    2. you want a constant FALSE to Append Array/String input size of the binary file write.  This will remove the 2 I32s at the beginning of each table that you write.  Eelle are here to tell the size of the table being written.  But since you are just data flow, I doubt that you care about those.

    3. instead of the entire setup of producer/consumer, have you considered using just the DAQmx Configure Logging VI do DAQmx stream directly to a TDMS file for you?  Makes things much faster and much easier on you.

  • How to stop an acquisition continues in producer/consumer

    Hello

    I'm trying to use producer/consumer to control 'Start' and 'Stop' to my continuous data acquisition system. I can start the acquisition process successfully, but I can't stop it botton 'Stop '.

    I enclose my simplified VI. Can anyone help to have a look and tell me what is the problem here?

    Thank you

    Bing

    As I said before, use a notification utility and manage the expiration time.  I used a select statement with timeout? Optional Boolean.  If a time-out of events, use the previous value.  If we got a notification, use this value.

  • events producer consumer with notifiers

    Dear users of LabView,

    I would like to ask your advice on my project (see the attachment of files). For the beginning, I did only the "backbone" of my project, that's what you can see in my VI. My project will have the following features:

    -Start and stop action possibly (and also plot data to the chart and saving the data to the file)--> here is some time a loop to record data ranging from DAQmx (USB6009) and another while loop with rates of different loop to rise in voltage output amplifier of the magnet.

    -During the measurement, or if the system is idle, the user is able to read files of measured data and evaluate the measured data, etc... (so there will be more features...)

    I decided to use producer consumer structure with events and the authors of notifications, and I also use the dynamic user event to be able to communicate to the consumer with the producer (where I have my machine of the State as in a shift register).

    Please comment on my VI, what do you think? Maybe I should use the state machine (the shift with the pole of the State Register) in the lower loop? I could also use up queues of the notifier, but since I send only orders and the values of the parameters (not streaming broadband data) I guess that the declarant is fine?

    Thanks for the tips!

    The code you posted looks like a good start.  The architecture is very similar to the measurement sample continuous project comes with LabVIEW 2012.

    A few things I noticed:

    1. I would usually use queues instead of filers (unless you want to manage only the last command and not all orders in the order they are received).
    2. You don't need the registry change in the top loop (structure of the event).  You inadvertently send a length of measure and other commands parameter since you replace only the command.  Probably, this is no problem for now but could be a problem later.
    3. I think the user events are a great way to manage cases of judgment where the consumer is able to report to the producer that the application must exit loop (this is how we do in the sample project).
    4. Your case 'Init' confuses me a little.  It is read length control measure and send a user event in the event that, in the structure turn immediately place a measure command. Once I see a control in a loop of consumer as it hurts a bit uncomfortable. Why not have the value "start_measurement" to change event read the length of measure command and send it as part of his message to the consumption loop. Then the loop of the consumer can Init and self talk to start the measurement.
    5. You may need to rethink your strategy mistake in the case of the measure. Currently you do not stop a loop if an error occurs, and allows you to keep the error between iterations of the loop information shift registers.  Therefore, if an error occurs in one of these loops you can never hear about it.
    6. In general, using the error state as the main way to stop a loop from consumers is a bad practice. I'd rather see a "Shutdown" command which causes the consumer to stop loop. It is more scalable and less likely to be triggered by the accident.

    Good luck with the rest of your application.

    ~ Simon

  • Using the producer/consumer with GPIB/VISA model

    Hi all

    So I have a .VI I learned to communicate with my camera, I joined. I tried strip down as much as possible, just to understand the concept. It basically just takes a resource VISA name, use this open VISA, then uses the same resource VISA to write a command that reads the data from my machine (xall?) and then bed in 500 bytes and which prints. If it works, and it's good.

    I try to use producer/consumer model for doing essentially exactly what this guy. I have a RLC, I want to press a button that starts my measure, I want him to taste several times per second, save the data in a text file or .csv and then stop when I press the stop button. Thus, he will be given indefinitely potentially.

    I would like to have the data in a format something like:

    Time C R

    0 5.0 4.3

    ... etc.

    I read the link of model p/c above, but my LabView knowledge is still low. Currently, my plan is to take the part of read/write of my attached VI, which are a sub - VI and then put that in the pink box in the VI for the producer/consumer above page that is labeled "produce data to be placed in the queue":

    What prevents me to do this, it's that I can't get the piece of read/write to work properly as a standalone Subvi.

    What is the right way to go about this?

    Thank you!

    I put if you actually found data of your instrument.  Your instrument is not made to take new measures or just send you the last reading, she did.

    Insofar as the file IO, I recommend that you learn to use the palette for the file IO functions.  You need to create your file before your loop, write in a text file inside and then close after the loop.  I don't do the thing the comment on the express VI entry will do what you want.

  • acquisition and recording of analog data with producer consumer model

    Someone on this forum, in a separate last week discussion, suggested that I use the producer model consumer data acq.  My ultimate goal is to acquire analog channels 1-4 continuous data, display graphical band style and save the data on the boot disk when the user presses the 'Start Saving' button (and will continue to display recorder cards).  Economy will stop when the user presses the button "Stop Saving" but strip map will continue to operate.

    My attempt to use the producer-consumer model is attached (LV 8.5 only).  It does not work.  I have not tried to implement for recording user controls - just trying to make simple continuous display and save (1 channel) at this stage, using this model.  VI runs, but the graphic Strip is never updated with the actual data, and the data file that is saved has zero byte inside.

    Thank you.

    WCR,

    Looked at your code, and you are right.  It won't work.

    Take a look at this example:

    http://decibel.NI.com/content/docs/doc-2431

    The VI of the acquisition must be inserted in the loop of the producer.  In addition, you must tell him how many samples for (otherwise, it will get 0).

  • Producer-consumer mode, PDM and Acquisition journal continues

    I created a VI based on events to control the parameters of data acquisition. I created a queue of producer-consumer in TDMS file in the loop of the consumer.

    Question 1: Why should I get DAQmx TASK through each defined event? If I don't, I get error task DAQmx.

    Question 2: I need the QUEUE of each event? If I don't I get error in the file close TDMS (consumer loop)

    Question 3: When I look at the data file, I get manily in the near TDMS file loop of consumer-related. Since there is no element in the QUEUE why should - I get this error.

    Please advice.

    Thank you

    This is certainly not how I would like to start to create a Soft Front Panel for a task to HAVE.  Leave to file logging asside for now (appearing, it is actually very easy to add later.)

    As food for thought - and because that create a FPS really involves a slightly different thought where you started I whip a 'start' of a FPS.  It also shows how to create a simple API around a 'resource Module.   (Just a natural extension of a "motor action - if you haven read the nugget of community is always a good read.") http://forums.ni.com/t5/LabVIEW/Community-Nugget-4-08-2007-Action-Engines/m-p/503801)

    What I compressed is not complete - but you should get an idea of what to expand and where.  You could even have there more faster here than when you are now.

    An approach like that can really help when you go to unwind the problems as you mentioned in your code when you are unable to move around the information that the GUI can't really do use anyway and not IS NOT NECESSARY at this level.  the guys from 'Computer Science' will use terms such as 'Hide data', "Functional Abstraction" and "Encapsulation".

    The capture below is meant to tease the project so that others can get the idea of code - (sorry no LAVA TDC today! )

  • Master/slave producer/consumer Feeback?

    We know that in the models of master/slave and producer/consumer can send information of the master loop or a producer to the loop of the slave or the consumer.  But what to get information of the loop of the slave/consumer back to the master/producer loop?  I think it may return some sort of output or a message saying something like "I finished my work successfully.  This can be done with local variables, but is it really a good idea?  Is there another better way?   In addition, in this case can I just use a sub - vi?    I don't know that I always get the PARALLEL treatment offerred by master/slave and producer/consumer with a sub - vi.

    You can use a notifier to send a return message.  You can use a local variable, but unless you know what you are doing, you might encounter problems with race conditions.

    Sub - VI have nothing to do with producer/consumer architectures.  You can do a p/c with or without sub - VI.  Sub - VI is a way to break the code in significant functional blocks.

  • First try the producer consumer Architecture: continuous play and dynamically update settings.

    Hello

    I am currently working with two instruments; an Agilent E3646A and a NI 6212 BNC. My goal is to have the 6212 continuously take measures according to predefined parameters while the E3646A parameters can be continuously updated. This combination simple instrument aims to help me learn the manual architecture; continuous measurement, output dynamic controls and instruments more will be added in the future.

    I've already posted on a similar, but more complicated configuration (http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Split-second-lag-when-controlling-two-instrum... and was advised to try the producer consumer Architecture.) I found the documentation on the website (http://www.ni.com/white-paper/3023/en/, https://decibel.ni.com/content/docs/DOC-2431), searched the forums and built my own VI. While my first attempt at a producer consumer Architecture has solved some of the problems I had when I posted on the subject, however, new questions have been raised regarding the reading and adoption of the VI.

    I am currently able to run the VI and update the settings on the device. Previously, I'd get a freeze while the instrument has been updated and could not switch settings until it was done. This has been resolved, although that reading updates only when a parameter has been updated, although it is outside the structure of the event. In addition, the Stop button does not in any context. I also got occasional mistakes on the part of Deqeue, but the major part of the sentence is error-200279 'A tried to read samples that are no longer available' to DAQmx Read. I realize that there is a problem in my loop of producer but have not been able to find a way to solve it.

    This is my first attempt at a producer consumer Architecture and already I can see that it is a powerful tool. I read as much as I could and looked at examples, but should have some problems at the beginning. Would be very grateful of any advice so I can take full advantage of the architecture.

    Hope to hear from you,

    Yusif Nurizade

    You're going to overflow this buffer, unless the events are generated faster than "sample rate/number of samples.   Period.  Nothing could be simpler.

    You don't need a local to stop your curls.

    Try something like this attachment.  I simply moved the structure of the event in its own loop dedicated since it had nothing to do with acquiring data at all.

    Data acquisition loop stops very well when you destroy the task and destrying the stops of power queue (sending the default values of the queue for the power control) for EXAMPLE, to ADD a group of setting 'Safe shutdown' to a 'package' and it wire to the Center terminal (Prototype).

Maybe you are looking for

  • printers HP officejet j4550: hp officejet j4550 printer all in one

    I have upgraded to windows 10 on my laptop. I have an hp officejet j4550 all-in-one printer. I used the boot disk and received a message that my system does not meet the requirements. This printer works on windows 10? What should I do?

  • Cannot remove malware: popups, downloads, advertising links .pkg

    Hello world I followed the instructions for the removal of malicious software on multiple threads here without success and then tried to use Malwarebytes Anti-Malware for Mac - which did not work. A summary of the issues: 1. I get a new tab for Mac A

  • Windows Live no longer works when I try to close it

    Whenever I have leave windows live mail, I get the following message - "Windows live mail has stopped working. Windows can try to restart the program. "Although it is not impacting on all mail entries, it is annoying and I can't stop from popping up

  • Account administrator - Mine got stolen. How do I set up another?

    My daughter was angry with me and changed the name and the password on the administrator system on the family computer. (Looong story) Now we have the name, but she can't remember the password. Any suggestions on how to recover our system administrat

  • Storage media player uses?

    Hi you all,. I updated my old HPa610n, office from Vista/32 bit to a more recent HPp6320y, Win7/64 bit & I was wondering if I can still use my old pocket-sliding support delivered disk pre-installed with my old HP/32-bit Vista, w / my new improved W/