Positional flat file schemas for input and output files to be generated with the required usecases

Hello all,
I need one help regarding the positional flat file schema which contains multiple headers, body and trailers.
I have attached the sample input file below. This is a batched input and we have to generate the output which I have given below:
We are unable to flat file schema which replicates the below input file. Please suggest better approach to achieve this.
Sample Input FIle:
010320140211ABC XYZ XYZ ABCD201402110 FSPAFSPA005560080441.02000006557.FSPA.IN AB-CD ABCD/AB-CD BETALKORT
1020140210AN194107123459.FSPA.IN
[email protected]
1020140210AN196202123453.FSPA.IN
[email protected]
1020140210AN198103123435.FSPA.IN
[email protected]
1020140210AN195907123496.FSPA.IN
[email protected]
1020140210AN195903123437.FSPA.IN
[email protected]
1020140210AN193909123434.FSPA.IN
[email protected]
1020140210AN195607123413.FSPA.IN
[email protected]
1020140210AN199205123408.FSPA.IN
[email protected]
1020140210AN196206123499.FSPA.IN
[email protected]
1020140210AN196709123410.FSPA.IN
[email protected]
1020140210AN194708123455.FSPA.IN
[email protected]
1020140210AN195710123443.FSPA.IN
[email protected]
1020140210AN198311123436.FSPA.IN
[email protected]
1020140210AN196712123471.FSPA.IN
[email protected]
1020140210AV197005123403.FSPA.IN
98000000000000014000000000000001000000000000015
010320140211ABC XYZ XYZ PEDB201402111 FSPAICA 005560080441.02000006557.FSPA.IN AB-CDABCD/ABCDBETALKORT
1020140210AN195111123491.ICA.IN
[email protected]
1020140210AV195309123434.ICA.IN
98000000000000001000000000000001000000000000002
Output FIle:
1020140210AN195607123413.FSPA.IN
[email protected]
1020140210AN199205123408.FSPA.IN
[email protected]
1020140210AN196206123499.FSPA.IN
[email protected]
1020140210AN196709123410.FSPA.IN
[email protected]
1020140210AN194708123455.FSPA.IN
[email protected]
1020140210AN195710123443.FSPA.IN
[email protected]
1020140210AN198311123436.FSPA.IN
[email protected]
1020140210AN196712123471.FSPA.IN
[email protected]
1020140210AN195111123491.ICA.IN
110019EPS [email protected]
1020140210AV197005123403.FSPA.IN
1020140210AV195309123434.ICA.IN
98000000000000001000000000000001000000000000002
99000000000000001
Note: Header is a single line till BETALKORT and also there is a space before email id. That is not getting pasted properly in the files.
Thanks and Regards,
Veena Handadi

Hi all,
Header is missed from the output file for the above post:
Please find the output file:
010320140211ABC XYZ XYZ ABCD201402110 FSPAFSPA005560080441.02000006557.FSPA.IN AB-CD ABCD/AB-CD BETALKORT
1020140210AN195607123413.FSPA.IN
[email protected]
1020140210AN199205123408.FSPA.IN
[email protected]
1020140210AN196206123499.FSPA.IN
[email protected]
1020140210AN196709123410.FSPA.IN
[email protected]
1020140210AN194708123455.FSPA.IN
[email protected]
1020140210AN195710123443.FSPA.IN
[email protected]
1020140210AN198311123436.FSPA.IN
[email protected]
1020140210AN196712123471.FSPA.IN
[email protected]
1020140210AN195111123491.ICA.IN
110019EPS [email protected]
1020140210AV197005123403.FSPA.IN
1020140210AV195309123434.ICA.IN
98000000000000001000000000000001000000000000002
99000000000000001

Similar Messages

  • Can you still get attachable keyboard for iPhone and if so is it compatible with the iphone 5c

    Can you still get an attachable keyboard for iPhone and if so is it compatible with the iphone 5c?

    havent seen any wired keyboards for ios apart from the ipad ones
    but all bluetooth keyboards works be they apple mac keyboards or normal windows keyboards or small keyboards
    if they support bluetooth they work

  • I have on;y one audio port can i use it for input and output at the same time?

    i have the new macbook pro 13 in and i want to connect aguitar as input and output on an amp but i have only one audio port

    You can't use the jack as an input and output simultaneously. The solution is to look for a USB or Firewire interface to get your guitar sound into the computer.

  • Different family class used for input  and output when working with sockets

    I have seen more or less everywhere the following code to open a socket and to receive input and send output through it:
    Socket server = new Socket("anyservername", 25):
    OutputStream out = server.getOutputStream();
    PrintWriter pout = new PrintWriter (out, true);
    pout.println("Hello");
    InputStream in = server.getInputStream();
    BufferedReader bin = new BufferedReader (new InputStreamReader(in));
    String response = bin.readLine();
    What I do not understand is:
    Why the BufferedReader needs InputStreamReader as an argument whereas printwriter does not want the OutputStreamReader as an argument but it is OK with just the OutPutStream?
    I would tend to believe that they should be more or less at the same level and use the same arguments?.
    In that sense if I use BufferWriter instead of PrintWriter I bet It should be OK the following code?:
    OutputStream out = server.getOutputStream();
    BufferedWriter bout = new BufferedWriter (out);
    String myOut = bout.writeLine();
    Cheers
    Umbi
    Edited by: Imbu on Jun 2, 2008 2:40 PM

    1. Does it even compile?
    2. While there is a fair amount of symmetry between reader and writer classes, don't assume it's exhaustive. Your best friend is the API:
    [http://java.sun.com/javase/6/docs/api/]
    3. Those were just examples. Code it the way you feel is best. I would specify charsets to make sure the encodings were platform independent. Networking and all that, don't you know...

  • Re: Using JOptionPane for Input and Output

    You're going to get in big trouble with things like this: "if (memtype = P)"
    Remember that '=' is for assignment, '==' is for comparison. Furthermore, you shouldn't use '==' for comparing Strings; you should use the String's equals() method instead.

    Thank you for your reply and for the tip on using the ==,
    I have seen this used, but the language you used to explain this is still a little too technical for me and I am not too sure what you mean when you said: "you should use the String's equals() method instead. "
    what would the format of this look like?

  • Flat file data load failed with the below error

    hi guys,
    when the scheduling load(info package) from the flat file ,got below error..
    Error 'The argument 'INR' cannot be interpreted as a number ' on assignment field /BI
    thanks

    Hi,
    It seems that the flat file and data source are not in sync.... check your flat file format and prepare it in sync with your data source.
    I guess you have an amount field followed by currency in your flat file, but in your data source currency field is not next to the amount KF or vice versa. It could also be that the KF you have defined is not of Amount type, and hence it doesn't expect the currency field.
    Hope this helps
    Godhuli

  • Makin GUI for input and output

    This is simple code for my Comp Science class at school, but I keep getting "Exception in thread "main" java.lang.NoClassDefFoundError: TrivialApplication"
    and im tryin to figure out what i did heres my code:
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    public class Hypotenuse {
              double side1, side2, hypotenuse;
              String Fside1, Fside2;
         public Component components()
         final JTextArea text = new JTextArea();
         final JTextField InputText1 = new JTextField();
         final JTextField InputText2 = new JTextField();
         JButton button = new JButton(" OK ");
         button.setMnemonic(KeyEvent.VK_ENTER);
         button.addActionListener(new ActionListener(){
              public void actionPerformed(ActionEvent e)
                   Fside1 = InputText1.getText();
                   Fside2 = InputText2.getText();
         JPanel InOutField = new JPanel();
         InOutField.setBorder(BorderFactory.createEmptyBorder(30,30,30,30));
         InOutField.setLayout(new GridLayout(0, 1));
              InOutField.add(text);
              InOutField.add(InputText1);
              InOutField.add(InputText2);
              InOutField.add(button);
              return InOutField;
         public static void main(String Args[]) throws IOException
             try
              UIManager.setLookAndFeel(
                   UIManager.getCrossPlatformLookAndFeelClassName());
             catch (Exception e)
              JFrame InOutFrame = new JFrame("Hypotenuse");
              Hypotenuse app = new Hypotenuse();
              Component contents = app.components();
              InOutFrame.getContentPane().add(contents, BorderLayout.CENTER);
              InOutFrame.addWindowListener(new WindowAdapter()
                   { public void windowCloasing(WindowEvent e)
                        { System.exit(0);
              InOutFrame.pack();
              InOutFrame.setVisible(true);
    }

    It compiles OK for me, but it doesn't close properly, unless I change this
    public void windowCloasing(WindowEvent e)
    to this
    public void windowClosing(WindowEvent e)

  • Positional Flat File Handling in B2B

    Problem:
    There is a big problem with handling positional flat files in Oracle B2B. We are trying to handle Positional Flat File, in UTF-8 with BOM encoding, after creating document definition and setting the agreement, we received:
    B2B-51507 Error: The data starting at position 0 is not recognized as a valid data transmission.
    What’s more, we remembered to locate Parser file into Config/schema location, which usually fixes problem.
    Full description:
    We have a sample flat file, with UNIX (LF) endline character, encoded in UTF-8 with BOM:
    11B6Kamil Mazur     Lazurowa       8 12 CityABCD       PL
    Junior Consultant        MyCompanyX
    StreetAAAAAA       00-000 CityABCD      
    First of all, we have created a guideline *.ecs and schema XSD, like that:
    imgur: the simple image sharer
    During XSD creation we have remembered to confirm, that our endline character is in UNIX standard (LF).
    After that, we have created Parser Schema File, and paste it in the schema location in our server:
    /oracle/Middleware/MyDomain/soa/thirdparty/edifecs/XEngine/config/schema,
    after that we paste the schema location in XRegistry file:
    imgur: the simple image sharer
    After that action, we restarted SOA Server (which was running during these changes).
    When SOA Server was in alive again, we’ve created a document definition :
    imgur: the simple image sharer
    Starting and Ending positions are from 2-5, because of BOM character existence. Then, we created Trading Partner and Inbound Agreement, based on this Document Definition:
    imgur: the simple image sharer
    Then we posted out test file via Generic File Listening Channel, with no Java Callout and other properties. Unfortunately, we receive error like this:
    Business Message :
    Id
    AC18017B146145ADDCD00000178AA4F9
    Message Id
    AC18017B146145ADDCB00000178AA4F8-1
    Refer To Message
    Refer To Message
    Sender Type
    Name
    Sender Value
    Szkolenie
    Receiver Type
    Name
    Receiver Value
    MyCompany
    Sender
    Szkolenie
    Receiver
    MyCompany
    Agreement Id
    PersonIn
    Agreement
    PersonIn
    Document Type
    Person
    Document Protocol
    PositionalFlatFile
    Document Version
    Logistics2013
    Message Type
    REQ
    Direction
    INBOUND
    State
    MSG_ERROR
    Acknowledgement Mode
    NONE
    Response Mode
    ASYNC
    Send Time Stamp
    2014-05-19 14:00
    Receive Time Stamp
    2014-05-19 14:00
    Document Retry Interval(Channel)
    0
    Document Remaining Retry(Channel)
    0
    Document Retry Interval(Agreement)
    Document Remaining Retry(Agreement)
    Native Message Size
    141
    Translated Message Size
    Business Action Name
    Business Transaction Name
    Xpath Name1
    Xpath Value1
    Xpath Expression1
    Xpath Name2
    Xpath Value2
    Xpath Expression2
    Xpath Name3
    Xpath Value3
    Xpath Expression3
    Correlation From XPath Name
    Correlation From XPath Value
    Correlation From XPath Expression
    Correlation To XPath Name
    Correlation To XPath Value
    Correlation To XPath Expression
    Wire Message
    Wire Message
    Application Message
    Application Message
    Payload Storage
    Payload Storage
    Attachment
    Attachment
    Label
    soa_b2b_ - Thu May 15 15:04:40 CEST 2014 - 1
    Collaboration Id
    AC18017B146145ADD9200000178AA4F7
    Collaboration Name
    Collaboration Version
    Business Action Name
    Exchange Protocol Name
    Generic File
    Exchange Protocol Version
    1.0
    Interchange Control Number
    Group Control Number
    Transaction Set Control Number
    Error Code
    B2B-51507
    Error Description
    Machine Info: (soatest.corp.prv) The data starting at position 0 is not recognized as a valid data transmission.
    Error Level
    ERROR_LEVEL_COLLABORATION
    Error Severity
    ERROR
    Error Text
    Payload validation error.
    Wire Message:
    Id
    AC18017B146145ADAB400000178AA4F1
    Message Id
    AC18017B146145ADAB400000178AA4F1
    Business Message
    AC18017B146145ADDCD00000178AA4F9
    Packed Message
    Packed Message
    Payload
    Payload
    Protocol Message Id
    test_4value.txt@AC18017B146145ADAE500000178AA4F5
    Refer To Protocol Message Id
    Protocol Collaboration Id
    Protocol Transport Binding
    filename=test_4value.txt filesize=143 ChannelName=SzkolenieChannel file_ext=txt fullpath=/home/oracle/POC/positional/Krzysiek/test_4value.txt timestamp=2014-05-07T10:23:30.000+01:00 tp_profile_name=Szkolenie MSG_RECEIVED_TIME=Mon May 19 14:00:37 CEST 2014
    Message Digest
    Message Digest
    Digest Algorithm
    Transport Protocol
    File
    Transport Protocol Version
    1.0
    Url
    file://localhost//home/oracle/POC/positional/Krzysiek
    security
    Transport Headers
    filename=test_4value.txt filesize=143 ChannelName=SzkolenieChannel file_ext=txt fullpath=/home/oracle/POC/positional/Krzysiek/test_4value.txt timestamp=2014-05-07T10:23:30.000+01:00 tp_profile_name=Szkolenie MSG_RECEIVED_TIME=Mon May 19 14:00:37 CEST 2014
    certificates
    certificates
    State
    ERROR
    Reattempt Count
    Error Code
    B2B-51507
    Error Description
    Machine Info: (soatest.corp.prv) The data starting at position 0 is not recognized as a valid data transmission.
    Error Text
    Payload validation error.
    exchange Retry Interval
    exchange Remaining Retry
    Message Size
    141
    Payload seems to be unchanged. Problem appears, when our B2B works in Cluster (but both configuration parameters b2b.HAInstance  b2b.HAInstanceName are set properly for both soa-servers):
    imgur: the simple image sharer
    There are no additional info in logs :
    [2014-05-19T14:07:47.994+02:00] [soa_server1] [NOTIFICATION] [] [oracle.soa.b2b.engine] [tid: DaemonWorkThread: '20' of WorkManager: 'wm/SOAWorkManager'] [userId: <anonymous>] [ecid: a8bc74c6eb84aa5b:452af1da:146046c88de:-8000-00000000000598a0,0] [APP: soa-infra] Engine: processIncomingMessageImpl: Message id = AC18017B14614616E1A00000178AA510-1 FromParty = Szkolenie Doctype = Person version = Logistics2013
    That’s unfortunately all. Is there any configuration that we missed? How to fix this problem?

    Hi Anuj,
    I have added a transformation in the mediator component and I'm now able to transfer the opaque data from Oracle B2B to composite and then write the contents of flat file to another specified file thorugh file adapter.
    However I still have few more issues in different scenarios:
    I have tried the excercise that was mentioned in your blog:
    http://www.anuj-dwivedi.blogspot.com/2011/10/handling-positionaldelimited-flat-files.html
    I tried to create a flat file with two records or lines as mentioned in the blog. First line contains header information whose length is 57 characters with 5 Fileds in it. Second line contains the actual data with 57 characters and 5 fields in it. In the agreement that was created to handle this flat file, I have checked the Validate & Translate check box.
    During validation, B2B is failing to treat the second line as a new record and it considering it in one record and the validation is failing as nothing is specified from 58th character in the ECS & XSD files.
    Following is the error:
    Error -: B2B-51507: Payload validation error.: Machine Info: (corpdevsoa10) Extra Field was found in the data file as part of Record HEADER. Record HEADER is defined in the guideline at position 1.{br}{br}This error was detected at:{br}{tab}Record Count: 1{br}{tab}Field Count: 6{br}{tab}Characters: 57 through 116
    Please advice me in resolving this issue.
    Thanks,
    Krishna.

  • FINALLY INPUTTING and OUTPUTTING Annotations!

    Ok, before everyone thinks that this is a very bad solution, I have to tell that I`m no programmer and my knowledge of PostgreSQL, Ruby or any other language is very poor.
    With useful help from Jamie Hodge, fbm and Nicholas Stokes (mainly)
    I could manage to write a command for inputting and outputting from Final Cut Server Annotations.
    So lets go to the fun part:
    INPUTTING:
    1- Create a Response called "Annotations IN" (or whatever you want):
    a - Reponse Action: "Run an external script or command"
    b - Run Script > *Commnad Path: /Library/Application Support/Final Cut Server/Final Cut Server.bundle/Contents/Resources/sbin/fcsvr_run
    Command Parameters: psql px pxdb -c "COPY pxtcmdvalue FROM '/FCSRV/annotation-in.txt' USING DELIMITERS '|';"
    2 - Create a poll Watcher with name: "Watch for Annotations IN"
    a - Enable: true
    b - Monitor Address: Chooses a Device (create a new one or use a tmp one) and path to where you`ll going to put a txt file with the annotations.
    c - Response List: Choose the Response you created "Annotations IN" in my case.
    d - Event Type Filter: Created, Modified
    e - Poll Watcher > Listing Frequency: 2 (or any number of seconds you feel like it).
    Listing multiple: 2
    Wildcard include Filter: *.txt (or any custom extensions you want)
    3 - Create a txt file and use this as a template:
    {ASSET_ENTITYID}|1527|{TCIN}/(30000,1001)|{TCOUT}/(30000,1001)|{Annotation}|{USE RID}|{DATE}
    Where:
    {ASSET_ENTITYID} = Is the entityid of your asset. You can find what number it is by issuing:
    /Library/Application\ Support/Final\ Cut\ Server/Final\ Cut\ Server.bundle/Contents/Resources/sbin/fcsvr_run psql px pxdb -c "SELECT pxmdvalue.entityid, pxmdvalue.value AS asset_name FROM pxmdvalue INNER JOIN pxentity ON pxentity.entityid = pxmdvalue.entityid WHERE pxmdvalue.fieldid='1543' AND pxentity.address LIKE '/asset/%';"
    This will output ALL your assets, so if you know the name or want to parse the name you can use:
    /Library/Application\ Support/Final\ Cut\ Server/Final\ Cut\ Server.bundle/Contents/Resources/sbin/fcsvr_run psql px pxdb -c "SELECT pxmdvalue.entityid, pxmdvalue.value AS asset_name FROM pxmdvalue INNER JOIN pxentity ON pxentity.entityid = pxmdvalue.entityid WHERE pxmdvalue.fieldid='1543' AND pxmdvalue.value='ASSETNAME' AND pxentity.address LIKE '/asset/%';"
    Where in ASSETNAME you`ll have to put your Asset Name without extension.
    {TCIN} and {TCOUT} is, of course, the TC`s points. In the form of: HH:MM:SS;FF
    {Annotation} is the commentary.
    {USERID} (in my case was 1)
    {DATE}: This one is tricky. My example is 2009-03-15 19:31:15.839795-03
    So is in the form YYYY-MM-DD HH:MM:SS.????? I really don`t know the rest. Could be milliseconds?
    Of course one can write a script to translate everything from a txt file like:
    ASSETNAME | TCIN | TCOUT | ANNOTATIONS | USER
    But as I`ve said I`m no programmer
    Ok.. now the time for the OUTPUT:
    The command-line is:
    /Library/Application\ Support/Final\ Cut\ Server/Final\ Cut\ Server.bundle/Contents/Resources/sbin/fcsvr_run psql px pxdb -c "SELECT pxmdvalue.value AS Asset_NAME, pxtcmdvalue.value, pxtcmdvalue.begintc, pxtcmdvalue.endtc FROM pxmdvalue INNER JOIN pxtcmdvalue ON pxmdvalue.entityid = pxtcmdvalue.entityid WHERE pxmdvalue.value='ASSETNAME';"
    Where ASSETNAME is the Asset name without the extension.
    Or issuing the following to OUTPUT ANNOTATIONS from ALL assets:
    /Library/Application\ Support/Final\ Cut\ Server/Final\ Cut\ Server.bundle/Contents/Resources/sbin/fcsvr_run psql px pxdb -c "select * from pxtcmdvalue;"
    Adding "> /PATHTO_WHERE_IN_WANT/ANNOTATIONSOUTPUT.TXT" at the end will put all output into a txt file.
    It`s possible (in theory) to:
    1- Create a boolean md field in FCSRV called "EXPORT Annotations" (don`t choose lookup)
    2- add or create a md group called "Export Annotations" and add the above md field to it (don`t choose lookup)
    3- Add "Export Annotations" md field to Asset Filter md group
    4- Make a Response for Running external command. Command path: /Library/Application Support/Final Cut Server/Final Cut Server.bundle/Contents/Resources/sbin/fcsvr_run
    Command Parameters: psql px pxdb -c 'SELECT pxmdvalue.value AS Asset_NAME, pxtcmdvalue.value, pxtcmdvalue.begintc, pxtcmdvalue.endtc FROM pxmdvalue INNER JOIN pxtcmdvalue ON pxmdvalue.entityid = pxtcmdvalue.entityid WHERE pxmdvalue.value=[FileName];' > ~/Desktop/ann-out.txt
    (I`m having problem with this, it doesn`t work).
    5- Make a Subscription that if Export Annotations modified = true, trigger if changed and trigger the Response above.
    6- Add exporting annotations md group to Media md set.
    In theory it`s possible to modify the FinalCutServerIntegrationSample get and input annotations instead of adding another "comment" field to md group list.
    Few!
    Ok so please help beautify this out!
    This will be very useful for a lot of people.... We know that it`s only a matter of time to FCSVR have this function built-in... but this "time" could be years.
    So let`s start ourselves!
    Thank you very much!!
    Regards!

    AlphaBlue wrote:
    jverd wrote:
    What were you hoping for? Someone reading your mind for what exactly you need, and handing you a giftwrapped answer, without you doing any work or clearly communicating a specific problem? This site doesn't really work that way.Fair enough. I'm asking for insight into how to input from and output to a StarOffice Spreadsheet into/from a Java program. (Think java.io except with spreadsheet files instead of .txt files.) I already answered that question.
    I need to accomplish this without the use of a community-created library.That's a bizarre requriement. Why?
    >
    Okay, [here you go|http://lmgtfy.com/?q=communication+between+StarOffice+Spreadsheets+and+Java].
    If you don't have any knowledge or experience, on the matter, please refrain from directing me to a google search. I assure you, I have already performed such a task.How would I know that.
    But okay, let's say I know that. Let's say you bothered to point out that you've already done that. Further, let's say I do have knowledge of the subject at hand. Maybe I'm an expert. Maybe I wrote Star Office and an open source library (which wheel for some reason you must reinvent). You are assuming that I also have psychic powers, so that I can read your mind and know exactly what you've read so far and exactly what parts of your very broad and vague question said reading did not answer.
    In short, you have received answers commensurate with your questions.

  • How to temporally match/save Input and Output Channels's data?

    Hello, I have a voltage-input, voltage-output SISO system, and need to indentify its dynamic response (or transfer function) as a reference to a PID control. Without using the system identification toolbox, my goal is to generate/provide a sine sweep input (ranging 1Hz-5kHz for 10sec) to the system and to save the corresponding output response signal as well as the sweep input signal simultaneously.
    I got a sample program online and am trying to modify it as attached, but I really need your advices/comments concerning several problems I am facing with:
    1) With the below setting, the number of the acquired Input channel samples obtained is 5461, which is smaller than expected (i.e., 10000). What would I be missing in setting parameters?
    - H/W: NI-USB-6341 DAQ
    - AO: continuous samples with the waveform timing (1k sampling, 10000 samples => 10 sec, slower sampling just for testing purpose)
    - AI: continuous samples, samples to read: 30k, rate: 1k
    2) I am using flat sequence structure as a way to making the start point of saving AI and AO data same, but wonders if this is a right method or if there is other better approaches. (I had an idea of using an internal clock with "1-sample mode" for sync, but this may not work at the high speed sine sweep like 5kHz, right?)
    3) I just want to provide the sine sweep just once to the system and do not require the "reset" functionality implemented in the original sample program. I failed to remove this "reset" part as I did not fully understand the sample code. If I run the attahed, the generated AO signal is periodically provided to the system. Please give me any advice to modify the program as I want.
    Thanks for your help and valualble time.
    Attachments:
    siso.vi ‏230 KB

    Hi J. Kim,
    To begin, you say you want to synchronize your analog input and output so that they start at the exact same time, yes? To achieve tight synchronization, you need to use DAQmx VIs instead of the DAQ Assistant. There's a good overview of DAQmx VIs  here. There's also a document that deals specifically with synchronization in DAQmx here. Additionally, if you go to Help>>Find Examples in the LabVIEW example finder, you can see many other examples of acquiring data using DAQmx.
    As for your configuration, you have your analog input DAQ assistant wired far before your analog output DAQ assistant in your sequence strucutre, so the dataflow of the program will cause the analog input DAQ Assistant to execute before the output. They cannot be in different sequences if they are executing simoultaneously, and I would not use flat sequences here except to start the two tasks in DAQmx. Where did you find this example?
    Best,
    Dan N
    Applications Engineer
    National Instruments 

  • Synchronize input and output tasks to start at the same sample point [C++ NI_DAQmx Base]

    I'm trying to initiate the analog input and output streams to start reliably at the same sample. I've tried triggering the output from the start of the input using the following code [NI-DAQmx Base 2.1 under Mac OS X with an M-Series multifunction board]. It compiles and runs, but gives an error message at the call to "DAQmxBaseCfgDigEdgeStartTrig". Any suggestions about synchronized I/O on this platform?
    #include "NIDAQmxBase.h"
    #include
    #include
    #include
    #define DAQmxErrorCheck( functionCall ) { if ( DAQmxFailed( error=( functionCall ) ) ) { goto Error; } }
    int main( int argc, char *argv[] )
    // Task parameters
    int32 error = 0;
    TaskHandle inputTaskHandle = 0;
    TaskHandle outputTaskHandle = 0;
    char errorString[ 2048 ] = {'\0'};
    int32 i;
    time_t startTime;
    // input channel parameters
    char inputChannelList[] = "Dev1/ai0, Dev1/ai1";
    float64 inputVoltageRangeMinimum = -10.0;
    float64 inputVoltageRangeMaximum = 10.0;
    // output channel parameters
    char outputChannelList[] = "Dev1/ao0, Dev1/ao1";
    char outputTrigger[] = "Dev1/ai/StartTrigger";
    float64 outputVoltageRangeMinimum = -10.0;
    float64 outputVoltageRangeMaximum = 10.0;
    // Timing parameters
    char clockSource[] = "OnboardClock";
    uInt64 samplesPerChannel = 100000;
    float64 sampleRate = 10000.0;
    // Input data parameters
    static const uInt32 inputBufferSize = 100;
    int16 inputData[ inputBufferSize * 2 ];
    int32 pointsToRead = inputBufferSize;
    int32 pointsRead;
    float64 timeout = 10.0;
    int32 totalRead = 0;
    // Output data parameters
    static const uInt32 outputBufferSize = 1000;
    float64 outputData[ outputBufferSize * 2 ];
    int32 pointsToWrite = outputBufferSize;
    int32 pointsWritten;
    for( int i = 0; i < outputBufferSize; i++ )
    outputData[ 2 * i ] = 9.95 * sin( 2.0 * 3.14159 * i / outputBufferSize );
    outputData[ 2 * i + 1 ] = -9.95 * sin( 2.0 * 3.14159 * i / outputBufferSize );
    // ------------------- configure input task -----------------------
    DAQmxErrorCheck ( DAQmxBaseCreateTask( "", &inputTaskHandle ) );
    printf( "Created input task\n" );
    DAQmxErrorCheck ( DAQmxBaseCreateAIVoltageChan( inputTaskHandle, inputChannelList, "", DAQmx_Val_RSE, inputVoltageRangeMinimum, inputVoltageRangeMaximum, DAQmx_Val_Volts, NULL ) );
    printf( "Created AI Voltage Chan\n" );
    DAQmxErrorCheck ( DAQmxBaseCfgSampClkTiming( inputTaskHandle, clockSource, sampleRate, DAQmx_Val_Rising, DAQmx_Val_ContSamps, samplesPerChannel ) );
    printf( "Set sample rate\n" );
    // ------------------- configure output task -----------------------
    DAQmxErrorCheck ( DAQmxBaseCreateTask( "", &outputTaskHandle ) );
    printf( "Created output task\n" );
    DAQmxErrorCheck ( DAQmxBaseCreateAOVoltageChan( outputTaskHandle, outputChannelList, "", outputVoltageRangeMinimum, outputVoltageRangeMaximum, DAQmx_Val_Volts, NULL ) );
    printf( "Created AO Voltage Chan OK\n" );
    DAQmxErrorCheck ( DAQmxBaseCfgSampClkTiming( outputTaskHandle, clockSource, sampleRate, DAQmx_Val_Rising, DAQmx_Val_ContSamps, samplesPerChannel ) );
    printf( "Set sample rate\n" );
    // trigger output when input starts
    DAQmxErrorCheck ( DAQmxBaseCfgDigEdgeStartTrig( outputTaskHandle, outputTrigger, DAQmx_Val_Rising ) );
    printf( "Set output trigger\n" );
    // ------------------- configuration -----------------------
    // write output signal
    DAQmxErrorCheck ( DAQmxBaseWriteAnalogF64( outputTaskHandle, pointsToWrite, 0, timeout, DAQmx_Val_GroupByScanNumber, outputData, &pointsWritten, NULL ) );
    printf( "Write output signal\n" );
    // set up input buffer
    DAQmxErrorCheck ( DAQmxBaseCfgInputBuffer( inputTaskHandle, 200000 ) ); // use a 100,000 sample DMA buffer
    // initiate acquisition - must start output task first
    DAQmxErrorCheck ( DAQmxBaseStartTask( outputTaskHandle ) );
    DAQmxErrorCheck ( DAQmxBaseStartTask( inputTaskHandle ) );
    // The loop will quit after 10 seconds
    Dr John Clements
    Lead Programmer
    AxoGraph Scientific

    Hi Michael,
    First of all, thanks very much for taking the time to investigate this problem! Much appreciated.
    You asked for "an actual error code you got and any description that is given". The full output from the program that I posted earlier in this thread is appended to the end of this message. In summary, following the call to...
    DAQmxErrorCheck ( DAQmxBaseCfgDigEdgeStartTrig( outputTaskHandle, outputTrigger, DAQmx_Val_Rising ) );
    ... with ...
    char outputTrigger[] = "Dev1/ai/StartTrigger";
    ...the error message is ...
    DAQmxBase Error: Specified route cannot be satisfied, because the hardware does not support it.
    You asked "specifically which M series device you are using"? It is the PCIe 6251 (with BNC 2111 connector block). I'm testing and developing on an Intel Mac Pro (dual boot OS X and Windows XP).
    You asked for "the location you pulled the code from". Here it is...
    http://zone.ni.com/devzone/cda/epd/p/id/879
    ...specifically from the file "Multi-Function-Synch AI-AO_Fn.c".
    I adapted the NI-DAQmx calls to their NI-DAQmx Base equivalents.
    Finally, you asked "Is the trigger necessary, or do you just need to know that the measurements are running on the same clock?". I believe that some kind of sychronized trigger is necessary in my situation (correct me if I'm wrong). Timing is crucial. Say I initiate an analog output stream that delivers a voltage command step 5 ms from the onset. I need to record the response (analog input stream) so that its onset is accurately aligned (synchronized) at 5 ms. A typical recording situation would stimulate and record a short data 'sweep', then wait for the (biological) system to recover, then stimulate and record another short sweep, and repeat. I need all the recorded sweeps to align accurately so that they can be averaged and analyzed conveniently.
    I definitely do not want my customers to rely on an expensive external TTL pulse generator to initiate and synchronize each 'sweep'. That would effectively eliminate the cost advantage of an NI board, as well as adding unnecessary complexity in setup and use. It would be a show-stopper for me.
    It seems perverse, but would it be possible to use a digital output channel connected directly to a digital input chanel to trigger the input and output streams?
    Regards,
    John.
    Full output from test program. Compiled with gcc 4 under OS X...
    [Session started at 2007-05-23 14:17:01 +1000.]
    LoadRuntime: MainBundle
    CFBundle 0x303cc0 (executable, loaded)
    _CompatibleWithLabVIEWVersion: linkedAgainst: 08208002
    _CompatibleWithLabVIEWVersion: result= false, mgErr= 1, theActualVersion= 00000000
    _CompatibleWithLabVIEWVersion: linkedAgainst: deadbeef
    _CompatibleWithLabVIEWVersion: Reseting Linked Against
    _CompatibleWithLabVIEWVersion: linkedAgainst: 08208002
    _CompatibleWithLabVIEWVersion: result= true, mgErr= 0, theActualVersion= 00000000
    _CompatibleWithLabVIEWVersion: linkedAgainst: 08208002
    _CompatibleWithLabVIEWVersion: result= true, mgErr= 0, theActualVersion= 00000000
    com.ni.LabVIEW.dll.nidaqmxbaselv
    CFBundle 0x313760 (framework, loaded)
    {type = 15, string = file://localhost/Library/Frameworks/nidaqmxbaselv.framework/, base = (null)}
    Amethyst:Library:Frameworks:nidaqmxbaselv.framework
    2007-05-23 14:17:02.248 test-ni[4445] CFLog (21): Error loading /Library/Frameworks/LabVIEW 8.2 Runtime.framework/resource/nitaglv.framework/nitaglv: error code 4, error number 0 (no suitable image found. Did find:
    /Library/Frameworks/LabVIEW 8.2 Runtime.framework/resource/nitaglv.framework/nitaglv: mach-o, but wrong architecture)
    CFBundle 0x1751fdc0 (framework, not loaded)
    Created input task
    Created AI Voltage Chan
    Set sample rate
    Created output task
    Created AO Voltage Chan OK
    Set sample rate
    DAQmxBase Error: Specified route cannot be satisfied, because the hardware does not support it.
    test-ni has exited with status 0.
    Dr John Clements
    Lead Programmer
    AxoGraph Scientific

  • Selecting separate input and output devices!

    hi, i have logic pro 8 and cant find out how to select separate devises for input and output!
    for my output (and input when recording drums) i use a alesis multimix 16 (16 track firewire desc) but for recording guitars and bass and poss vocals i would like to use my line 6 x3 live as my input devise but still using the alesis for monitoring.
    is this possible? cant figure how to do it.
    any help is great help! cheers, Dan

    In Logic 9 you can easily select different input and output devices in the Preferences Devices area. In Logic 8 you must create an aggregate device -
    http://support.apple.com/kb/HT1215
    JG

  • Audio input and output at the same time

    Hello mac users.
    I have one simple question: since the new macbook has one single audio port for both input and output, how could I, for example, play my guitar AND listen to the headphones at the same time?
    I KNOW (because I've tried) that with the iPhone headphones with microphone the port CAN physically work at the same time for input and output, so the question is: what can I use to do that? Will a simple splitter do or do I have to use different tricks?
    (I know there is a thread on this already, but it doesn't provide a definitive answer)
    Thank you!

    One of the first questions to ask...
    Is the audio input stereo or mono?
    When using a headset mic you're dealing with a mono input so you at least know the Mac is capable of that.
    If it's mono, and I suspect it is, should be easy to either make or purchase a custom cable that has two female input connectors, one mono input and a stereo headphone input.
    However, I'd probably just purchase a USB audio interface, the sound, both recording and playback will be head and shoulders above the Macbooks built in internal audio.
    pancenter-

  • How to hide a varible that is ready for input and personalized for a value

    Hi All,
    Is there anyway to hide a variable in variable screen selection which is ready for input and its personalized value is stored in the ODS.
    Any help greatly appreciated.
    Suresh.

    Hi Roberto,
    Is there anyway to hide that variable from the variable screen(with still option being selected as ready for input).I ried all the options such as replacemetn type & copy from another variable.Always it appears in the varaible screen.
    I don't want user to change the value of this variable.
    Cheers,
    Suresh.

  • How to change the input and output schema in BPEL process

    hi',
    Please tell me how to change the input and output schema in BPEL process after the process is made.
    thanks
    Yatan

    If your intention is just changing the content you are passing to bpel/returning from bpel
    Here is another way
    just update your default created xsd files with new elements, update wsdl elements in message definition and chnage bpel code to reflect new elements in activities
    Regards,
    Praveen

Maybe you are looking for

  • Updates template don't come through on the site

    What I have been trying to do is update a template and apply it to all files that are based on this template. The problem I have been encountering is not inside dreamweaver itself: the template is updated automatically in every file I want it to. The

  • ITunes not recognizing itouch error code 0eX800000A

    Up until recently there was no problem with connection but now when I try to connect my iTouch 2nd gen iTunes does not recognize it and a window comes up saying  "iTunes could not connect to this iPod because an unknown error occured (0xE800000A)"  I

  • Reverse function not active

    Hi, I noticed that in F8REL there's a function to do reverse... but it's not active.. When I execute the list, I can select the document to release, but cannot reverse. How to use this function ? Thanks, Melissa

  • Requirement Type not populated in Sale Order

    Hi, In our sales order a requirment type 041 is not getting populated into the sales order for one particular item category. Regards, Jagan

  • How do i get things out of the cloud?

    suddenly, every tv show and song i have ever bought is showing up on my apple tv and my iphone.  I guess they are stored in the cloud?  i want to delete some of this media forever.  how do i do that?