Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

Handshaking On 6025e

I'm using the 6025e board, and I haven't figured out how to use the handshaking mode and when. I saw that Port C is somehow used for this purpose. Anyway, maybe if I described my problem you could advise me if I should use this and how.
Here are the facts:
1. Used channels on the boards are: Port A, Port B. (Cannot be used).
2. My program is supposed to communicate with a tester which sends 3 signals: test starts, test has ended and Pass/Fail - the test outcome.
3. After receiving the "test ended" signal, the computer should:
                    a. read in the Pass/Fail result.
                    b. move a stage one step.
                    c. send back a signal to the tester which will say that the next test is okay to begin.
What approach should I use ? should it be handshaking ? if so, what connections should I make and programming ? or maybe I should use a retriggable data acquisition, when the "test ended" signal is my trigger and after each trigger I should read the test result, move the stage and then send the output signal to tester through one of my counters ? If so, I need somehow to merge the 2 channels - reading the result on the trigger and a bit later to send out a trigger.... what am I to do ?
0 Kudos
Message 1 of 8

Hi Mic-Scale,

This is a complex application. I think that performing an analog input operation with an analog level trigger along with a retriggerable pulse train application is your best bet.

So, your pass/fail signal will come in and will trigger an analog input operation which will acquire a finite amount of points. From there, read those points finite points and determine if it is pass/fail.

The original signal will also trigger a retriggerable pulse train for one of your counters. You will need a delay in this part of the application to allow time for determining if the analog input was pass/fail. This retriggerable pulse can be used as the signal to both move the stage and as the signal back to the tester to begin the next test.

There are a couple of examples that will help you get started. I recommend taking a look at these 2:

NI-DAQmx: Acquire Analog Input Data Using a Hardware Analog Trigger

In LabVIEW >> Help >> Find Examples >> Hardware Input and Output >> DAQmx >> Generate Digital Pulses >> Generate Digital Pulse Train Finite Retriggerable.

I hope that this information helps you with this application.

Hal L.

0 Kudos
Message 2 of 8

Hi Hal, thank you very much for replying.

According to what you suggest:

1. Shouldn't the analog input operation be retriggerable aslo ? For every analog reading, there should be a response back to the tester, and if the pulse is retriggerable, so is the analog input...

2. How do I take care of the stage move part ? I did not entirely understand where it should be placed (as a next frame in a sequence structure after reading an analog sample ?)

3. I need to make sure that the pulse is sent back to the tester only after the analog read in has been done and the stage being moved one step. Therefore, I cannot tie the stage and the back pulse together, can I ? I understand that you suggest to use a constant delay for sending the pulse back, so those 2 actions would have time to be completed. But in case the stage fails to stabilize within this delay time, can I make the pulse wait somehow ?

4. You said that I should use one of the counters of the 6025E as the pulse output. Is it possible to use other ways to output this singal, regarding the needs of our program ? (via Serial port, Usb, other 6025E channels or any other ways )?

5. Before I've read your answer, I've built an application, but used only one trigger for both tasks - the analog read in and the pulse out (I've used the sequence structure to make sure one is executed after another. I've left the stage part frame empty at this time). I ran the program but instead of receiving a pulse after each trigger, the pulse was at a very low fixed frequency of about 10 Hz, although the trigger was at 20Hz - 1kHz. I'm attaching this vi, I would be very thankful if you could please take a glance.

Thank you very very much.

0 Kudos
Message 3 of 8


I looked into this a bit further and it turns out that the 6025E does not support analog triggering. So you will need to use a digital trigger for your analog input operation. There are two ways to make this retriggerable:

1. use a counter for a retriggerable pulse train as the clock
2. Modify the " Acquire & Graph Voltage - Internal Clock - Hardware Trigger Restarts example to use a digital trigger.

I think that using a sequence structure is a good idea for separating the stage 1 step and sending the signal back to the tester. You can still use a retriggerable counter for one of these signals. You could use a digital output line for the other signal, but then you need to develop a way to trigger this at a later time based on then when the step is completed. Also, if you want to use other hardware (serial, usb, etc) for other parts of this application, then that will be fine. Finally, I took a quick glance at your code and it looks like you are off to a good start.

Hal L.

0 Kudos
Message 4 of 8
Hello Hal,
I've already built another retriggerable video scanning program for my board and it includes both retriggerable pulse train and analog input, as you mentioned. This time my problem is how to make the back pulse track the input pulse. I've sent you the code because it does not work well (the back pulse falls behind all the time, it is actually generated at its own constant rate). I was hoping you could maybe find out what my problem with the code might be.
By the way, I made sure that the counter is able to produce very high rate pulses when it works alone ( I guess my problem is because of misusing the analog input and the back pulse together in this code).
About the other ways to output the signal - I was told that the common digital outputs in the 6025E are static and cannot be used to output pulses, is it wrong ?
Suppose I would like to use the serial or the usb port in my application, can you please show me how I can use it for this purpose (being able to send pulses on the fly according to the incoming trigger, maybe a source code or a document) ?
Thank you very much.
0 Kudos
Message 5 of 8

Hi Mic_Scale,

I am little unclear as to what you are getting at here with respect to the back pulse and I didn't see any code attached. If you post it, I can take a quick look, but I can't make any guarentees that I will find anything. This will also give some other users a chance to look at it and maybe one of them will notice some things as well.

With regard to the digital output on the 6025E, you can set the line to high and then use the DAQmx Tristate Property to drive the line to a state of high impedance (neither high or low) and that could function as your output pulse. Otherwise, you could simply output the line to high and immediately output it to low again.

What other USB/Serial hardware do you have available for this application? I can't really say what is possible without knowing what equipment you have.


Hal L.

0 Kudos
Message 6 of 8

Hello Hal,

I'm sorry if I was not clear enough about the program.

What I'm trying to do now is basically a program which does the following:

receives a trigger - then reads an analog sample (only one sample for the matter) and then outputs a trigger back.


The code, I'm attaching now, is a program which was built by me to do just this. Only, the problem is that it does not work properly - somehow the output trigger does not follow the input trigger. The output triggers are always sent with the same frequency (10 Hz) no matter how high the frequency of the input triggers.

Any help would be highly appreciated.

0 Kudos
Message 7 of 8

The code looks like it will do what you are looking to accomplish.  The only thing that I would really change would be what you have already noted.  The application will not immediately move to the part of the program where you output the counter pulse until all of the analog samples have been acquired.  In this case you are sampling 1000 samples at a rate of 1000 Hz.  That means you will have to wait 1 second for new samples to be acquired.

Simply change this to 1 Sample acquisition and you should do just fine.  I've attached the changed code.  Granted there are a few things that could be done to try to optimize the code further if you really want to, but it looks like this will work.

Matt Otis
0 Kudos
Message 8 of 8