Comparing digital input and output from two different DAQs

I want to create this program where the digital output lights up LEDs at random and push buttons are the digital input part of another DAQ are pushed. When the correct button is pushed, the score will increase by 1. My code doesn't work though. Can someone point my errors to me? Both the DAQs i'm using are USB-6008 DAQs. thanks
Attachments:
Untitled 1.vi ‏41 KB

Let's start with the digital output
What is this code all about?
Do you want only one of the 8 led's to lit randomly or are multiple led's also ok?
The two possible codes are in attached file SNAG-003.jpg
Connect the output of the "Scale by power of 2" function or the "Multiply" output directly to the Write DAQmx vi
I don't understand the purpose of the "Boolean Value" and "Replace subset array" thing, so I skipped it
Attachments:
SNAG-002.jpg ‏49 KB
SNAG-003.jpg ‏22 KB

Similar Messages

  • How to synchronize analog input and output from two different USB daq boards

    Hi all,
    I have two very differnt USB boards the NI USB 6008, which I am using to acquire the data (Analog Input) and a NI USB 9263, it is an Analog Output only board that I am using to deliver a signal (in this case a square pulse). The reason why I am not using the 6008 Analog Ouputs is because I need to deliver negative voltages and need the full +/-10V range.
    Looking at similar posts I am pretty sure that I can't use an external trigger or a shared clock, I also tried to use the synchronization of timed structures but no cigar.
    I am including a quick vi that I whipped out showing how the signal jitters due to the lack of synchronization. The AO from the 9263 connects to the AI in the 6008 in this example.
    Solved!
    Go to Solution.
    Attachments:
    Test Pulse.vi ‏117 KB

    I talked to a specialist in the phone and tols me that it is not possible.

  • Simultaneous Digital Input and Output from NI 9403

    Hi,
    I was wondering if it is possible to digital output through one line in this module(NI 9403) while simultaneously reading from 10 other lines?
    Basically what I need is for line0 to always be closed(true), and read lines1:10 - at very least 1sample/second.
    I have attached a stripped down version of my code illustrating my error. I thought I was getting the error because the two tasks were using different clock configurations, but I tried using the same inputs and that doesn't work for me.
    Any input is greatly appreciated.
    Thank you
    Attachments:
    Digital I-O.vi ‏22 KB

    Hi Matthew,
    The behavior you're seeing is expected for the 9403 module, since it is a serial module. The DAQmx help has the following restrictions in the Digital I/O Considerations for C Series Devices section.
    Timed digital input/output restrictions:
    You cannot use parallel and serial modules together on the same hardware timed task. 
    You cannot use serial modules for triggering. 
    You cannot do both static and timed tasks at the same time on a single serial module. 
    You can only do hardware timing in one direction at a time on a serial bidirectional module.
    So you can only do timed input or output at one time, but not both. However, based on the VI you attached and the description of what you want to do, you don't necessarily need both timed tasks in your loop. You can create a static output task to update that one line and after that, you can just start your timed input task on the rest of the lines. This should maintain the state on the DO line, since you're not acquiring from it.
    Cheers,
    Cristina
    Cristina

  • Can you perform simultaneous timed digital input and output using a PCI-6120?

    Is it possible to do simultaneous timed digital input and output using a PCI-6120? It seems that timed digital operations require using the group read/write commands, which utilize an entire port. Since the PCI-6120 has only 1 digital I/O port, I would like to be able to use 2 lines as outputs and 1 line as input, and do both in a deterministic fashion. i.e. create a digital signal with known pulse widths and read an input line at a known time after the outputs were set. Is this possible to do with only one digital I/O port?

    Hello,
    This can be done in LabVIEW. There is actually an example that installs with NI-DAQ.
    Below is a link to a Knowledge Base that explains how to find the correlated digital I/O examples.
    http://digital.ni.com/public.nsf/websearch/B849664604EB34B886256D12005B5520?OpenDocument
    Just take a look at the example titled �Continuous CDIO with external clock (E).vi�
    Best regards,
    Justin Tipton
    National Instruments

  • XiFi and Audigy Take Over Input and Output from Bluetooth Head

    I am having trouble with my bluetooth headset when making phone calls in any VoIP application (Skype, Yahoo!). I usually use the headset as the input and output for my VoIP bits so I can move away from my desk, etc... First, it worked under XP with my Audigy no problem. I bought a XiFi and installed the latest drivers and it began stealing my audio. Oddly, it does not do it until the call connection is made (so I hear the ringing in the BT headset and once the call is answered the system reverts to the mic, a Logitech USB, and main speakers, directly plugged to the soundcard).
    I decided to put my audigy back in, because I was planning on upgrading to Vista and thought the XiFi may be bad. I did a fresh Vista install with the Audigy and everything worked (i.e. audio for phone calls stayed in my BT headset). I then upgraded from the Microsoft drivers to Creative?s Vista drivers and the problem then happened with the Audigy as well.
    This leads me to believe that some sort of regression happened in the latest drivers. Everything else works great, games, movies, etc? but this is a show stopper because I want to use my bluetooth headset. I tried to downgrade to the Microsoft drivers but the card would no longer work. I have tried a driver install only, then added the software, removed that and did a full install. This is with BETA drivers on Vista, but the problem existed in XP as well which were not BETA drivers AFAIK. I have updated to the latest Bluetooth drivers as well with no luck.
    I have confirmed this on two of my PCs and a friend of mine is having the same problem (XP, XiFi) so he went and bought a Skype phone which works correctly.
    Thanks in advance

    thanks for reply..
    Please help me out with the entire setp by step procedure that i have to follow in getting the output in variable
    i am using to get the emp name from webservices and i am passing empno from form.
    INPUT STRING
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
       <soapenv:Header/>
       <soapenv:Body>
          <tem:ALL_GetEmpNamefrmID>
             <!--Optional:-->
             tem:EmployeeLogin>{$ /process_data/@emp_no $}</tem:EmployeeLogin>
          </tem:ALL_GetEmpNamefrmID>
       </soapenv:Body>
    </soapenv:Envelope>
    when i hard coded emp no for testing EG: 1234 the out put i am getting the folloeing XML when i click tes
    OUTPUT:
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <soap:Body>
          <ALL_GetEmpNamefrmIDResponse xmlns="http://tempuri.org/">
             <ALL_GetEmpNamefrmIDResult>SUBBA</ALL_GetEmpNamefrmIDResult>
          </ALL_GetEmpNamefrmIDResponse>
       </soap:Body>
    </soap:Envelope>
    Please help me out what are the steps i have to follow for getting out put SUBBA to my variable

  • Producer consumer with analog and digital inputs and outputs

    Hi everyone,
    I am working on a control system program for some practical test work. Currently I am working on the data acuisition component of the Labview program. My architecture is produced-consumer loops with a que. My system will have analog inputs, analog outputs, digital inputs and digital outputs. It's not a time critical sytem, but I would like all of the data acquisition to be synchronised. I have attached my program as it is at the moment. I am having trouble getting all of the data into the que since I have two data types. Also, I'm not sure if i've synchronised the four read/write sequences correctly. I would greatly appreciate if somebody could take a look at my program and give me some advice. Thanks in advance.
    Solved!
    Go to Solution.
    Attachments:
    control_v2_DAQ loop.vi ‏46 KB

    Robert, the specific error that I get is:
    Error -200462 occurred at DAQmx Start Task.vi:6
    Possible reason(s):
    Generation cannot be started because the output buffer is empty. 
    Write data before starting a buffered generation. The following actions can empty the buffer: changing the size of the buffer, unreserving a task, setting the Regeneration Mode property, changing the Sample Mode, or configuring retriggering.
    Task Name: Heater testing lab digital outputs
    This error occurs at the 'DAQmx write.vi' function. I just want to sent one sample per second, for each channel. I would like the producer and consumer loops to each run once every second.
    I have attached part of my code with just the data acquisition and writing. Any help would be greatly appreciated.
    Attachments:
    control_v2_ML_simple.vi ‏83 KB

  • How to switch USB-6008 between digital input and output modes

    Hi I have been following the examples of setting a specific port to either inout or output using the DAQmxCreateDIChan() or DAQmxCreateDOChan() calls. What I now want to do, is switch betwen inout to output mode and back again.
    DAQmxCreateDOChan()
    DAQmxWriteDigitalLines()
    // do something
    //switch to input
    DAQmxReadDigitalU32()
    // switch back to output
    I can't seem to find any calls or discussions on this.
    rjmiller

    Hi RJM,
    If you want to be able to switch your digital line between input and output, then you will need to use the Tristate Property. There is another discussion forum with more detailed information about using this property and I believe that you have already seen it. I am going to post the link in case anyone else wants to see the other forum as well: Tristate Property Discussion Forum. Reddog's post is very informative.
    Regards,
    Hal L.

  • Multiple Input and Output from a 6534

    Hello
    I am after some advice regarding my PCI 6543 digital I/O card and the best way to achieve my desired results. I am programming in Visual C++ with Ni-DAQ 7.
    I want to generate a pattern output from one of the ports, Port A, following a software command. This pattern consists of a 10uS pulse on DIOA0, that repeats 200 times with a period of 100uS. I want this DIOA0 output line to initiate an input on ports C and D, possibly through the REQ pin. Consequently the input should acquire 200 times for each call to the pattern output.
    I want this to repeat, so the pattern output goes again (as in a FOR loop), and the input occurs again for an as yet undetermined number of times.
    I have managed to get something worki
    ng for 1 iteration, and I can generate multiple pattern outputs, but the inputs only seem to acquire for the 1st iteration. However, if I step through the code in debug mode I can get the input to work correctly.
    Any ideas would be gratefully appreciated.
    I am still trying to get some earlier problems with this application solved.
    Kind Regards
    Jamie

    Hi Jamie,
    There are a couple different ways you can loop from a buffer. You can either use the onboard memory of the 6534 and loop from there or you can specify as a software configuration that the board loop through the PC memory buffer.
    For the onboard looping you need to specify the following:
    iStatus = Set_DAQ_Device_Info (1, ND_PATTERN_GENERATION_LOOP_ENABLE, ND_ON);
    For software, PC memory looping, the following function specifies this:
    iStatus = DIG_DB_Config (iDevice, iGroup, 1, 0, 1);
    I attached a couple programs that might be of use. Check this post:
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=5065000000080000008BA10000&USEARCHCONTEXT_CATEGORY_0=_31_%24_12_&USEARCHCONTEXT_CATEGORY_S=0&UCATEGORY_0=_31_%24_1
    2_&UCATEGORY_S=0
    Hope that helps. Have a good day.
    Ron

  • Patterned input and output from a single port w/ NI 6534 DIO

    Is it possible to configure certain lines in a port to be read and others to be write? I am interested in doing patterned I/O with a single port, first output, then input. Not both at the same time. Is it possible to perform patterned output on one line and patterned input on a different line within the same port?
    Thanks
    -Scott

    Hi Scott,
    I understand that you'd like to do digital I/O on a PCI-6534. All of the scenarios you outlined in your question should be possible with this board.
    1. You can configure some lines of a port to output signals while others input signals by using a line direction map.
    2. You can do patterned I/O on the same port at the same time.
    I'm not sure what software you're using to interface with the 6534, but if you happen to be using LabVIEW, then there is a shipping example which demonstrates the basics of patterned I/O on a single port of a DIO board. The example is called Digital Multi-line Direction (E).vi and can be found in Help >> Find Examples. If you are using another programming language, then there may be examples on ni.com.
    Hope this helps
    Marcus G.
    National Instruments

  • Compare 2 Columns using SSIS from two different tables

    Hello,
    A newbie to ssis.
    I have a Table 1 with Address Details and Table 2 with Address Details of same customer but from different sources. I have loaded these two data sources and also joined these two tables.
    I want to compare address column of one table with the other table, if they are not equal need to insert into another table.
    With Sql query we can perform it, but just want to know how to perform this with ssis.

    You can use the
    LookUp Transformation
    Arthur
    MyBlog
    Twitter

  • Input and output from child process

    Hi all,
    I am developing an IDE for the Haskell functional programming language. The application runs the Haskell interpreter as child process, and sends and receives input from the interpreter. At the moment I'm programming the integrated console through which the IDE should communicate with the interpreter. The problem is that when I send a command to the interpreter to execute the code I can't detect when the code is running and when it waits for input, so I'll be able to dissable and enable input in the the console respectivly. Please answer as soon as possible, and if my explanation of the problem is not clear enough please just comment about it. Thank you in advance.

    Generally the way I have seen that sort of things designed is like this: You have a script in mind. For example:
    1. Send command "ABC DEF" to the interpreter.
    2. Wait until it responds with "OK" or "Failed".
    3. If it responded with "Failed" then quit.
    4. Send command "XYZ XYZ" to the interpreter.
    5. ... and so on
    You can do this in simple or complicated ways, of course. But if you can't do it, then you're going to find it difficult to do anything at all. For example you won't know when the interpreter is waiting for input (that seems to be your problem already).

  • Statistical forecasting....Input and Output at different levels? & MAD and MAPE calculations

    Team,
    Couple of questions on Statistical Forecasting...
    1) Is it possible to have input and output KF at different planning levels?...
    2) Is there anyway to see MAD and MAPE values for each Forecast run?
    Any help is appreciated....Thanks for your help...
    Thanks,
    Krishna

    Hi Krishna,
    #1 - The Inputs and Outputs should be at the same base planning level. Output should be a Stored KF. The input can be a calculated KF.
    To achieve input and output at different plan levels, you can do something like this:
    I/P KF1@PL1 (stored)   Output: KF3@PL2
    Create a Calculated KF: KF2@PL2 with calculation like SUM(KF1@PL1) and use this as input for StatFcst
    #2 - The result of Fcst run MAD cannot be seen from Excel Client yet, we will address this in near release. If you are on-premise, you can see the results in table: sap.sop.sopfnd.catalogue::SOPFCS_FORECAST_RUNTIME_INFO_TAB
    Hope this is useful.
    Thanks,
    Raghav

  • Input and output on same device, producer/consumer structure

    Hello interested people,
    I have a question about using the same device for both digital inputs
    and outputs.  I have written a simple program of one while loop
    that continuously polls the device, processes, and requests.  I
    have addressed the device using two DAQmx Asst. and I have attached
    them with their error in/out cluster terminals to provide data flow and
    eliminate the chance of addressing the devices at the same time (which
    produces an error).  Now I want to change this program structure
    to a producer/consumer loop foundation with state machine.  
    In this design, I will have the DI in the producer loop and the DO in
    the consumer loop, under one of the states.  I can't simply
    connect the error in/out ports in this configuration, so my question is
    how to avoid the error caused by addressing the same device
    simultaneously with two different tasks (input and output)?  I
    have attached two VI's, the "One Loop" vi is the original configuration
    (simplified), and the Producer-Consumer vi is a NONSENSICAL program
    that simply represents the desired configuration.  (I don't need
    any comments on the programming of this vi, it is only an example for
    illustration of the problem). 
    I am thinking about bundling the input data and the error cluster, both
    from the PXI 6528 DI, into one cluster, queueing that up, and
    unbundling the de-queued elements for some kind of data flow between
    the producer loop and the "Request" state of the consumer loop. 
    Is this the right approach, or am I barking up the wrong tree?
    Thanks
    Attachments:
    One Loop DO DI.vi ‏102 KB
    Producer-Consumer DI-DO.vi ‏106 KB

    Hello,
    It sounds to me like you really have two modes:
    1. user interface actions determine execution
    2. user interface is locked, and execution is automated.
    I think it would make sense to use the producer consumer for an architecture.  Basically you would do the following:
    1. program the producer to handle the user interface as you normally would.
    2. provide one additional event case in the producer which would be your "automated handling" case.  In that case, you could put a state machine which could run until whatever conditions were met to put your program back in "user interface mode".
    Keep in mind that you can use custom USER EVENTS to programmatically generate events ie. you can trigger the start of your "automated handling" form anywhere in your code at virtually any time.
    I think this would allow you to take advantage of the producer consumer architecture in its intended spirit, while integrating an automated routine.
    I hope this helps!
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

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

  • Not able to compare PL/SQL body from two different offline database object

    It is not possible to compare two package bodies from two different off line database object in two different off line database and schema.
    JDeveloper display a compare not available message in the middle of the window.
    It is possible to compare the package specification.

    Not able to compare scripts generated from offline database objects too

Maybe you are looking for