How do I get callback or windows messaging Events working on a 6534 card do pattern output?

Hi,
I am working on a fast track project and I am trying unsuccesfully to get my buffered output to work. I have 827 different size buffers of data that I need to output to a digital output. I need to wait until each buffer is output, then call some other functions before outputing the next buffer.
Although I only want to set one bit on and off I have i16 buffers that contains my data. I have based my program on the 6523SingleBufferedOutput NI-DAQ example. However I do not want to poll the number of buffer elements remaining, I want to use the NI-DAQ event message to tell my code when the DIG_Block_Out function is complete. This appears to be message type 2. I am basing the ev
ent code from another example in the Function Reference Manual. I have tried both a callback and an window message, but neither function is ever called. I am not sure if the problem is to do with the event configuration or the DO not completing. It does look like only part of my data is being output, however I tried with message type to send a message after n scans and it did not call my functions either.
I can send code to anyone who is willing to help. Help would be really be appreciated as I am behind now on my project,
Thanks,
David

Here is the code
CImagePipeline::CImagePipeline(CGilbertDlg* pGilbertDlg, CSettings* pPrintSettings, CFloydFile* pDataFile) :
m_pGilbertDlg(pGilbertDlg), m_pPrintSettings(pPrintSettings), m_pImageFile(pDataFile), m_nPgTB(0), m_nReqInt(0),
iRetVal(0), iDevice(1), iGroup (1), iGroupSize (2), iPort (0), iDir (1)
, iPgConfig (1), iReqSource (0), iExtGate (0), iStartTrigON (1), iStartTrigOFF (0)
, iStartPol (0), iStopTrig (0), iStopPol (0), ulPtsAfterStopTrig (0), ulPattern (0)
, ulPatternMask (0), iResource (11), ulRemaining (1), ulAlignIndex (0), iIgnoreWarning (0)
, iYieldON (1), iDBModeON (1), iDBModeOFF(0), iOldDataStop(1), iPartialTransfer(0), lTimeout(180)
, m_nStatus(0), iStatus(0), ulCount(0), ulBufferSize(0)
CalculateTimebase();
Cleanup();
CleanupNIDAQEvents();
ReformatPipelineData();
m_nStatus = Configure();
iStatus = SetupNIDAQEvents();
if (iStatus != 0)
iRetVal = NIDAQErrorHandler(iStatus, "SetupNIDAQEvents",
iIgnoreWarning);
//##ModelId=3D496BB30271
CImagePipeline::~CImagePipeline()
CleanupNIDAQEvents();
Cleanup();
i16 CImagePipeline:etupNIDAQEvents()
// declare/initialize local variables
short iErr = 0,
iDevCode = 0,
iTimeBase = 0;
static short
ipBuffer[1000] = {0};
unsigned short
uSampInterval = 0;
unsigned long
ulCount = 1000;
char cpChanStr[5] = {0};
* INITIALIZE DAQ Device (optional)
iErr = Init_DA_Brds(iDevice, &iDevCode);
CHECK_RETURN_CONDITION(iErr);
* CONFIGURE DAQ Event
// setup channel string for DAQ Event
wsprintf(cpChanStr, "DOGRP%-d\0", iGroup);
// call Config_DAQ_Event_Message
iErr = Config_DAQ_Event_Message(iDevice,
(i16) 1, // add message
cpChanStr, // channel string
(i16) 1,// daq event type
(i32) 1,// DAQTrigVal0
(i32) 0,// DAQTrigVal1
(u32) 0,// trigSkipCount
(u32) 0,// preTrigScans
(u32) 0,// postTrigScans
m_pGilbertDlg->m_hWnd,// handle
(i16) WM_NIDAQ_MSG,// message
(u32) NULL);// callbackAddr
CHECK_RETURN_CONDITION(iErr);
iErr = Config_DAQ_Event_Message(iDevice,
(i16) 1, // add message
cpChanStr, // channel string
(i16) 2,// daq event type
(i32) 0,// DAQTrigVal0
(i32) 0,// DAQTrigVal1
(u32) 0,// trigSkipCount
(u32) 0,// preTrigScans
(u32) 0,// postTrigScans
NULL,// handle
(i16) NULL,// message
(u32) &mycallback);// callbackAddr
CHECK_RETURN_CONDITION(iErr);
return 0;
// FUNCTION: CleanupNIDAQEvents
// CHANGE THIS AS NECESSARY
void CImagePipeline::CleanupNIDAQEvents()
* Stop async operation
DAQ_Clear(iDevice);
* CLEAR all DAQ Events!
Config_DAQ_Event_Message(iDevice,
(i16) 0,
(i16) 2,
(i32) 0,
(i32) 0,
(u32) 0,
(u32) 0,
(u32) 0,
NULL,
(i16) NULL,
(u32) NULL);
void mycallback(short handle, short msg, unsigned short wParam, unsigned long lParam)
short doneFlag = (wParam & 0xFF00) >> 8;
if (doneFlag)
if (!SetEvent(CGilbertDlg::m_hTrackDone))
DWORD dwErrorCode = GetLastError();
void CImagePipeline::GenerateSingleTrackData(int trackNum)
static i16 piBuffer[400] = {0};
u32 ulCount = 200;
iStatus = NIDAQMakeBuffer(piBuffer, ulCount, WFM_DATA_I16);
if (iStatus == 0)
m_nStatus = Configure();
ulBufferSize = ulCount * 2;
iStatus = Align_DMA_Buffer(iDevice, iResource, piBuffer,
ulCount, ulBufferSize, &ulAlignIndex);
iRetVal = NIDAQErrorHandler(iStatus, "Align_DMA_Buffer",
iIgnoreWarning);
/* Start the pattern generation output of 100 "items" upon the
digital start trigger. */
iStatus = DIG_Block_Out(iDevice, iGroup, piBuffer, ulCount+1);
iRetVal = NIDAQErrorHandler(iStatus, "DIG_Block_Out",
iIgnoreWarning);
else {
AfxMessageBox(" The buffer was not made correctly. Check the parameters for NIDAQMakeBuffer.");
short CImagePipeline::Configure()
short status = 0;
iStatus = DIG_Grp_Config(iDevice, iGroup, iGroupSize, iPort,
iDir);
if (iStatus != 0)
iRetVal = NIDAQErrorHandler(iStatus, "DIG_Grp_Config",
iIgnoreWarning);
status = iStatus;
/* Configure internally timed pattern generation with timebase
m_nPgTB, interval m_nReqInt, and no external gating. */
iStatus = DIG_Block_PG_Config(iDevice, iGroup, iPgConfig,
iReqSource, m_nPgTB, m_nReqInt, iExtGate);
if (iStatus != 0)
iRetVal = NIDAQErrorHandler(iStatus, "DIG_Block_PG_Config",
iIgnoreWarning);
status = iStatus;
/* Configure for digital start trigger. */
iStatus = DIG_Trigger_Config(iDevice, iGroup, iStartTrigOFF,
iStartPol, iStopTrig, iStopPol, ulPtsAfterStopTrig, ulPattern,
ulPatternMask);
if (iStatus != 0)
iRetVal = NIDAQErrorHandler(iStatus, "DIG_Trigger_Config",
iIgnoreWarning);
status = iStatus;
return status;
int CImagePipeline::Cleanup()
/* CLEANUP - Don't check for errors on purpose. */
/* Set trigger mode to initial state. */
iStatus = DIG_Trigger_Config(iDevice, iGroup, iStartTrigOFF,
iStartPol, iStopTrig, iStopPol, ulPtsAfterStopTrig, ulPattern,
ulPatternMask);
/* Clear the block operation. */
iStatus = DIG_Block_Clear(iDevice, iGroup);
/* Unconfigure group. */
iStatus = DIG_Grp_Config(iDevice, iGroup, 0, 0, 0);
int numTracks = m_pImageFile->m_FileHeader.get_NumTracks();
for (int trackNum = 0; trackNum < numTracks; trackNum++)// loop through all tracks
if (m_vTrackData.size()>0)
if (m_vTrackData.at(trackNum))
delete m_vTrackData.at(trackNum);
return iStatus;
void CImagePipeline::CleanupNIDAQEvents()
* Stop async operation
DAQ_Clear(iDevice);
* CLEAR all DAQ Events!
Config_DAQ_Event_Message(iDevice,
(i16) 0,
(i16) 2,
(i32) 0,
(i32) 0,
(u32) 0,
(u32) 0,
(u32) 0,
NULL,
(i16) NULL,
(u32) NULL);

Similar Messages

  • How do I get "fit to window width" to work?

    I'm having a problem getting "fit to window width" to work.  It was working ok until recently.  I'm viewing a letter size page and full page view is at 73.1%.  When I select fit to window width it goes to 72.9% and is still in full page view.
    Is there some setting somewhere to fix this?
    Thanks,
    Mike

    Hi Mike20878,
    Thank You for posting on the forums. Kindly try the steps mentioned below, hope it helps.
    1) Open Acrobat
    2) Click on Edit>Preferences
    3) Go to Page Display under Categories
    4) Change the ZOOM to "Fit Width"
    5) Click OK
    6) Restart Acrobat and then open the file.
    The preference now saved would apply to all files.
    Thanks,
    Vikrantt Singh

  • How do I get rid of "Windows No Disk Exception Processing Message c0000013 Parameters 75b6bf7c 4 75b6bf7c 75b6bf7c" when firefox starts up ? Does not show a solution!

    How do I get rid of "Windows No Disk Exception Processing Message c0000013 Parameters 75b6bf7c 4 75b6bf7c 75b6bf7c" when firefox starts up, I have to hit continue twice to get past this error message. Then all is OK. The solution shown for this thread does not make sense.
    == This happened ==
    Every time Firefox opened
    == Firefox was updated

    In Google, search for ""Windows No Disk Exception Processing" (including quotation marks). Lots of different answers out there.
    632 results on this search limited to the last year:
    https://encrypted.google.com/advanced_search?q=%22Windows+No+Disk+Exception+Processing%22&hl=en&lr=&tbs=qdr:y&prmd=df

  • How can I get a small window to open when a link is clicked (AS2)

    Hi i,m developing a HTML site and used one animated flash button(AS2) I want a small sized window to open when a user clicks on a button.
    The window will contain information that i want to display.It dosnt require a normal 800x600 window to open. I just want a 1/4 size of 800x600 etc. Is this possible and if so how.
    I havnt done this before
    Thanks
    Manoj

    HELLO NED,
    I WAS RECEIVING MANY MAILS FROM YOU, BUT I DON'T UNDERSTAND WHY DOESN'T RELATED WITH MY PETITION, I SEND
    TO YOU AGAIN MY QUESTION, AND IF YOU CAN HELP ME I APPRECIATED VERY MUCH LET ME KNOW.
    THIS IS MY QUESTION....."ABOUT DATAGRID AS3
    Hello Ned, I appreciate very much your soon answer, I believe you have understand me, but how can I do that? could you give some help? This is part of the code and this is the function that I use
    var url: String = "xmls/rests.xml";
    var req:URLRequest = new URLRequest(url);
    var myLoader:URLLoader = new URLLoader();
    myLoader.addEventListener(Event.COMPLETE, completeHandler);
    myLoader.load(req);
    function completHandler(event:Event):void {
           var myLoader:URLLoader = event.currentTarget as URLLoader;
           var xmlDP:XML = new XML (myLoader.data);
           XML.ignoreWhitespace = true;
           dp = new DataProvider(xmlDP);
           dp = sortOn("name", Array.CASEINSENSITIVE);
           dDg.dataProvider = dp;
           aDg.addEventListener(Event.CHANGE, changeHandler);
           function changeHandler(event:Event): void {
                var thisItem:Object = eve.target.selectedItem;
                descripTa.text = thisItem.description;
                aUI.source = (thisItem.image);
                preloader_mc.visible = true;
    My intention is that when a button from a main (swf) loads the swf it displayed the first selected item with a image (UILoader) and the description (TextArea)
    Thanks in advance Ned
    Joselyn             .................."
    THANKS AGAIN NED
    REGARDS
    JOSELYN
    Date: Thu, 13 Oct 2011 07:49:02 -0600
    From: [email protected]
    To: [email protected]
    Subject: How can I get a small window to open when a link is clicked (AS2)
    Re: How can I get a small window to open when a link is clicked (AS2) created by Ned Murphy in Flash Pro - General - View the full discussion
    Look at the Methods section and choose whichever suits your needs, the first one listed does not.
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/3969302#3969302
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/3969302#3969302. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Flash Pro - General by email or at Adobe Forums
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • How can I get past the error messages that keep popping up when I try to download Flash player?

    How can I get past the error messages that keep popping up every time I try to download anything?

    Hi
    Could you please let us know more about the error messages that you got?
    The following page has information on the error messages: http://helpx.adobe.com/content/help/en/flash-player/kb/installation-problems-flash-player- windows.html
    Thanks,
    Sunil

  • My iPad screen is stuck on an alert message telling me that I have not backed up to iCloud in 5 weeks. How do I get pass this alert message?

    My iPad screen is stuck on an alert message that is informing me that I have not backed up to iCloud in 5 weeks. How do I get pass this alert message.

    I have been dealing with this problem since upgrading to ios 6.  I have an old ipod touch that is still running ios 5.? that backs up daily with no problem whatsoever.  I have attemped every solution posted on these help boards (i.e. deleting accounts, turning off all apps from back-up, restarting device, changing routers, attempting back-ups through different wifi spots) sometimes one or a combination of these band-aid fixes will work for a day or two, then suddenly the ipad (version 3) will simply stop backing up, and I will spend hours of frustration going through all the tedious fixes.  All the while my old ipod touch running ios 5 backs up daily with no problem whatsoever.  I have called Apple support and they seemed surprised that this is a problem and offer no real solution whatsoever.
    Until Apple gets their head out of the sand on this one, and actually fixes the obvious bug that exists is ios 6 this problem will continue and will not be resolved.

  • How can i get back to windows 8 if i downgrade my laptop to windows 7

    My laptop was been downgrade from windows 8 to windows  7because of graphics not funtioning properly. how can i get back to windows 8 again? is there a recovery disc for this?

    Hi:
    Did you install the correct W7 x64 graphics driver that should work on your model?
    http://h10025.www1.hp.com/ewfrf/wc/softwareDownloadIndex?softwareitem=ob-111285-1&cc=us&dlc=en&lc=en...

  • How do I get the activity window in safari 6.0.2?

    How do I get the activity window in safari 6.0.2?

    Safari 6
    Activity Window is no more available in Safari 6.
    Apple removed that feature.
    Best.

  • I updated to yosemite and now if someone is using imessage and sends a text message to my phone it doesn't show up on my phone but does on my computer.  I don't want messages on my computer!  How do I get this to go away and work like it used to?

    I updated to yosemite and now if someone is using imessage and sends a text message to my phone it doesn't show up on my phone but does on my computer.  I don't want messages on my computer!  How do I get this to go away and work like it used to?

    Follow the instructions under the heading "How to unlink a phone number" on this page.

  • How do I get email and text message notifications when my phone is locked?

    How do I get email and text message banner notifications on my iphone when the phone is locked? When I had iOS 6 I could get notifications with sound and banner. Now that I have iOS7 I can't see notificaitons when the phone is locked.

    See if this support document about Notifications helps. http://support.apple.com/kb/HT3576

  • How can I get my hp Laserjet 1012 to work with Windows 7?

    How can I get my hp Laserjet 1012 to work with Windows 7?

    Here is a list of products that are not supported in the win7 OS. This product is listed there.
    Products not supported in win7
    I am an HP employee.
    Say Thanks by clicking the Kudos Star in the post that helped you.
    Please mark the post that solves your problem as Accepted Solution

  • How do I get home page window to appear when opening FF?

    How do I get my homepage window to appear when I open FF?
    When I go to the dock and click on the FF icon,
    ''Firefox ''appears in the menu bar but there is no home page window showing. I have to go to ''File'' and select ''New Window'' to get to my home page window.
    In FF Preferences I have selected:
    "Show my home page" and the correct home page address is shown.
    I deleted FF application/program (dragged to trash can) and then re-installed it. That did not help.
    I occasionally use Safari and there is no problem with the home page showing right away when I open Safari.

    The file you need toi backup is name domain.sites2 and is located in your Users/Home() /Library/Application Support/iWeb folder.  Without that file you won't be able to continue to edit and maintain your website.
    However, remember this:
    NOTE: In Lion and Mountain Lion the Home()/Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
    So if you're running Lion or Mt Lion you'll need to make that library visible before you can find and backup the domain.sites2 file.

  • How can I get rid of windows 8.1 in my new lenovo and get windows 7 put in?

    How can I get rid of Windows 8.1 on my new Lenovo laptop and install Windows 7?

    Hi,
    I'll assume your laptop was upgraded from Windows 7 to Windows 8.1
    1. Start by copying all your personal folders (Documents, Pictures, Music, Videos, Favourites, local databases,
    hosts files, etc) into an external disk, DVD, tape, whatever.
    2. If I were you, I wouldn't use Windows 8.1 backup tool, I'm not sure Windows 7 Restore applet will be able
    to read a Windows 8.1 backup.
    3. Check that you have all the necessary licenses, CDs and executables to reinstall your former Windows 7
    applications, components, browsers, plugins, Java, .NET Frameworks, etc. Be aware that some applications require
    to keep same hostname and/or same IP and/or or same local username (or all of them) as they were on the original
    Windows 7 machine.
    4. Check that you have your Windows 7 CD and license handy.
    5. Do you have a Windows 7 image backup of your laptop (prior to the Windows 8 upgrade)?
    5.a Yes? Then restore that image and restore your personal folders on top. You might need to
    install or reinstall some of the applications I mentioned on #3
    5.b No? You'll have to format your laptop, install Windows 7 from scratch, create your local
    user with administrative rights, install SP1, install necessary updates, reinstall all your
    applications and finally restore your personal folders.
    Sebastian Sajaroff Senior DBA Pharmacies Jean Coutu

  • How do I get all Finder windows to open in spatial view?

    How do I get all Finder windows without special view options set to open in the 'spatial' mode (without the toobar or sidebar)? The ones I specifically change stay that way, but I want all new and old folders to be like that too.

    That's called the simple Finder mode. You would need to configure that as part of Parental Controls in the Accounts preferences. To make any Finder window appear that way jut click on the gadget in the top right corner of the Finder window.

  • How can I get rid of the message that I am using a trial version of Photoshop CC even after becoming a paying member for Photoshop CC and Lightroom ?

    After having payed fo an account for one year for Photoshop CC and Lightroom 5 i keep getting the message ,that I am using a trial version of Photoshop CC.
    Lightroom on the other hand is not functioning in a trial version !
    Could anyone tell me how I can start working with Photoshop CC while not in trial mode ?
    Peter

    I Don’t know how I di dit, but when I started Photoshop this mornig all of a sudden it worked.
    I am happy now and thank you for your efforts.
    Regards
    Peter Hordijk
    Van: Rajshree 
    Verzonden: woensdag 21 mei 2014 19:04
    Aan: Peter Hordijk
    Onderwerp:  How can I get rid of the message that I am using a trial version of Photoshop CC even after becoming a paying member for Photoshop CC and Lightroom ?
    How can I get rid of the message that I am using a trial version of Photoshop CC even after becoming a paying member for Photoshop CC and Lightroom ?
    created by Rajshree <https://forums.adobe.com/people/Rajshree>  in Adobe Creative Cloud - View the full discussion <https://forums.adobe.com/message/6398343#6398343>

Maybe you are looking for

  • Vendor and Customer Hard and Group Currency balances

    Please let me know the table names of Vendor, Customer and GL balances for Hard and Group currencies (Ex KNC1 for Customer balance in Company Code Currency) Ramesh

  • Bookmarks save only in 'recently bookmarked' folder & can not be moved to other folders

    I can no longer save bookmarks to a designated folder - they go only to 'recently bookmarked' folder and can not to moved to other folders- when attempting to move them to another folder, they appear in the designated folder list but when I return to

  • When we would create genric extractor on a infoset query

    hi  All, we have infoset queries inour R/3 But very confused whether i should i go for generic with querry or genric with views. Actually the scenario is I have the insfoset query on logical data base I can create a generic extractor with view from t

  • Inserting blank line in internal table

    Hi I am inserting a report  from a internal table for eg the content of my internal table is data : abc event initialization. perform read_data. Now I want  1 blank line after every line in the internal table for eg data:abc event initialization perf

  • WEBDIALER authentication

    Im using CCM 4.1(3). Is there a way we can setup Webdialer without USER authentication? Has anyone customized application so it never prompts for userID|password nor preferences window. Im DCD and have other cluster AD integrated Thanks