About DAQ task and writing to a line

Hi all,
  I swtich from Labview to Labwindows and switch from traditional DAQ to DAQmx. I have two questions about using the DAQmx. Based on the example from NI, I write a function for a single sample output to a single digitial line
void WriteLine(int zero_or_one, char line_name[])
int error=0;
TaskHandle taskID=0;
char errBuff[256];
DAQmxErrChk(DAQmxCreateTask("", &taskID));
DAQmxErrChk(DAQmxCreateDOChan(taskID, line_name, "", DAQmx_Val_ChanPerLine ));
DAQmxErrChk(DAQmxStartTask(taskID));
DAQmxErrChk(DAQmxWriteDigitalLines(taskID, 1, 1, 10.0, DAQmx_Val_GroupByChannel, &zero_or_one, NULL, NULL));
Error:
if (DAQmxFailed(error)) DAQmxGetExtendedErrorInfo(errBuff, 2048);
if (taskID!=0)
DAQmxStopTask(taskID);
DAQmxClearTask(taskID);
 I am calling this function to a single digital channel. For example, WriteLine(0, "Dev1/port0/line0");. I wonder if above code really writing to a single line or a port (8 lines). I have 4 cables connecting 4 digital lines of one port to 4 external device (so to control the on/off of the device). I use the above code to control one line but don't know why seems sometimes there are something output to other three lines.
The second question is: now every time I write to a line, I call above code, so it will create the task each time even I just write one bit to one line. In my code, write to the lines pretty often, so how much it cost to create task every time before I write to a channel? Should I create one task for each channel upon the initialization of the program and clear them when the code closed? I just wonder how labview do that? In labview, will it create the task on each writing?

RobertoBozzolo wrote:
Creating and destroying a task is a relatively time consuming activity, so if you need to write to the digital lines very frequently it is advisable that you create the task at program start and destroy it at the end, leaving only the start/stop inside the write function.
As of my knowledge, LabVIEW can be structured in a similar way if you use low level functions, while it creates and destroys the task if you use a DAQ assistant (there is a note on this in the help).
With reference to your last question, you could have a single task for analog generation and simply set the appropriate rate with calling DAQmxCfgSampClkTiming before starting the task.
Thanks RobertoBozzolo. I am still in confusion regarding the analog output in DAQmx. I have an array of samples (totally 512 samples), I need to send to a specifc analog channel (A0) such that each sample will be sent at the interval 1millisecond. From your link, I use DAQmxCfgSampClkTiming
int error=0;
TaskHandle taskid;
double samples[512];
// initialize samples here
DAQmxCreateTask("mytask", &taskid);
DAQmxCreateAOVoltageChan(taskid, "Dev2/ao0","",-10,10,DAQmx_Val_Volts,NULL);
DAQmxCfgSampClkTiming(taskid, NULL, 1000, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, 512); // sample rate is 1000, so 1sample/ms, 512 samples in total
DAQmxWriteAnalogF64(taskid, 512,0, 10, DAQmx_Val_GroupByChannel, samples, NULL, NULL);
// I don't start the task automatically
// some other time-consuming code here
// after other code running, I start it manually
DAQmxStartTask(taskid);
DAQmxWaitUntilTaskDone(taskid, 10.0);
DAQmxStopTask(taskid);
 I wonder if this code looks right? There are 512 samples to send, so I set the numSampsPerChan in DAQmxWriteAnalogF64 to 512, is that correct? 
The same channel will be used for other output also. So after the above task done, if I want to send one sample instead of 512 to the same channel, does the following code work?
double one_sample_value = 0.2;
DAQmxStartTask(taskid);
DAQmxWriteAnalogScalarF64(taskid, 1, 10.0, one_sample_value,NULL);
DAQmxStopTask(taskid);
 What I am asking is do I have to reset the timing since it was set for outputing multiple sample at some rate before but now I only have to send one sample immediately, so does the time or update rate matter?
I am porting a big system which written in Labview 8 to CVI but there are so many code needed to be changed, I don't even know how to tell if the DAQ do the same thing or not. So I separate it as above code for testing.

Similar Messages

  • Problems about reading Japanese and writing Chinese

    Hi all experts,
    Now I have a encoding problem.
    My task is, read some Japanese in a text-based file, and then replace that Japanese with a Chinese string.
    That means, the program must be able to understand both the Japanese encoding and the Chinese encoidng. But the dilemma is that, in the OS I am using (Windows), you can only have one locale at a time. If you set your OS locale to Chinese, the program is able to write Chinese, but it cannot properly detect the Japanese. On the othe hand, if you set your OS locale to Japanese, the program is able to detect Japanese, but it cannot properly write Chinese.
    So can any one help me get around this problem (for instance, there is some special API dealing with encodings and so on)?
    Thanks a lot!

    InputStreamReader and OutputStreamWriter constructors both accept parameters to specify the encoding of the data stream.
    The New IO (NIO) classes have these and additional capabilities, including converting from one encoding to another using code like this:
    Charset charset = Charset.forName("ISO-8859-1");
    CharsetDecoder decoder = charset.newDecoder();
    CharBuffer charBuffer = decoder.decode(buffer);Look at the java.nio.charset package.

  • LV 8.21: strange behavior with DAQ tasks, parallel running VI's and shift registers

    Hello,
    I have made a VI using DAQmx vi's. The VI uses shift registers to store DAQ tasks and other (internal) information. I have implemented  several modes of operation (enum control with a case structure) like 'init', 'read AD', 'config AD' etc. If I use this multi mode VI in a single main VI everything work as expected. I have attached a jpg that shows one example where the DAQ VI is called from 2 parallel running while loops. One loop aquires the data (LOOP 1) while the other loop configures the aquisition task (LOOP 2). If I implement the same thing by putting LOOP2 in a different VI that runs seperately from the first VI I get an error message (200428):
    Possible reason(s):
    Measurements: Value passed to the Task/Channels In control is invalid.
    The value must refer to a valid task or valid virtual channels.
    Task Name: EasyDAQ_AD
    Of course, the second VI is started manually after the 1. VI has passed the initialization part. The error message is triggered from the 1. VI that executes the DAQ task. From my understanding of the LV execution system this seems like a bug to me. Does anyone have an idea what could go wrong here?
    klaus
    Attachments:
    problem.jpg ‏30 KB

    1. In general, this kind of technique is something I've been using successfully for years.  (Ben recently wrote up a very nice treatment of these "Action Engines" as a "Community Nugget.")  So I don't start by expecting this to be a bug in the LV execution system.
    2. Your description of the problem sounds almost backwards.  You say you manually start the 2nd vi ("Config AD") *after* running the 1st vi ("Read AD").  Seems like you'd need to do the Config 1st and then do the Read, right?   I kinda suspect you actually did it in the right order, but described it wrong.
    3. The next likely scenario is that the Config failed, but you didn't trap the error and were unaware of it.  Then it makes sense that the Read would also fail.
    4. A couple issues I regularly deal with in these DAQ Action Engines is internal error handling.  I often keep a shift register inside to store errors generated inside the Action Engine.  But it can get a little tricky doing sensible things with both the internal error and any other error being wired in as input.
    I said all that so I can say this: if you have complex nested case statements, or lots of different action cases to handle, double check that the task wire makes it from all the way from left shift register to right.  Sometimes they get lost if they go through a case statement, the output tunnel is set to "use default if unwired", and 1 or more of the cases don't wire the output.
    -Kevin P.

  • I updated my iMac to 10.7.3 and about an hour later the screen began to flicker with a gray line on the upper side, and it also flicker green and red small pixel lines all over the screen, mainly green.

    I updated my iMac to 10.7.3 and about an hour later the screen began to flicker with a gray line on the upper side, and it also flicker green and red small pixel lines all over the screen, mainly green. The computer froze with these pixels, so I shut it off and restarted it, and there were this green lines everywere. So I turned it off, and the next day I turned it on and it began to work just fine, but suddenly the same thing happened again, and when I restart the computer again there are these green and some red pixels everywere.
    I've read 10.7.3 is giving people many problems, but I never saw that it gave one like this. How can I fix this, or what will Apple do to fix this problem they caused me with their update.
    Thanks

    Contact Apple Service, iMac Service or Apple's Express Lane. Do note that if you have AppleCare's protection plan and you're within 50 miles (80 KM) of an Apple repair station, you're eligible for onsite repair since yours is a desktop machine.

  • I updated Itunes today to the latest version. Windows 7 64bit. None of my drivers work and get an error when itunes starts, about registry setting for reading and writing dvds and cds missing. Anyone else have the same issue. I downloaded itunes again, re

    I updated Itunes today to the latest version. Windows 7 64bit. None of my drivers work and get an error when itunes starts, about registry setting for reading and writing dvds and cds missing. Anyone else have the same issue. I downloaded itunes again, reinstalled still have same issue.

    I'd start with the following document, with one modification. At step 12 after typing GEARAspiWDM press the Enter/Return key once prior to clicking OK. (Pressing Return adds a carriage return in the field and is important.)
    iTunes for Windows: "Registry settings" warning when opening iTunes

  • Hello guys...im john from the phillippines and im just new to sap business one...ryt now my boss tasked me to research about crystal reports and he is making a demand of report for customer recievables ageing.......i find it hard to look at on the part wh

    hello guys...im john from the phillippines and im just new to sap business one...ryt now my boss tasked me to research about crystal reports and he is making a demand of report for customer recievables ageing.......i find it hard to look at on the part which corresponds to value dates of customer like their lapses in payments for the previous months....anyone who could help me?thanks

    hello guys...im john from the phillippines and im just new to sap business one...ryt now my boss tasked me to research about crystal reports and he is making a demand of report for customer recievables ageing.......i find it hard to look at on the part which corresponds to value dates of customer like their lapses in payments for the previous months....anyone who could help me?thanks

  • I've just bought an iPad and there's a line that runs the whole length of the screen about an inch from the outside edge of the screen. Have I bought a faulty product?

    I've just bought an iPad and there's a line that runs the whole length of the screen about an inch from the outside edge of the screen. Have I bought a faulty product?

    Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • A question about thread safety and the Acrobat SDK

    Hi All,
    On page 12 of this FAQ: http://www.adobe.com/devnet/acrobat/pdfs/Acrobat_SDK_developer_faq.pdf
    It says that Use of any Acrobat product in a multithreaded way is technically impossible.
    I'm currently writing a command line application to perform some basic data gathering on a PDF file. The Application only makes use of a PDDoc object, and never calls on any other kind of object (i.e. AVDoc).
    The application itself is not multithreaded. All of the logic runs in a single thread.
    However, the application will be called (via the command line) from another application that /is/ multithreaded. I think that this might be fine, but I wasn't sure. In this case, would this count as a single thread, but spread across multiple processes? And if that is the case, would that be OK with the SDK?
    Or would having multiple invocations/calls into the Acrobat DLLs cause the same issue as a multi-threaded application?
    Unfortunately, I haven't done a lot of work with threads before. This might be a very silly question.

    The application would be called from a perl script that is used to automate several tasks. The app is a console application, written in C# w/ the Acrobat COM components, and Visual Studio 2005.
    The console application uses the Acrobat SDK to instantiate a PDDoc object, open a PDF, and get information about the document. It then returns results back to the console.
    So, the perl script just calls: "C:\pdfinfo.exe -f=myPdf.pdf" and pipes the result to a log file.
    In this case, it never creates a new instance of the Acrobat application, but it does use the SDK.
    The reason that I was concerned was that the perl script is multi-threaded. I wasn't sure if acrobat was just sensitive to multiple threads inside a single process, or if it was unable to handle multiple processes as well.
    PDL's answer suggests that I should be fine as long as a new process is started each time. This is good to hear.

  • Oracle EBusiness suite professions tasks and duties

    Hello everybody
    I inquire about something regarding Oracle EBusiness suite professions tasks and duties. I've tasked by my manager with writing a report lists the main tasks and key responsibilities for each of the following technical professions within Oracle E Business Environment:
    1)-Apps DBA.
    2)-Apps Technical Consultant (Apps Developer)
    3)-Apps Business Consultant.
    I've contacted Oracle Support recently via opening SR .But, They informed me that they don’t provide such information and therefore, they suggest me weather to contact Oracle Consulting to post here.
    I would appreciate your help.
    Sami

    I don't see how you'd be able to integrate OAM with EBS unless you have the oSSO (assuming of course that you're not on the bleeding edge, per 975182.1).
    We are running the same configuration and have setup the redirects in OAM policy. We setup specific context roots for each application, then use OAM policy to redirect. (for example, http://iwa-server/ebs redirects to https://ebs-server)
    Unique authorization rule for each redirect, then a unique "policy" on the "Policies" tab for each redirect. Each Policy maps to the respective Authorization Rule.

  • My Mac is running INCREDIBLY slow, Kernel-task and LR, PS, PSE, etc. are not functioning well.

    Hi!  Been trying to follow a thread about the Kernel-task and slow Mac performance.  I did download EtreCheck and ran the report.  I am a photographer using LR 4 and Chrome is my main browser.  Both Chrome and LR (or PSE, or PS or Xee (a photo viewing app) make my computer run beyond ridiculously slow.  I have so much work to do for clients and I get stopped in the middle of editing and cannot move forward because my beloved Mac is having issues.  I did go through several old apps and the Application Support and Prefernces and deleted what I could of what I knew "what was what".  I would appreciate any help in getting my Mac back on track.  Thanks!
    - Amy
    Problem description:
    My Mac is running incredibly sluggish.  Chrome continues to lag, and the spinning ball is ridiculous when I am working in LR.  I did the EtreCheck and the report is below.  I JUST cleared out my LR catalogs and now have just two folders in the catalog from a current wedding I am working on.  I will have to consider using separate catalogs for my other genres or even smaller catalogs and just make a catalog for each client.  Thanks for looking this over!  I am so frustrated.
    Amy
    EtreCheck version: 2.1.8 (121)
    Report generated March 14, 2015 1:38:01 PM CDT
    Download EtreCheck from http://etresoft.com/etrecheck
    Click the [Click for support] links for help with non-Apple products.
    Click the [Click for details] links for more information about that line.
    Click the [Adware! - Remove] links for help removing adware.
    Hardware Information: ℹ️
        iMac (21.5-inch, Mid 2010) (Technical Specifications)
        iMac - model: iMac11,2
        1 3.2 GHz Intel Core i3 CPU: 2-core
        4 GB RAM
            BANK 0/DIMM0
                Empty  
            BANK 1/DIMM0
                Empty  
            BANK 0/DIMM1
                2 GB DDR3 1333 MHz ok
            BANK 1/DIMM1
                2 GB DDR3 1333 MHz ok
        Bluetooth: Old - Handoff/Airdrop2 not supported
        Wireless: Unknown
    Video Information: ℹ️
        ATI Radeon HD 5670 - VRAM: 512 MB
            iMac 1920 x 1080
    System Software: ℹ️
        OS X 10.8.5 (12F2501) - Time since boot: 3:36:47
    Disk Information: ℹ️
        WDC WD1001FALS-40Y6A0 disk0 : (1 TB)
            disk0s1 (disk0s1) <not mounted> : 210 MB
            Macintosh HD (disk0s2) / : 999.35 GB (177.87 GB free)
            Recovery HD (disk0s3) <not mounted>  [Recovery]: 650 MB
        OPTIARC DVD RW AD-5680H 
    USB Information: ℹ️
        Wacom Co.,Ltd. Bamboo Pad, wireless
        Apple Inc. BRCM2046 Hub
            Apple Inc. Bluetooth USB Host Controller
        Apple Internal Memory Card Reader
        Generic  External         2 TB
            disk1s1 (disk1s1) <not mounted> : 210 MB
            Archive 2TB (disk1s2) /Volumes/Archive 2TB : 2.00 TB (47.65 GB free)
        Generic Mass Storage Device
        Apple, Inc. Keyboard Hub
            Apple Inc. Apple Keyboard
        Apple Inc. Built-in iSight
        Apple Computer, Inc. IR Receiver
    Configuration files: ℹ️
        /etc/hosts - Count: 15
    Gatekeeper: ℹ️
        Mac App Store and identified developers
    Adware: ℹ️
        Conduit [Adware! - Remove]
        Geneio [Adware! - Remove]
    Kernel Extensions: ℹ️
            /System/Library/Extensions
        [not loaded]    com.wacom.kext.pentablet (5.3.3 - SDK 10.8) [Click for support]
    Problem System Launch Daemons: ℹ️
        [failed]    com.apple.coresymbolicationd.plist [Click for details]
        [failed]    com.apple.wdhelper.plist [Click for details]
    Launch Agents: ℹ️
        [not loaded]    com.adobe.AAM.Updater-1.0.plist [Click for support]
        [loaded]    com.adobe.CS5ServiceManager.plist [Click for support]
        [failed]    com.conduit.loader.agent.plist [Adware! - Remove]
        [running]    com.genieoinnovation.macextension.plist [Adware! - Remove]
        [loaded]    com.oracle.java.Java-Updater.plist [Click for support]
        [running]    com.wacom.pentablet.plist [Click for support]
    Launch Daemons: ℹ️
        [not loaded]    .plist (hidden) [Click for support]
            /usr/local/libexec/TorchUpdater /usr/local/libexec/TorchUpdater --hello=torch
        [loaded]    com.adobe.fpsaud.plist [Click for support]
        [loaded]    com.adobe.SwitchBoard.plist [Click for support]
        [loaded]    com.genieoinnovation.macextension.client.plist [Adware! - Remove]
        [loaded]    com.microsoft.office.licensing.helper.plist [Click for support]
        [loaded]    com.oracle.java.Helper-Tool.plist [Click for support]
        [loaded]    com.oracle.java.JavaUpdateHelper.plist [Click for support]
        [loaded]    com.skype.skypeinstaller.plist [Click for support]
        [running]    com.xrite.device.xrdd.plist [Click for support]
    User Launch Agents: ℹ️
        [loaded]    com.adobe.AAM.Updater-1.0.plist [Click for support]
        [loaded]    com.adobe.ARM.[...].plist [Click for support]
        [loaded]    com.citrixonline.GoToMeeting.G2MUpdate.plist [Click for support]
        [loaded]    com.facebook.videochat.[redacted].plist [Click for support]
        [loaded]    com.google.keystone.agent.plist [Click for support]
        [loaded]    com.Installer.completer.download.plist [Click for support]
        [loaded]    com.Installer.completer.ltvbit.plist [Click for support]
        [loaded]    com.Installer.completer.update.plist [Click for support]
        [failed]    com.mediafire.express.plist [Click for support]
        [running]    com.spotify.webhelper.plist [Click for support]
        [not loaded]    jp.co.canon.Inkjet_Extended_Survey_Agent.plist [Click for support]
    User Login Items: ℹ️
        iTunesHelper    UNKNOWN  (missing value)
        Microsoft AU Daemon    UNKNOWN  (missing value)
        Canon IJ Network Scanner Selector2    Application Hidden (/Library/Printers/Canon/IJScanner/Utilities/Canon IJ Network Scanner Selector2.app)
        GrowlHelperApp    UNKNOWN  (missing value)
        AdobeResourceSynchronizer    Application Hidden (/Applications/Adobe Reader.app/Contents/Support/AdobeResourceSynchronizer.app)
        Google Drive    Application  (/Applications/Google Drive.app)
        ColorMunkiDisplayTray    Application  (/Library/Application Support/Colormunki/Display/Tools/ColorMunkiDisplayTray.app)
        Spotify    Application  (/Applications/Spotify.app)
        apple-scc-20131227-135420    UNKNOWN  (missing value)
        Google Chrome    Application Hidden (/Applications/Google Chrome.app)
    Internet Plug-ins: ℹ️
        WacomTabletPlugin: Version: WacomTabletPlugin 2.1.0.2 [Click for support]
        iPhotoPhotocast: Version: 7.0 - SDK 10.8
        QuickTime Plugin: Version: 7.7.1
        JavaAppletPlugin: Version: Java 7 Update 75 Check version
        Google Earth Web Plug-in: Version: 7.1 [Click for support]
        WacomNetscape: Version: 2.1.0-1 - SDK 10.8 [Click for support]
    User internet Plug-ins: ℹ️
        RealPlayer Plugin: Version: Unknown
    Safari Extensions: ℹ️
        TelevisionFanatic
        Readability
        Produtools_Manuals_21
    3rd Party Preference Panes: ℹ️
        Java  [Click for support]
        PenTablet  [Click for support]
    Time Machine: ℹ️
        Skip System Files: NO
        Auto backup: NO - Auto backup turned off
        Destinations:
            Everything - 2TB [Local]
            Total size: 0 B
            Total number of backups: 0
            Oldest backup: -
            Last backup: -
            Size of backup disk: Excellent
                Backup size 0 B > (Disk size 0 B X 3)
        /sbin excluded from backup!
        /usr excluded from backup!
        /System excluded from backup!
        /bin excluded from backup!
        /private excluded from backup!
        /Library excluded from backup!
        /Applications excluded from backup!
    Top Processes by CPU: ℹ️
             2%    activitymonitord
             1%    WindowServer
             1%    Activity Monitor
             1%    Google Chrome
             0%    ColorMunkiDisplayTray
    Top Processes by Memory: ℹ️
        210 MB    mds
        189 MB    Google Chrome
        90 MB    Google Drive
        90 MB    Google Chrome Helper
        86 MB    Microsoft Word
    Virtual Memory Information: ℹ️
        1.52 GB    Free RAM
        1.65 GB    Active RAM
        480 MB    Inactive RAM
        644 MB    Wired RAM
        1.92 GB    Page-ins
        16.91 GB    Page-outs
    Diagnostics Information: ℹ️
        Mar 14, 2015, 09:58:17 AM    Self test - passed
        Mar 14, 2015, 09:53:54 AM    /Library/Logs/DiagnosticReports/Google Drive_2015-03-14-095354_[redacted].crash
        Mar 11, 2015, 02:33:04 PM    /Users/[redacted]/Library/Logs/DiagnosticReports/Google Chrome_2015-03-11-143304_[redacted].crash
        Mar 14, 2015, 10:04:09 AM    /Library/Logs/DiagnosticReports/Spotify_2015-03-14-100409_[redacted].hang
        Mar 14, 2015, 08:28:48 AM    /Library/Logs/DiagnosticReports/PenTabletDriver_2015-03-14-082848_[redacted].cr ash
        Mar 12, 2015, 12:56:47 PM    /Users/[redacted]/Library/Logs/DiagnosticReports/ColorMunkiDisplayTray_2015-03- 12-125647_[redacted].crash

    Several problems exist.
    1.
    Back up your Mac prior to making any changes to its file system. Time Machine has not been configured properly To learn how to use Time Machine read Mac Basics: Time Machine backs up your Mac - Apple Support.
    2.
    You inadvertently installed adware. You do not need to download or install anything to fix it.
    For a description of how this may have occurred, how to avoid it in the future, and for Apple's recommended actions read How to install adware. Apple's instructions are linked in the Recovery Procedure near the end of that document. Read and follow them carefully. Pay particular attention to the easily overlooked passages directing you to restart your Mac when required.
    3.
    That Mac's Hosts file appears to have been modified. Fixing a modified Hosts file requires specific instructions. Apple Support Communities contributor and EtreCheck author etresoft recently added a User Tip discussing that concern, and how to correct it: Fixing a hacked /etc/hosts file

  • Running multiple DAQ tasks at the same time

    I am trying to setup a program that would allow me to run different analog voltage waveforms on different channels.
    The rate at which samples hit each channel can be the same for all 32, but I want each to be sourced by an individual file I/O source.
    I saw the multiple tasks thread and I did try doing the multiple task approach first and needless to say got the same error.
    Saw something about software timed approach working better, but it is still a bit unclear in that post. Can i do with this card what I described above and if so is this software timing approach the way to go?
    Thanks in advance!

    Hi,
    What DAQ device and and programming language are you using, i.e., LabVIEW/CVI/.NET?   If you are new to DAQ, a great place to start are the example programs.  You can find the example programs with the Example Finder, located at Help >> Find Examples in both LabVIEW and CVI.  Once this opens, double click Hardware Input and Output >> DAQmx >> Analog Generation.  This will have many programs for generating waveforms.  I have also found a program online that might be worth looking at.  
    Continuous Multiple AO Waveforms
    Regards,
    Jim Schwartz

  • Question about Scheduled Task

    Question about Scheduled Task
    RequestCenter 2008.3
    Oracle 10g
    Websphere 6.1.27
    IE 7
    Hi:
    I have tried to get a scheduled task to work without any luck.  I am referencing a date/time field on the form and the task goes to "Scheduled", but never moves to "Ongoing".
    I've opened a case with support, but was wondering if anyone has gotten this to work.
    Thank you
    Daniel
    Safeway Inc.

    We just went through this too. If the plan is fairly complex, and has allot of conditional tasks you will have difficulty.
    The explanation I got from Shweta is that the calculation that determines the OLAs before my scheduled task was to start looks at ALL the potential tasks and combines them, essentially saying the duration is much longer than what you think it should be, ie the sum of all potential task OLAs, not just the tasks that became active.
    Bottom line if your scheduled date is with

  • Few questions about apex + epg and cookie blocked by IE6

    Hi,
    I would like to ask a few questions about apex and epg.
    I have already installed and configured apex 3.2 on oracle 10g (on my localhost - computer name 'chen_rong', ip address -192.168.88.175 ), and enable anonymous access xdb http server.
    now,
    1. I can access 'http://chen_rong' , 'http://localhost' , 'http://192.168.88.175' without input username / password for realm 'XDB' in IE6;
    2. I can access 'http://localhost/apex/apex_admin' , 'http://192.168.88.175/apex/apex_admin' , and I can be redirected into apex administation page after input admin/<my apex admin password> for realm 'APEX' in IE6;
    3. I can access 'http://chen_rong/apex/apex_admin' in IE6, but after input admin/password , I can not be redirected into administation page, because the cookie was blocked by IE6.
    then, the first question is :
    Q1: What is the difference among 'http://chen_rong' , 'http://localhost' , 'http://192.168.88.175' ? I have already include site 'chen_rong' into my trusted stes! why the cookie was blocked by IE6. I have already tried firefox and google browser, both of them were ok for 'chen_rong', no cookie blocked from site 'chen_rong'!
    and,
    1. I have tried to use the script in attachment to test http authentication and also want to catch the cookie by utl_http .
    2. please review the script for me.
    3. I did:
    SQL> exec show_url('http://localhost/apex/apex_admin/','ADMIN','Passw0rd');
    HTTP response status code: 401
    HTTP response reason phrase: Unauthorized
    Please supplied the required Basic authentication username/password for realm XDB for the Web page.
    Web page http://localhost/apex/apex_admin/ is protected.
    MS-Author-Via: DAV
    DAV: 1,2,<http://www.oracle.com/xdb/webdav/props>
    Server: Oracle XML DB/Oracle Database
    WWW-Authenticate: Basic realm="XDB"
    Date: Tue, 04 Aug 2009 02:25:15 GMT
    Content-Type: text/html; charset=GBK
    Content-Length: 147
    ======================================
    PL/SQL procedure successfully completed
    4. I also did :
    SQL> exec show_url('http://localhost/apex/apex_admin/','ANONYMOUS','ANONYMOUS');
    HTTP response status code: 500
    HTTP response reason phrase: Internal Server Error
    Check if the Web site is up.
    PL/SQL procedure successfully completed
    SQL> exec show_url('http://localhost/apex/apex_admin/','SYSTEM','apexsite');
    HTTP response status code: 401
    HTTP response reason phrase: Unauthorized
    Please supplied the required Basic authentication username/password for realm APEX for the Web page.
    Web page http://localhost/apex/apex_admin/ is protected.
    Content-Type: text/html
    Content-Length: 147
    WWW-Authenticate: Basic realm="APEX"
    ======================================
    PL/SQL procedure successfully completed
    my second questions is :
    Q2: After I entered into realm 'XDB', I still need went into realm'APEX'. how could I change the script show_url to accomplish these two tasks and successfully get the cookie from site.
    the show_url script is as following:
    CREATE OR REPLACE PROCEDURE show_url
    (url IN VARCHAR2,
    username IN VARCHAR2 DEFAULT NULL,
    password IN VARCHAR2 DEFAULT NULL)
    AS
    req UTL_HTTP.REQ;
    resp UTL_HTTP.RESP;
    name VARCHAR2(256);
    value VARCHAR2(1024);
    data VARCHAR2(255);
    my_scheme VARCHAR2(256);
    my_realm VARCHAR2(256);
    my_proxy BOOLEAN;
    cookies UTL_HTTP.COOKIE_TABLE;
    secure VARCHAR2(1);
    BEGIN
    -- When going through a firewall, pass requests through this host.
    -- Specify sites inside the firewall that don't need the proxy host.
    -- UTL_HTTP.SET_PROXY('proxy.example.com', 'corp.example.com');
    -- Ask UTL_HTTP not to raise an exception for 4xx and 5xx status codes,
    -- rather than just returning the text of the error page.
    UTL_HTTP.SET_RESPONSE_ERROR_CHECK(FALSE);
    -- Begin retrieving this Web page.
    req := UTL_HTTP.BEGIN_REQUEST(url);
    -- Identify yourself.
    -- Some sites serve special pages for particular browsers.
    UTL_HTTP.SET_HEADER(req, 'User-Agent', 'Mozilla/4.0');
    -- Specify user ID and password for pages that require them.
    IF (username IS NOT NULL) THEN
    UTL_HTTP.SET_AUTHENTICATION(req, username, password, 'Basic', false);
    END IF;
    -- Start receiving the HTML text.
    resp := UTL_HTTP.GET_RESPONSE(req);
    -- Show status codes and reason phrase of response.
    DBMS_OUTPUT.PUT_LINE('HTTP response status code: ' || resp.status_code);
    DBMS_OUTPUT.PUT_LINE
    ('HTTP response reason phrase: ' || resp.reason_phrase);
    -- Look for client-side error and report it.
    IF (resp.status_code >= 400) AND (resp.status_code <= 499) THEN
    -- Detect whether page is password protected
    -- and you didn't supply the right authorization.
    IF (resp.status_code = UTL_HTTP.HTTP_UNAUTHORIZED) THEN
    UTL_HTTP.GET_AUTHENTICATION(resp, my_scheme, my_realm, my_proxy);
    IF (my_proxy) THEN
    DBMS_OUTPUT.PUT_LINE('Web proxy server is protected.');
    DBMS_OUTPUT.PUT('Please supply the required ' || my_scheme ||
    ' authentication username/password for realm ' || my_realm ||
    ' for the proxy server.');
    ELSE
    DBMS_OUTPUT.PUT_LINE('Please supplied the required ' || my_scheme ||
    ' authentication username/password for realm ' || my_realm ||
    ' for the Web page.');
    DBMS_OUTPUT.PUT_LINE('Web page ' || url || ' is protected.');
    END IF;
    ELSE
    DBMS_OUTPUT.PUT_LINE('Check the URL.');
    END IF;
    -- UTL_HTTP.END_RESPONSE(resp);
    -- RETURN;
    -- Look for server-side error and report it.
    ELSIF (resp.status_code >= 500) AND (resp.status_code <= 599) THEN
    DBMS_OUTPUT.PUT_LINE('Check if the Web site is up.');
    UTL_HTTP.END_RESPONSE(resp);
    RETURN;
    END IF;
    -- HTTP header lines contain information about cookies, character sets,
    -- and other data that client and server can use to customize each
    -- session.
    FOR i IN 1..UTL_HTTP.GET_HEADER_COUNT(resp) LOOP
    UTL_HTTP.GET_HEADER(resp, i, name, value);
    DBMS_OUTPUT.PUT_LINE(name || ': ' || value);
    END LOOP;
    -- Read lines until none are left and an exception is raised.
    --LOOP
    -- UTL_HTTP.READ_LINE(resp, value);
    -- DBMS_OUTPUT.PUT_LINE(value);
    --END LOOP;
    UTL_HTTP.GET_COOKIES(cookies);
    dbms_output.put_line('======================================');
    FOR i in 1..cookies.count LOOP
    IF (cookies(i).secure) THEN
    secure := 'Y';
    ELSE
    secure := 'N';
    END IF;
    -- INSERT INTO my_cookies
    -- VALUES (my_session_id, cookies(i).name, cookies(i).value,
    -- cookies(i).domain,
    -- cookies(i).expire, cookies(i).path, secure, cookies(i).version);
    dbms_output.put_line('site:'||url);
    dbms_output.put_line('cookies:');
    dbms_output.put_line('name:'||cookies(i).name);
    dbms_output.put_line('value:'||cookies(i).value);
    dbms_output.put_line('domain:'||cookies(i).domain);
    dbms_output.put_line('expire:'||cookies(i).expire);
    dbms_output.put_line('path:'||cookies(i).path);
    dbms_output.put_line('secure:'||secure);
    dbms_output.put_line('version:'||cookies(i).version);
    END LOOP;
    UTL_HTTP.END_RESPONSE(resp);
    EXCEPTION
    WHEN UTL_HTTP.END_OF_BODY THEN
    UTL_HTTP.END_RESPONSE(resp);
    END;
    /

    I use oracle database enterprise edtion 10.2.0.3. I have already figured out the epg on 10.2.0.3 to support apex 3.2.
    And as I described above, the apex site works fine for ip address , and localhost. but the cookie will be blocked by IE6, if I want to access the site by 'http://computername:port/apex/apex_admin'. This problem does not occured in firefox and google browser. Could someone give me answer?

  • Question around UTL_FILE and writing unicode data to a file.

    Database version : 11.2.0.3.0
    NLS_CHARACTERSET : AL32UTF8
    OS : Red Hat Enterprise Linux Server release 6.3 (Santiago)
    I did not work with multiple language characters and manipulating them. So, the basic idea is to write UTF8 data as Unicode file using UTL_FILE. This is fairly an empty database and does not have any rows in at least the tables I am working on. First I inserted a row with English characters in the columns.
    I used utl_file.fopen_nchar to open and used utl_file.put_line_nchar to write it to the file on the Linux box. I open the file and I still see English characters (say "02CANMLKR001".
    Now, I updated the row with some columns having Chinese characters and ran the same script. It wrote the file. Now when I "vi" the file, I see "02CANè¹æ001" (some Unicode symbols in place of the Chinese characters and the regular English.
    When I FTP the file to windows and open it using notepad/notepad++ it still shows the Chinese characters. Using textpad, it shows ? in place of Chinese characters and the file properties say that the file is of type UNIX/UTF-8.
    My question : "Is my code working and writing the file in unicode? If not what are the required changes?" -- I know the question is little vague, but any questions/suggestions towards answering my question would really help.
    sample code:
    {pre}
    DECLARE
       l_file_handle   UTL_FILE.file_type;
       l_file_name     VARCHAR2 (50) := 'test.dat';
       l_rec           VARCHAR2 (250);
    BEGIN
       l_file_handle := UTL_FILE.fopen_nchar ('OUTPUT_DIR', l_file_name, 'W');
       SELECT col1 || col2 || col3 INTO l_rec FROM table_name;
       UTL_FILE.put_line_nchar (l_file_handle, l_rec);
       UTL_FILE.fclose (l_file_handle);
    END;
    {/pre}

    Regardless of what you think of my reply I'm trying to help you.
    I think you need to reread my reply because I can't find ANY relation at all between what I said and what you responded with.
    I wish things are the way you mentioned and followed text books.
    Nothing in my reply is related to 'text books' or some 'academic' approach to development. Strictly based on real-world experience of 25+ years.
    Unfortunately lot of real world projects kick off without complete information.
    No disagreement here - but totally irrevelant to anything I said.
    Till we get the complete information, it's better to work on the idea rather than wasting project hours. I don't think it can work that way. All we do is to lay a ground preparation, toy around multiple options for the actual coding even when we do not have the exact requirements.
    No disagreement here - but totally irrevelant to anything I said.
    And I think it's a good practice rather than waiting for complete information and pushing others.
    You can't just wait. But you also can't just go ahead on your own. You have to IMMEDIATELY 'push others' as soon as you discover any issues affecting your team's (or your) ability to meet the requirements. As I said above:
    Your problems are likely:
    1. lack of adequate requirements as to what the vendor really requires in terms of format and content
    2. lack of appropriate sample data - either you don't have the skill set to create it yourself or you haven't gotten any from someone else.
    3. lack of knowledge of the character sets involved to be able to create/conduct the proper tests
    If you discover something missing with the requirements (what character sets need to be used, what file format to use, whether BOMs are required in the file, etc) you simply MUST bring that to your manager's attention as soon as you suspect it might be an issue.
    It is your manager's job, not yours, to make sure you have the tools needed to do the job. One of those tools is the proper requirements. If there is ANYTHING wrong, or if you even THINK something is wrong with those requirements it is YOUR responsibility to notify your manager ASAP.
    Send them an email, leave a yellow-sticky on their desk but notify them. Nothing in what I just said says, or implies, that you should then just sit back and WAIT until that issue is resolved.
    If you know you will need sample data you MUST make sure the project plan includes SOME means to obtain sample data witihin the timeline needed by your project. As I repeated above if you don't have the skill set to create it yourself someone else will need to do it.
    I did not work with multiple language characters and manipulating them.
    Does your manager know that? If the project requires 'work with multiple language characters and manipulating them' someone on the project needs to have experience doing that. If your manager knows you don't have that experience but wants you to proceed anyway and/or won't provide any other resource that does have that experience that is ok. But that is the manager's responsibility and that needs to be documented. At a minimum you need to advise your manager (I prefer to do it with an email) along the following lines:
    Hey - manager person - As you know I have little or no experience to 'work with multiple language characters and manipulating them' and those skills are needed to properly implement and test that the requirements are met. Please let me know if such a resource can be made available.
    And I'm serious about that. Sometimes you have to make you manager do their job. That means you ALWAYS need to keep them advised of ANY issue that might affect the project. Once your manager is made aware of an issue it is then THEIR responsibility to deal with it. They may choose to ignore it, pretend they never heard about it or actually deal with it. But you will always be able to show that you notified them about it.
    Now, I updated the row with some columns having Chinese characters and ran the same script.
    Great - as long as you actually know Chinese that is; and how to work with Chinese characters in the context of a database character set, querying, creating files, etc.
    If you don't know Chinese or haven't actually worked with Chinese characters in that context then the project still needs a resource that does know it.
    You can't just try to bluff your way through something like character sets and code conversions. You either know what a BOM (byte order mark) is or you don't. You have either learned when BOMs are needed or you haven't.
    That said, we are in process of getting the information and sample data that we require.
    Good!
    Now make sure you have notified your manager of any 'holes' in the requirements and keep them up to date with any other issues that arise.
    NONE of the above suggests, or implies, that you should just sit back and wait until that is done. But any advice offered on the forums about specifics of your issue (such as whether you need to even worry about BOMs) is premature until the vendor or the requirements actually document the precise character set and file format needed.

  • Stopping a currently running DAQ task for m-series

    I'm running a hardware timed analog input data acquisition task on a PCI-6229 m-series DAQ card that takes 200 us.  Every 250 us the program reads the data and restarts the task.  The difficulty is that the program sometimes has a late start and the next time the thread reads the task is still in progress.  I'd like to guarantee the task is stopped every time the program reads the data.  I've tried the following three sets of commands when the thread wakes up:
    Attempt 1:
    if( board->Joint_Status_2.readAI_Scan_In_Progress_St() )
         board->AI_Command_1.writeAI_Disarm(1);
         board->AI_Command_1.flush();
    Attempt 2:
    if( board->Joint_Status_2.readAI_Scan_In_Progress_St() )
         board->AI_Status_1.setAI_STOP_St(kTrue);
         board->AI_Status_1.flush();
    Attempt 3:
    if( board->Joint_Status_2.readAI_Scan_In_Progress_St() )
         board->AI_Mode_1.setAI_Start_Stop(kTrue);
         board->AI_Mode_1.flush();
    They seem to randomly work.  Sometimes the task stops immediately, sometimes it reads a few more times, and sometimes it just keeps reading.  The positive part of these commands are that the task can be restarted by simply issuing the aiStart(board) command again -- most of the time.  Is there something that I can send to the card to reliably stop any currently running AI tasks and at the same time allow the aiStart(board) command to be used to start the next set of readings?
    You may ask why I'm doing this.  I've had a lot of problems losing track of the inputs after 13 hr to several days at 250 kHz.  By restarting the task every loop and clearing the DMA buffer, I can guarantee the first element in the buffer is the first input read.  I'm using DMA so if the task is still running when I send the aiStart(board) command, it can screw up this balance.  You may argue that I should keep track of things more closely, but this system means that if the inputs somehow become switched the next time the thread runs it will automatically correct the problem.  This self-correction is a critical feature.
    Thanks.
    Aaron

    Hi Aaron-
    The bitfields you attempt to write are problematic for a few reasons.  First, AI_Disarm is only safe to use for idle counters and may not work reliably if the acquisition is currently running (which it sounds like you have observed).  AI_STOP_St is a read-only bit, so writing it will have no effect.  Finally, AI_Start_Stop controls an unrelated functionality (essentially, it decides whether an AI_Start -> AI_Stop cycle constitutes a "scan".  This is actually the only mode of the STC2 that makes much sense to use on M Series).
    There are a couple of bitfields in AI_Command_2 that might help.  AI_End_On_SC_TC is a strobe bit that disarms the AI_SC, AI_SI, AI_SI2, and AI_DIV counters when an SC_TC event occurs.  AI_End_On_End_Of_Scan provides the same functionality for when an AI_Stop occurs.  So basically, you could determine a regular interval boundary number of scans to stop on (using End_On_SC_TC) or just stop at the end of the "current" scan (using End_On_End_Of_Scan). 
    I haven't tested this, but it should work.  Let me know if you have problems using either of these methods.  Hopefully this helps- 
    Message Edited by Tom W [DE] on 03-14-2008 03:21 PM
    Tom W
    National Instruments

Maybe you are looking for

  • I want to downgrade my iPhone 4 from 7.0.2 to 6.1.3.

    Hello,i have an iPhone 4 and i recently updated it to IOS 7.0.2 and it is moving slowly and i want to downgrade it to 6.1.3.Please somebody tell me how to downgrade my iPhone 4.Sorry for my english.

  • Error: Unable to manipulate operating system

    In the CCM I have all services up and running, however, when I go to the CMC web page and look at the Servers, there are two servers in particular that are stopped and when I go to click on them to start I get a new page with the verbiage "Unable to

  • User profile services

    set my username control to load automatically from user profile services, but each time it loads, it comes in this format i:0#.w|domain\username please how can I clean the unwanted syntax (I:0#.w|) before the domain name

  • Help me understand matrix profiles (DNG camera profiles)

    I'm guessing it's a fairly simple question, so please bear with me as I'm working my way round trying to understand the DNG format: After the de-bayering step, are DNG camera profiles pure 3-channel mathematical curves? I know Adobe DNG editor allows

  • List of Character which cause Query not work properly

    I want the List of characters and resolution which can leads the SQL query to not work properly LIKE Problem: Single Quotes " ' " in SQL query. Solution: Use one more single Quotes Example: Select 'D''Sa'as EName from dual; Please provide all Such sp