PCI 6602:How can I use the digital lines of the board and in the same time to generate pulse train using a counter?

Hello!
My problem appeared when I tried to update my code from Traditional NI-DAQ Legacy to DAQmx.
I am using 2 counters (counter 5 and counter 7)  from PCI-6602, to generate pulse train, and also the Digital I/O lines of the port 0 (the lines form 0 to 7). What I do in my application is that I am starting to generate the pulse train on the output of the 2 counters, and after that I am playing with the state of the digital lines.
In traditional there was no problem using the counters and the digital lines in the same time, everything was going perfectly, but in DAQmx this is not possible.
What happens: I start to generate pulse train on the output of the counters,  no errors encountered, but when I try to modify the state of one line of the digital port the generation of the pulse train is stopped. This is happening when I start the task associated to the digital port.
My question is: it is possible to create a channel on the digital lines without altered the channels created for the counters?
Another thing what I manage to see using the  "Measurement & Automation Explorer" and Test panels for PCI-6602, basically is the same thing, I generate pulse train on the output of the counter 7 and try to start a task on the digital line, but I get one error :
"Error -200022 occurred at Test Panel
Possible Reason(s):
Measurements: Resource requested by this task has already been reserved by a different task.
Device: Dev4
Terminal: PFI8"
Instead if I use the counter 0 or counter 1 to generate pulse train I don't encounter the same problem.
Which resources are used by the counters 2 to 7 from the PCI-6602 board and the counters 0 and 1 do not use?
Thank in advance for any replies!
Ciprian
Solved!
Go to Solution.

Hello Jordan, thank you for your reply.
I am sorry but I can not see or run your example, I don't use LabView, I use Visual C++ for developing.
Here is the code for generating the pulse train:
GeneratePulseTrain(unsigned long ulCount1, unsigned long ulCount2)
    short nStatus = 0;
    nStatus = DAQmxCreateTask("",&m_taskHandle);
    nStatus = DAQmxCreateCOPulseChanTicks (m_taskHandle, "Dev4/count5", "", NULL, DAQmx_Val_Low, 0.0, ulCount1,ulCount2);
    if( bTriggerMode == true) // if hardware trigger is enabled
        nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_ArmStartTrig_Type, DAQmx_Val_DigEdge);
        nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_DigEdge_ArmStartTrig_Edge, DAQmx_Val_Rising);
        nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_DigEdge_ArmStartTrig_Src,"Dev4/PFI17" );
    //set the internal timebase
    nStatus = DAQmxSetCOCtrTimebaseSrc(m_taskHandle,"Dev4/count5","20MHzTimeBase" );
    nStatus = DAQmxStartTask(m_taskHandle);
    return nStatus;
And the code where I try to set the digital line:
SetChannelState(short nState)
    short nStatus = 0;
    uInt8 wrtBuf0[1]={0};
    nStatus = DAQmxCreateTask("",&m_taskHandle);
    // Configure line as output 
    nStatus = DAQmxCreateDOChan (m_taskHandle, "Dev4/port0/line0", "", DAQmx_Val_ChanPerLine);
    nStatus = DAQmxStartTask(m_taskHandle);
    wrtBuf0[0] = nState;
    nStatus =DAQmxWriteDigitalLines (m_taskHandle, 1, 0, 0, DAQmx_Val_GroupByScanNumber , wrtBuf0, NULL, NULL);
    nStatus = DAQmxWaitUntilTaskDone(m_taskHandle,10);
    nStatus = DAQmxStopTask(m_taskHandle);
    nStatus = DAQmxClearTask(m_taskHandle);
    m_taskHandle = 0;
    return nStatus;      

Similar Messages

  • How can i request the actual time code of digital video recorder, i am using RS232 interface for asking actual time code of digital video recording

    how can i request the actual time code of digital video recorder, i am using RS232 interface for asking actual time code of digital video recording

    If you have an RS-232 interface to the digital video recorder, it may be that you can send a command to the video recorder in order to get the time code sent back to your application - you would then read this as a string and then incorporate this data into your program.
    The best source of help will be any documentation you have relating to the serial (RS-232) interface with the digital video recorder. This documentation should have commands that you can send to the recorder and expected response strings that you should get back from the device. This task should be straightforward but can often be frustrating without documentation about the video recorder. This will not be something that you can "guess" - past experience in writing serial communication ap
    plications has shown that a good manual is your best friend.
    Failing this if you have any source code for example programs that have already been written to communicate with the recorder, you might be able to extract the relevant ASCII strings and use them within your application. This is true whether you are using LabVIEW or a text-based language.
    Jeremy

  • My macbook wont allow me to use the same hotmail address as i used on my other computers. How can I keep the same email and log into it on a macbook?

    my macbook wont allow me to use the same hotmail address as i used on my other computers. How can I keep the same email and log into it on a macbook?

    That indicates a hardware failure. Read here:
    http://support.apple.com/kb/ts1559
    If nothing works, you most likely have a hardware failure. Make an appointment at an Apple store to confirm.

  • I use a iphone and MacBook Pro using mail on each.  How can I see the same mail boxes on the laptop that I see on the iPhone?

    I use a iphone and MacBook Pro using mail on each.  How can I see the same mail boxes on the laptop that I see on the iPhone?

    for starters this is not the forum for notebooks or for that matter icloud or iphone.
    MacBook Pro
    https://discussions.apple.com/community/notebooks/macbook_pro
    https://discussions.apple.com/community/mac_os?view=discussions 
    http://www.apple.com/support/macbookpro
    http://www.apple.com/support/iphone

  • How can I use word count without it counting the words in the end notes by default?

    How can I use word count without it counting the words in the end?
    Now I have to highlight the text to get a count.

    I don't think that is possible, it does what it does.
    Peter

  • How can I get the elapse time for execution of a Query for a session

    Hi ,
    How can I get the elapse time for execution of a Query for a session?
    Example - I have a report based on the procedure ,when the user execute that it takes say 3 min. to return rows.
    Is there any possible way to capture this session info. for this particular execution of query along with it's execution elapse time?
    Thanks in advance.

    Hi
    You can use the dbms_utility.get_time tool (gives binary_integer type value).
    1/ Initialize you time and date of beginning :
    v_beginTime := dbms_utility.get_time ;
    2/ Run you procedure...
    3/ Get end-time with :
    v_endTime := dbms_utility.get_time ;
    4/ Thus, calculate elapsed time by difference :
    v_elapsTime := v_endTime - v_beginTime ;
    This will give you time elapsed in of 100th of seconds...
    Then you can format you result to give correct print time.
    Hope it will help you.
    AL

  • How can I have the same environment on two macs on is a macbook pro and the other a Mac mini

    How can I have the same environment on two macs on is a macbook pro and the other a Mac mini ?

    Forget trying to use iCloud for this - it won't do what you want.  iCloud syncs certain data like contacts and events, but it doesn't sync "environments" on computers.

  • How can we put the report which is generated by the program into spool??

    How can we put the report which is generated by the program into spool??
    I had generated a file in Unix which had the report but now the requirement has changed.
    Regards,
    Shashank.

    Hi Shashank,
    If the program is executed in the background and it has the write statement then the spool will automatically generated.
    Reward points if useful.
    Regards,
    Atish

  • How can I input read a line from a file and output it into the screen?

    How can I input read a line from a file and output it into the screen?
    If I have a file contains html code and I only want the URL, for example, www24.brinkster.com how can I read that into the buffer and write the output into the screen that using Java?
    Any help will be appreciate!
    ======START FILE default.html ========
    <html>
    <body>
    <br><br>
    <center>
    <font size=4 face=arial color=#336699>
    <b>Welcome to a DerekTran's Website!</b><br>
    Underconstructions.... <br>
    </font> </center>
    <font size=3 face=arial color=black> <br>
    Hello,<br>
    <br>
    I've been using the PWS to run the website on NT workstation 4.0. It was working
    fine. <br>
    The URL should be as below: <br>
    http://127.0.0.1/index.htm or http://localhost/index.htm
    <p>And suddently, it stops working, it can't find the connection. I tried to figure
    out what's going on, but still <font color="#FF0000">NO CLUES</font>. Does anyone
    know what's going on? Please see the link for more.... I believe that I setup
    everything correctly and the bugs still flying in the server.... <br>
    Thank you for your help.</P>
    </font>
    <p><font size=3 face=arial color=black>PeerWebServer.doc
    <br>
    <p><font size=3 face=arial color=black>CannotFindServer.doc
    <br>
    <p><font size=3 face=arial color=black>HOSTS file is not found
    <br>
    <p><font size=3 face=arial color=black>LMHOSTS file
    <br>
    <p><font size=3 face=arial color=black>How to Setup PWS on NT
    <BR>
    <p><font size=3 face=arial color=black>Issdmin doc</BR>
    Please be patient while the document is download....</font>
    <font size=3 face=arial color=black><br>If you have any ideas please drop me a
    few words at [email protected] </font><br>
    <br>
    <br>
    </p>
    <p><!--#include file="Hits.asp"--> </p>
    </body>
    </html>
    ========= END OF FILE ===============

    Hi!
    This is a possible solution to your problem.
    import java.io.*;
    class AddressExtractor {
         public static void main(String args[]) throws IOException{
              //retrieve the commandline parameters
              String fileName = "default.html";
              if (args.length != 0)      fileName =args[0];
               else {
                   System.out.println("Usage : java AddressExtractor <htmlfile>");
                   System.exit(0);
              BufferedReader in = new BufferedReader(new FileReader(new File(fileName)));
              StreamTokenizer st = new StreamTokenizer(in);
              st.lowerCaseMode(true);
              st.wordChars('/','/'); //include '/' chars as part of token
              st.wordChars(':',':'); //include ':' chars as part of token
              st.quoteChar('\"'); //set the " quote char
              int i;
              while (st.ttype != StreamTokenizer.TT_EOF) {
                   i = st.nextToken();
                   if (st.ttype == StreamTokenizer.TT_WORD) {          
                        if (st.sval.equals("href")) {               
                             i = st.nextToken(); //the next token (assumed) is the  '=' sign
                             i = st.nextToken(); //then after it is the href value.               
                             getURL(st.sval); //retrieve address
              in.close();
         static void getURL(String s) {     
              //Check string if it has http:// and truncate if it does
              if (s.indexOf("http://") >  -1) {
                   s = s.substring(s.indexOf("http://") + 7, s.length());
              //check if not mailto: do not print otherwise
              if (s.indexOf("mailto:") != -1) return;
              //printout anything after http:// and the next '/'
              //if no '/' then print all
                   if (s.indexOf('/') > -1) {
                        System.out.println(s.substring(0, s.indexOf('/')));
                   } else System.out.println(s);
    }Hope this helps. I used static methods instead of encapsulating everyting into a class.

  • How can I get the Date & Time to appear on my final project in iMovie11?

    I am using iMovie 11 and have imported video from a Canon Vixia-HF21 camera. The EXIF data is imported along with the video but when I produce the final product, the date and time do not appear.  How can I get the Date  & Time data to appear on the final product?

    There is a date and time Title you can use. If I recall correctly, it displays date plus hours and minutes, but not seconds.

  • How can I add the same transition to 200 photos?

    I'm making a slide show of over 200 photographs. How can I add the same transition between each photo without inserting it 200 times? There has to be a way to globally' insert transitions. What if I want to modify the length of the transitions or the photos? I don't want to modify each one individually.

    Daniel,
    Here are some references for you for applying a transition between all photos
    1)
    http://www.adobeforums.com/webx/.59b4ddb1/0
    will point you to a tutorial at muvipix.com
    Basically you do a Create Slideshow command choosing the transition before the photos are placed on the Premiere Elements Timeline. This process also specifies the duration for the "slide" and the transition.
    2)I suggest that you also read this FAQ about the resolution of photo files to be used in Premiere Elements. Even though written for an earlier version, it is still relevant (and potentially necessary) depending on the specs and status of your system
    http://www.adobeforums.com/webx/.3bb8822c

  • How can I get the same session with jdbc?

    HI
    After I create or use a JDBC connection,
    i do a query.
    How can I get the same session next time?
    thanks a lot!

    Hi qin,
    Unless I have misunderstood your question, a 'connection' and a 'session' are the same thing. When you obtain a database connection, you have created a database session. Once you close that connection, the session dies -- it no longer exists. You cannot obtain the same 'session' when you get another database 'connection' (after you closed the first one).
    Hope this answers your question.
    Good Luck,
    Avi.

  • How can I calculate the total time in java?

    Hello!
    I need to calculate the total time!
    For example I have start time:
              Format formatter1;
              Date date1 = new Date();
              formatter1 = new SimpleDateFormat("hh:mm:ss");
              String startTime = formatter1.format(date1);
              //startTime = "14:20:40";
    And I have finish time:
              Format formatter2;
              Date date2 = new Date();
              formatter2 = new SimpleDateFormat("hh:mm:ss");
              String finishTime = formatter2.format(date2);
              //finishTime = "08:30:55";
    So, after manually calculating, I get total time: "18:10:15"
    How can I calculate the total time in java? (Using formatter1 and formatter2 I suppose)
    What I need is to print "total 18:10:15"
    Thanks!

    800512 wrote:
    I did the following but, I think something is wrong here:
    I defined before: Date date1 = new Date(); Date date2 = new Date();
    And it should be exactly 5 seconds between them.
    I found delta between date1 and date2:
    Format formatter = new SimpleDateFormat("HH:mm:ss");
              long timeInMilliFromStart = date1.getTime() - date2.getTime() ;
              Date date3 = new Date(timeInMilliFromStart);
              String timeInSecFromStart = formatter.format(date3);
    and I get always
    //timeInSecFromStart = 02:00:05
    But it should be exactly 00:00:05.
    What can be a problem?Because, like I said, a Date measure an instant in time, not a duration. So when you have 5000 ms, and you turn that into a Date, that means 5 sec. after the epoch, which works out to 1/1/1970 00:00:05.000 GMT.
    As I mentioned, if you're not currently in GMT, then you have to set the TZ of the DateFormat to GMT. Right now, it's showing you the time in your TZ. If you included the date in your SimpleDateFormat, you'd see either 1/1/1970 or 12/31/1969, depending on which TZ you're in.
    Bottom line: You're trying to use these classes in a way they're not meant for, and while you can get the results you want for a limited set of inputs if you understand what these classes do and how to work with that, it's a brittle approach and comes with all kinds of caveats.

  • How can I activate the Billing Timer icons in MacFreeLance 3.13? They are "grayed out" and unresponsive. MacXware Support Suite has not provided a solution.

    How can I activate the Billing Timer icons (Go, Pause, Stop)
    in MacFreeLance 3.13? They are "grayed out" and unresponsive. MacXware Support Suite has not provided a solution.

    Lack of support from that company seems to be a non-uncommon problem. But it's not a problem you will be likely to get help with in the Communities, and definitely not here in the "Using Apple Support Communities" forum which is for questions about the Communities themselves. If MacWare can't or won't help you, you may be stuck, though there was an email address posted in this thread:
    http://www.facebook.com/Macware/posts/327848817260562?comment_id=4108331
    that may get you a response.
    Regards.

  • How can i get the same itunes library on 2 macs

    how can i get the same itunes library on two different macs, without having to pay for icloud please.

    Copy everything from one computer to the other.

Maybe you are looking for

  • How do I get my gallery photo pages in iweb to publish on my site ?

    HI I have recently upgraded to iweb 09 from iweb o6. I have also upgraded from tiger to snow leopard and now have a terabite size hard drive. Iweb was working great before , but now i cannot get my website to upload correctly using ftp fetch. fetch i

  • Transport service does not start automatically after upgrade to exchange 2010 SP2 from Exchange 2010 SP1

    Hi, I am trying to upgrade Exchange 2010 SP2 from SP1, but Transport service does not start automatically. Tried manually start services, it started successfully but again goes down within few seconds automatically. Reboot server. but no luck. Any he

  • Capturing media on a laptop with only one firewire input

    So, this question may or may not belong here: I have a MacBook Pro with its single Firewire port. I have an external firewire drive for my scratch disk. But how do I capture media from my tape-based Canon HV40 onto the external disk with only the one

  • API to register table/column in the Apps

    Guys, I'm adding several columns to a table and forgot what the API was to register the table and columns so that I can then register DFFs. I'm already very familiar with: fnd_descr_flex_col_usage_pkg.load_row I need the API used to register the tabl

  • Document for PO Approval Wave 2

    Hello, I am configuring Wave 2 Purchase Order Approval. Now I want to plug the app to backend workflow. In  Fiori Document site: I see: Configuration To enable Approve Purchase Orders, you must perform the following configuration task: Specify the wo