Triggering DAQmx from a GPIB device

Hi,
We have a GPIB device that sends out trigger signal to the computer, and we want the DAQmx card (PCI-6052E) to listen to that trigger signal. We tried doing this:
m_referenceTriggerEdge = DAQmxAnalogEdgeStartTriggerSlopeRising;
    try
        // Create the voltage channel
        m_task->AIChannels.CreateVoltageChannel(channelName, "",
            static_cast<DAQmxAITerminalConfiguration>(-1),
            minimum, maximum, DAQmxAIVoltageUnitsVolts);
        // configure the internal clock
        m_task->Timing.ConfigureSampleClock("", rate, DAQmxSampleClockActiveEdgeRising,
            DAQmxSampleQuantityModeFiniteSamples, samplesPerChannel);
        // Set up the start trigger
        m_task->Triggers.StartTrigger.ConfigureAnalogEdgeTrigger(triggerSource,
            m_referenceTriggerEdge, triggerLevel);
        m_task->Triggers.StartTrigger.AnalogEdge.Hysteresis = hysteresis;
        (omitted a few graphing codes in between)
        // Begin the reading or whatever
        m_reader = std::auto_ptr<CNiDAQmxAnalogMultiChannelReader>
            (new CNiDAQmxAnalogMultiChannelReader(m_task->Stream));
        m_reader->InstallEventHandler(*this, OnEvent);
        m_reader->ReadMultiSampleAsync(samplesPerChannel, m_data);
By default, triggersource is set to "PFI0" and triggerlevel is set to "1.00". The result, however, is rather peculiar: There will always be a 200284 error, unless the triggerlevel is set to "0" while its previous run is set to "1". In other words, if first run the acquisition using triggerlevel "1", which would still give the error, but then if the next one is set to "0", DAQ sees the trigger. However, if one continues to run using triggerlevel "0", the subsequent runs will give the error. Where did we do wrong?
Also, is there a way to use Measurement and Automation to measure the trigger signal coming cross GPIB?
Thanks,
Jim

Hi Jacob,
Thanks for the reply! The error message is as followed:
Some or all of the samples requested have not yet been acquired.
To wait for the samples to become available use a longer read timeout or read later in your program. To make the samples available sooner, increase the sample rate. If your task uses a start trigger,  make sure that your start trigger is configured correctly. It is also possible that you configured the task for external timing, and no clock was supplied. If this is the case, supply an external clock.
Property: CNiDAQmxStream::ReadRelativeTo
Corresponding Value: DAQmxReadRelativeToCurrentReadPosition
Property: CNiDAQmxStream::ReadOffset
Corresponding Value:
Task Name: aiTask
Status Code: -200284
And the rest of the default parameters are below:
minimum = 0.000
maximum = 10.000
samplesPerChannel = 1000
rate = 1000
hysteresis = 0.00
Thanks,
Jim

Similar Messages

  • How to read data from a GPIB when sending a function generator command

    I'm using Visual C++ with the ComponentWork ActiveX and I'm tring to plot a
    CWGraph using the data coming from a GPIB device. When I write command such
    as "*IDN?" to the GPIB device, everythings if fine and I can read what the
    GPIB device return me. But when I send a command like "SOUR:FUNC SIN;SENS
    DATA?", the writing seems to be okay, but when I try to read the data, I
    alway get a "Timeout expired before operation completed" error message. I
    have tried with the CWGPIB and with the CWVISA but the result are the same
    with both.
    My reading code looks like this:
    COleVariant vReadBuffer;
    vReadBuffer = m_VISA.Read( COleVariant( (short) 2000 ) );
    and it work fi
    ne for "*IDN?" or for multimeters command.
    I want to know how I must read the data for function generator commands.
    Thank alot

    It sounds like your device is not accepting that command string as valid. The string you listed above is probably missing a colon between SENS and DATA. "SOUR:FUNC SIN;SENSATA" Try sending this string in Measurement & Automation Explorer to the instrument first to make sure it is working.
    Best Regards,
    Chris Matthews
    Measurement Studio Support Manager

  • Data logging with gpib device

    I have a lock-in amp controlled by labview via gpib. My goal is to use the
    "advanced data logger" supplied with labview to log data from a daq card
    and the output from the lock-in amp. I have the lock-in vi working correctly
    and have the output on the screen. I don't know how to get the pre-packaged
    "advanced data logger" to read in data from the gpib device. I can only
    read in data from my daq card.
    Any assistance in this matter would be appreciated.

    1.  An OR function should work just fine for you.  I don't understand what you mean that the functionality changed.  If the reset button is true OR the Trip button is true, then a True gets put in the notifier and the Trip file functions are executed.
    I don't understand your "Scale".  Right now you have a zero if the button is true and 100 if it is false.  You don't have anything else going on with it.  I don't understand the stay at zero part.  How would it ever get to the point where it isn't zero.
    2.  For the main log file, you could detect when 43200 iterations of the loop have passed and at that time, just reset the writing to the beginning of the file.
    See attached.
    Attachments:
    Save_Previous_10_SecondsMOD3.vi ‏27 KB

  • Problems with GPIB devices

    When running my program to control a measurement, everything works fine.
    The program can communicate with all the GPIB devices. When I start
    the program again (without rebooting Win2K), from time to time it
    refuses to communicate with the GPIB units. Now I found out it helps
    to start MAX2.2 (Measurement & Automation Explorer) and to scan the GPIB
    bus. MAX identifies all devices without problems and my LabVIEW program
    also runs fine now...
    So why do I have to call MAX to have my LabVIEW program have a communication
    via GPIB?

    [email protected] (Gerd W.) wrote in message news:<[email protected]​com>...
    > When running my program to control a measurement, everything works fine.
    > The program can communicate with all the GPIB devices. When I start
    > the program again (without rebooting Win2K), from time to time it
    > refuses to communicate with the GPIB units. Now I found out it helps
    > to start MAX2.2 (Measurement & Automation Explorer) and to scan the GPIB
    > bus. MAX identifies all devices without problems and my LabVIEW program
    > also runs fine now...
    > So why do I have to call MAX to have my LabVIEW program have a communication
    > via GPIB?
    Do you use VISA or regular GPIB functions? If use VISA, you may have
    to close it properly when your software exit, oth
    erwise the resources
    may be locked up. And by using MAX somehow the resources is freed by
    it after it's operation.
    Irene
    www.geocities.com/irene_he

  • How to plot data from a GPIB function generator

    I am doing a litle application with Visual C++ and the ComponentWorks++ to
    control a GPIB device. I am tring to Plot a CNiGraph with data coming from
    the GPIB function generator. I use the code below to write/read the device
    and to Plot the graph. It give me some results but for exemple, if I
    request a sin wave it give me something that doesn't look like a sin and if
    I request a square wave it give me about the same wave... So I want to know
    if the problem is in my code or maybe it's because my device is just a
    emulator not a real func generator. But I guest I am doing some kind of
    convertion error.
    CNiInt16Vector vBuffer(100); // Should I try CNiReal64Vector or something
    else ?
    m_Visa->Write(m_strC
    ommande); // Write to the device, this works well
    m_Visa->Read(vBuffer); // Is it the right way to do reading ?
    m_Graph.PlotY(vBuffer); // This Plot some data, but it doesn't seem right
    Could somebody bring the light on this?
    Thanks alot!
    P.S. Sorry for the bad english...

    Ares:
    I have two suggestions about common problems in VISA.
    (1) How is m_Visa defined? There is occasionally some confusion about which VISA class should be used for this purpose. CNiVisaSession is the class designed for this purpose.
    (2) How is the instrument returning data? Usually instruments return some sort of header before the actual data.
    You may want to contact National Instruments Technical Support to continue this discussion. You can reach our telephone support at 1-800-IEEE-488 or email support at http://www.ni.com/ask.
    Good Luck,
    Chris Wood
    Applications Engineer
    National Instruments

  • Errors communicating with my GPIB device in C++

    I am trying to communicate with a GPIB device via a custom C++ program.  I am using ni488-2.h and the associated obj file.
    When I send the commands to the device "manually" through the Measurement & Automation Explorer, everything seems to work fine, consistantly.
    However, when I try sending commands via code, per the example provided ("Show Sample") button.  Some commands return an error, but not all of them, and not always the same ones.
    The Measurement & Automation Explorer seems to wait after I send a command, and displays "Reading..." indicating that it is doing some sort of check to ensure there is data to be read...or something.  However the sample code doesn't do this.  It's the only difference I can find, without actually being able to see the code M&A Explorer uses.
    Any help would be appreciated.
    Thanks
    EDIT: The device I am communicating with: S380 Dual Channel Optometer (UDT Instruments)
    via: GPIB-USB-HS
    using drivers (header file etc.) from May/Jun 2014

    If you installed NI-488.2, it will install sample programs. In Windows 8.1 C:\Users\Public\Documents\National Instruments\NI-488.2\Examples

  • I cant find my GPIB device in the VISA resources list

    Hi,
    I am using Labview 8.5.1. I am trying to program my Agilent multimeter with Labview. I have downloaded the drivers for the model. HOwever, I dont see the device on the VISA resources list. All I see is COM, LPT1 and refresh. Is there a solution for this?
    Regards,
    Wiki

    Hi r31415smith,
    There maybe a little of confusion here but, I believe when communicating with a GPIB device you would want to use VISA commands and when you are looking to communicate over the serial port you use the VISA-Serial commands.  The Basic Serial Write and Read.vi is looking specifically for a serial port.  
    If you downloaded the keithley drivers from here and installed them using the directions from here.  Then there should be Keithley examples installed on your computer.  If you open Labview 2010 and navigate to Help > Find Instrument Drivers.  A dialog will open up and show you the installed instruments.  Then, if you click on Keithley 24xx it will show you example files for communicating with your instrument.
    I think that if the Basic Serial Read Write had worked in the 8.5 the example file may have been change to only work with a visa serial instead of general VISA.  
    Hopefully this has helped you out and shed some light on what is going on. 
    Regards,
    Mike Altmann
    LabVIEW Platform PSE
    National Instruments

  • I cannot send email - error message as follows : 'The sender address (my email address) was rejected by the server smtp.tiscali.co.uk.' I can send email from other apple devices, and the email settings are identical. Any ideas?

    For some reason I cannot send email - all was working fine, but now I get the following error message when I try to send email:
    'The sender address (my email address) was rejected by the server smtp.tiscali.co.uk'
    I can receive incoming mail ok and I can send email from other Apple devices. The problem seems confined to my Mac Book Pro.
    Ant ideas?

    Hello there, Pablo639.
    The following Knowledge Base article offers up some great steps for troubleshooting mail issues on your Mac:
    OS X Mail: Troubleshooting sending and receiving email messages
    http://support.apple.com/kb/TS3276
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Setting Up Google Chrome Features for Cloud Printing from an Android Device

    These steps are organized for optimal setup procedure and to decrease the time it would take to set this option up from start to finish. This is a lengthy process and is more for possibly troubleshooting issues that may arise during the setup of Google Chrome's Cloud Print feature. However, if you have an Android phone or tablet and are interested in being able to print virtually anything at anytime from anywhere from your phone to any brand of printer regardless of setup, there is a way. And this is how:
    Open/Install Google Chrome onto a computer
    Sign in with personal email to access the same Google Chrome account you intent to print from
    Download Google Drive as an external storage you can access from anywhere
    Open Google Chrome Settings (three lines stacked on top of each other)
    Scroll down to the bottom of settings and click "Advanced Settings"
    "Sign in/add printers/manage printers" are three of the print options you may see here 
    Follow this link for information on:
    adding a classic printer to this option:  https://support.google.com/cloudprint/answer/1686197?rd=1
    how to add an HP ePrint email:  https://www.google.com/cloudprint/learn/printers.html#info-hp
    on registering the email of that printer (HP registration page):   https://www.google.com/cloudprint/learn/setup-hp.html
    8.  add the printer to this section of Google Chrome
    9.  at the bottom of the page you will see "Send a test page/print test page" (that will be useful later)
    10. at the top of this page is the option to share this printer with other Google Chrome users
    11. Open Google Drive from www.google.com (likely displayed at the top of the webpage)
    Can create a new document of any file type, upload, draw, etc
    Leave computer on if intending to print from off the network or another location
    The next steps are in regards to printing from a mobile device:
    Install/open Cloud Print App
    Add personal email account associated with Google Chrome
    Select printer management if on the same network as the printer
    Select Web tab and Google Drive if not on the same home network
    Find earlier test page in Google Drive Documents
    To locate other documents one could find many applications within this app or
     In another app like Documents To Go, you can select to send previously saved documents (like one might send an email on the Android) to the Cloud Print app to open, view, and print
    Print Test Document – this function means the printer has officially been added now
    In Google Drive, but within the Cloud Print app, you can select the printer that was added to this network or from "Printer Management Options."
    There are many ways to determine if your printer is still connected (offline, ready, etc.) but after confirmation that the printer is available, print jobs rest in the print queue until the printer receives the command to print.  Then the documents are stored and available for reprinting.
     Converts most print jobs to .pdf but prints most file formats from other applications as well
    In Printer Management advanced settings
    You can add a contact from the phone to use this printer
    Set as default
    See an extensive page of setup and printing options
    *After a test print while the computer was off the document did not print and the printer appeared offline until approx. 4 min after computer was rebooted, then the document printed automatically.
    Also if a document does not print, the troubleshooting guide on the phone suggested logging out of Google Chrome Cloud Print but I was unable to find that option it was suggesting (unable to log out)
    To completely finish adding any additional Google Chrome accounts that wish to share this printer using the suggestion in step 10, you must log into the email that was added and select ADD PRINTER from within the email that was sent for the confirmation and follow the link and instructions on how to do this from your email.
    Google Chrome and Google Drive support Windows, MAC, and Linux
    You can also change share options, privacy settings, etc. but if you choose to go with the two-step verification process, you may not be able to add your Google Chrome email account to the app without a 16 digit code generated within Google Chrome Privacy Settings for your app (not recommended)
    Now you have the option to also email any document to either the Cloud Print App or HP ePrint from the phone/tablet without actually accessing the app first.  Locate the document, press the menu button for more options, select "Send to" and a list of available apps will appear.  Choosing Cloud Print or HP ePrint sends the document or photo directly to the "print" function within the apps, instead of opening the app first and then searching for what it is you want to print.
    **computer connected to printer must be on**
    Requirements:  a) Google Chrome, Google Drive, and Cloud Print mobile app  b)  These steps outline the use of an Android device on the network for setup  c) will need the computer connected to the printer to be on at all times   d) go to this webpage http://www.google.com/cloudprint/learn/  if you have any more questions.
    Available features of Cloud Print App
    a.  Print all file formats from Google Drive (uploaded or create)
    b.  Has an internal notepad and drawing tool
    c.  Prints off all contacts and phone numbers as well as specified text messages
    d. The scan option actually just means take a picture
    e. Without Cloud Print Pro you get 5 days to test the features of printing Facebook pictures, Drop Box and Schedules before those features are no longer available
    Don't forgot to say thanks by giving "Kudos" if I helped solve your problem.
    When a solution is found please mark the post that solves your issue.
    Every problem has a solution!
    This question was solved.
    View Solution.

    This document is to assist others in understanding and troubleshooting Cloud Print. This took me many hours to get setup, troubleshoot, and prepare a document that is simple and easy to understand. These are literally step-by-step instructions on how you could be able to print from any Android device to any printer connected to a computer that has Google Chrome.  You would then be able to use the Cloud Print App without having to use HP ePrint to print to any printer connected to any computer (USB or wireless) basically allowing you to print virtually anything from your Android. 
    Don't forgot to say thanks by giving "Kudos" if I helped solve your problem.
    When a solution is found please mark the post that solves your issue.
    Every problem has a solution!

  • HT201304 It would be tremendously helpful to be able to access, set restrictions, and make changes from the parents device to all devices under the same iTunes account, so that I could make changes to my kids devices without physical access.

    Please help!
    It would be tremendously helpful to be able to access, set restrictions, and make changes from the parents device, to all devices under the same iTunes account, so that I could make changes to my kids devices without physical access.
    I understand that I can set up a different Apple ID for the kids devices, or take physical control of the device and make the changes myself. However, my teenage son is technically savvy enough to have a job in Silicon Valley, as are most young people these days. However, in order to access his devices the current way, I first have to bypass the four digit pass code. This starts a fight of why I need in the device and continues to escalate. The argument that I am the parent will gain access but the fight is simply exhausting, and quite frankly shouldn't have to happen at all. He is not yet an adult, he did not pay for his iPad or iPhone and I, as a parent, should have not only have the right to change options at will, and from anywhere, but look at history or current activity when I feel like it.
    I currently have the settings where app and in-app purchases require my password to be put in, and he must come to me to type it in, but I need more control and would like, and should be able to access any of our six devices and make individual changes simply by logging in to my account, with my password.
    If I can see all my devices on the "Lost My iPhone" app, this technology should be easy to make happen.
    C'mon parents! I have a pretty good kid, given all things that they can get into, but I am not stupid. For everything I see has been done, there is much more I haven't seen. I want my children to be kept safe and be able to know what they are looking at or listening to. We parents are the only ones who know our beliefs and what our kids can handle and when.
    Thanks for any support or information that I may be missing in order to fulfill my request.

    There are mobile device management solutions that can do this, including in Apple's OS X Server system, but most parents generally find that setting this up is more work than it's worth. If you're interested, though, there are a couple that at least purport to be free (I don't know if there are any hidden "gotchas"):
    http://www.unwireddevicelink.com/features/
    https://meraki.cisco.com/products/systems-manager
    and Apple's system:
    http://www.apple.com/osx/server/features/#profile-manager
    I don't think any, however, allow you to see current activity or browser history. iOS doesn't expose those to access from MDM solutions, to the best of my knowledge.
    Regards.

  • After upgrading to Photos, how can I work on a Book Project from another apple device?

    After upgrading to Photos, how can I work on a Book Project from another apple device?

    I'm not sure I understand what you are asking, but on the device/Settings, do you have iCloud and Photos sync turned on?

  • How can I copy datafile (from one Raw device) to another Raw device ???

    can anybody tell me how do i copy/move one datafile from one raw device to another raw device.... ?
    I am having AIX 5.3 with SAN.
    Pls. help me...
    regards,
    Star Nirav

    Hello Hans,
    Currently I am using via RMAN... Want to know which one help me....? Is there any size limitation via dd command ? Can I use iocopy instead of dd in AIX ?
    man dd

  • How do I share my music from one Appel device to another ?

    How do I share my music from one Appel device to another ? ie From mi Imac to my Iphone ?
    Can I retrieve easily all the music I bought on I tune ?

    Click here and follow the instructions.
    (89891)

  • How can i remove a device from my authorised devices on apple account?

    How can i remove a device from my authorised devices on apple account?

    Dr mizooo_1985 wrote:
    And i didn' erase anything,
    Hope her new BF is not a forensics expert .
      Can she see my icloud-backups???
    Not unless she knows your Apple ID/Password...or her new BF is good at forensics.
    What can i do to prevent icloud-backup to this pc???
    Same as my last answer...good luck.

  • Somehow my MacBookPro iCloud account has a different name and password from my other devices.  Even my date of birth is listed incorrectly.  I have tried but can't seem to change this info to match up with my other devices.  Can someone help?

    Somehow my MacBookPro iCloud account has a different name and password from my other devices.  Even my date of birth is listed incorrectly.  I have tried but can't seem to change this info to match up with my other devices.  Can someone help?

    Thanks
    I have a PC (Windows 7)
    Not sure when mobile me changed, but it was this weekend that my storage etc. lapsed (I have paid to keep storage with icloud). So i assume this has something to with it stopping.

Maybe you are looking for