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.

Tags: NI Software

Similar Questions

  • Producer consumer with the third loop model

    Hello everyone and thank you for looking at this.

    I have a problem that I thought for a while now on the execution of a third loop in a design model of producer consumer (with events).

    I use this type of model for a UI and am happy with how it works. However if I want to add a continuis loop model to test for example how can I control the loop?

    In my example (see table), I use a local variable to run them (or stop) the test and the same to close the application.

    I don't know why, but this feels wrong to me. Is there a better way?

    Thanks in advance

    Chuck

    Nickelback says:

    Is the problem with the consumer loop only runs when it receives a message from producer loops event.

    Nothing says that you can't have a consumer loop enqueue States to itself.  Of course, this is more in a State Machine in queue with the possibility for another loop to the States of the queue.

  • Data types in the design for the producer consumer model

    Is it possible for me to use any type of data in a model of design producer consumer, without specifying specific data type?

    what I mean is if there is a way to connect to a data type with which I can use any other type of data, not to mention that one that I have connected, and if not, how can I specify the data type for a number or any other data type, for use in a design of producer-consumer model?

    You can make a part of your cluster of data a Variant.  It will take any type of data.  A common architecture for the producer/consumer is a cluster which is an enum and a Variant.  The enum contains all possible "orders", you might want to send.  The variant contains data that could be of any type.

    Ungroup you in the consumer and get the enum and Variant.  Attach the enum to a case structure.  In the specific case, convert the variant type in a data type of regular LabVIEW and with it as you please.

  • State machine in queue with the producer consumer

    Hello

    I am trying to build a VI where the user allows some Boolean controls on the front panel.
    VI uses a producer consumer in which based on Boolean values clicked architecture.
    some States are queued one recorded in a table.
    After the user is done by selecting, Boolean values should get disabled and the table of States
    should be indexed one after the other.
    It is an attempt to solve the review model car wash.
    However, the VI does not generate the required results.
    Can someone help me please understand what is the correct way to this implementation.

    Thank you

    Its because you have wired the consumer while loop the first stop. Remove and in your loop of consumer, make a comparison of the States that you receive and if it is equal to stop, stop the loop of the consumer.

  • Convert single while loop with variable Timing literal to the producer consumer

    I have a controller for a biological system that updates every n minutes or every minute 2n, under certain conditions. My app has a synchronization controller calculates if the current iteration is n or 2n and feeds the output of this calculation in a loop of "Timing" VI in my all. If I understand correctly, this is similar to the issuance of an order of sleep() in a language similar to C and should be avoided. I'm refactoring my code and I heard that they are well suited for this kind of things. Here's how it should work:

    1. Loop begins at the time T, T is saved.
    2. Schedule controller runs and calculates if loop will get minutes 2n or n minutes. This controller will take a number of milliseconds to complete, so we are is more to time T.
    3. Now that the update interval (n or 2n, let's call it u) is known, the loop must until T +u fill.
    4. The PDC is executed, but a number of milliseconds to execute.
    5. The rest of the time until the next iteration of loop should produce the CPU for other processes.

    It sounds to me like it's the kind of a real-time system, although as long as we are in the minute of the original deadline, there will be nothing wrong.

    What the producer-consumer loop would look like? Assumed that the synchronization and the main order controller are separate from the VI.


  • 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).

  • 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.

  • Cannot terminate everything in a loop to the producer/consumer

    I have attached a simple vi which was built from the producer/consumer (events) model.  In vi I set up a counter.  I want to be able to complete the meter when you press the stop button.  This does not work as expected.  The meter goes to its full count before the program stops.  The vi works as expected when run in execution to highlight mode.  Cannot understand it.

    Thanks in advance.

    Race condition.  No matter what time something behaves differently with that highlight run it at full speed, and suspect it is a problem of synchronization due to a race condition.

    As soon as your producer loop has the command queued up, she is ready to handle the next event.  If you press the stop button, it is ready to deal quickly and the stem while the ends of the loop and Stop immediately gets back to false.  This probably happens before the loop of consumer has the opportunity to read the local variable of the button stop in the moment, it's true.  Have your consumer while loop redefine the Stop button to false instead ensuring consumer loop has a chance to see if it is true.

  • How to use the ESD document with structured templates

    Hello

    I started to learn working with SEDD. I have an existing ESD, now I'm suppose to use it to create documents. I created a new book and imported this ESD file to it. I can see all the items in the catalog of the element. But when I start to add items to the book and add a new document, the elements are turning to red. Referring to the User Guide, it is said EDD cannot be used directly and must be used with structured patterns. But I do not have these models structured with me. Can someone please tell me how to create these structured templates and how to use the ESD file with these models, and out of this problem.

    Thanks in advance.

    Although ESD exist in the form of a separate document, the only way that it can be used is when it is part of the model. As a model of structured FrameMaker, a structured model contains master pages, pages reference, character formats, paragraph formats, etc. IN ADDITION, a structured model contains a DSP. To add the EDD to your template file, or any document FrameMaker who will use it, open the template file and the file of ESD. Click anywhere in the template file, and then select file > import > element definitions. In the dialog box, select the EDD file as source and click Import. Then save the template file.

    To use the template file, open it and save it as a FrameMaker document, giving it the name you want. You can now create your structure.

    If you use a book, all documents in the book must use the same ESD. Open the template file. In the book file, select all the documents in the book. Then select file > import > element definitions. In the dialog box, select the template file and click Import. Once completed, all documents in the book have the same ESD. In addition, ESD is copied into the file of the book itself.

    You say:

    But when I start to add items to the book and add a new document, the elements are turning to red.

    It is is not clear to me what you do. While it is true that SOME elements of a book are in the book file, you cannot add a book of items in the folder (at least not as far as I know). In general, the book file, it encapsulates elements around the documents root elements in the book. You may need to update the book to get a part of the Red disappear lines. You may need to rearrange items in the structure of the book to remove the red lines.

    Hope this helps,

    Van

  • Is it possible to use the Remote app with the Apple TV connected via ethernet and iPhone via WiFi?

    Is it possible to use the Remote app with the Apple TV connected via ethernet and iPhone via WiFi? When I try this Apple TV does not appear in the list of devices on my iPhone.

    Yes, I'm doing exactly this with the same put in place.

    If the problem persists the next relative to the following articles might help you.

    Troubleshooting home sharing

  • When I use the mail merge with excel file, after I press ok the progress bar indicates "NaN", mail project window crashes. My record is nice little CVS n

    When I use the mail merge with excel file, after I press ok of the progress bar indicates "NaN", mail project window crashes. My file is in the correct format and small size (4-column 4 raws). I use an English version of thunderbird after accidentally, I installed one in my tongue.

    I am attaching the screenshot

    I solved the problem
    has been st@pid excel

    I created a CSV file in openoffice calculator and everything went smoothly

  • Win7 with FF 31, smart phone 4.2 with FF letest ver. using the same account with 1 email. But the phone is not getting any collar, Bokmr, etc.

    Brother.
    We use win7 with Mozila 31, 4.2 with Mozila Android smart phone latest google app store on 04/10/0214. Using the same account with the same email. But the phone does not get any new information of win7 with Mozila 31. PL z give useful information.

    Hi w3ur_team,
    Thank you for your question. I understand that there are two features that are documented in the sync account. However the Android is not synchronized.

    There are two places we can check:

    1. In the Android settings, under accounts is the Firefox Sync or Firefox Sync (discouraged) joint account?
    2. Credentials work on accounts.firefox.com on the mobile device and are there any error messages in the synchronization of the settings menu > sync?

    See also Firefox Sync troubleshooting and tips for more troubleshooting steps.

  • How to use the "Toshiba controls" with other players?

    Heey

    I have a Satellite with Toshiba controls. How can I change so I can use the buttons for other media players and not only Windows Media Player?

    A dude sorry for the bad news, but I fear that it is not possible to use the Toshiba controls with another application as with WMP (CD) and WinDVD (DVD)
    I think that the utility was already programmed and designed to use only these two applications.

  • I can get the data of a hygrometer using the RS232 port with the following T75.2F:H17.0% using a RS232 data logger format. I was wondering if I can collect this data for later analysis using Dasylab. Any help is appreciated.

    I can collect data from a hygrometer in a text file using the RS232 port with the following T75.2F:H17.0% format, these data are collected using a data logger software. I was wondering if I can collect this data for later analysis using Dasylab. Any help is appreciated.

    The setting below causes the error. Change for the second selection, output values of all channels.

  • Do I need to use the software provided with the wireless hardware to go wireless? __

    I have a router Linksys Wireless (wrt160n) that I am not using. I whant to buy a (Linksys WUSB600N) for my office. I want to know if I need to use the software supplied with the hardware, or can I just use Microsoft Wizard to configure my network? Operating system is Vista Premium.

    Thank you Jeremy will do.

Maybe you are looking for