LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pulses with USB 6501

Hello,

 

I am doing an application in Labview using USB 6501. To develop the project I have used the virtual instrument USB-6501 Interactive Control.vi. However, what I need to do is receiving and sending pulses of a width of around 5 ms. The shortest pulse I have got at the moment is 250 ms approximately. In the data sheet is said that the minimum high and low pulse width is 100 ns, so it should be no problem. I assume that the error must be in my program, so the question is:

Is there any VI to send pulses of a determined period of time? And if there isn’t, what should I change of the main program to get the desired pulse? Or is it possible that the program causes a delay longer than the width of the pulse?

I hope you can solve my doubts.

Thanks in advance

Vicente

0 Kudos
Message 1 of 9
(4,360 Views)

Hello Vicente

I had a quick look at the 6501 data sheet to see where you got the 100ns -> this is the shortest pulse that the onboard counter can COUNT and unfortunately counting seems to be the only operation mode of the counter that is supported on this very low price entry level product.

The more powerful devices like USB-6210 etc. support various counter modes like "single pulse" or "pulse train generation" which is probably what you are looking for.

Nevertheless: if you are using LabView it should still be possible to create pulses in the order of a few milliseconds although this is near the limit of what makes sense to do under Windows. Just set and re-set any of your DIOs and put a Wait (5ms) in between. Depending on your CPU power, you will experience quite heavy jitter on your pulses - this is from the Windows-OS (and would practically disappear if you were using LabView RT instead ...).

You could use the "Write Dig Chan.vi" from the LabView Examples as an good starting point.

Keep trying

😉 HU

 

 

0 Kudos
Message 2 of 9
(4,349 Views)

Hi Hurban,

Thanks for your advise. It seems to be a good idea to set and reset the outputs, but how can I get it? In the front panel I don't have that option and in the block diagram I haven't found the place where I should do the changes.

Regards

Vicente

0 Kudos
Message 3 of 9
(4,336 Views)
Hi,
 
attached find an extremely simple LabView example.
 
The code produces a 5 ms Pulse at a 50Hz rate.
 
Just out of curiosity I tried it out:
- on my Windows system the jitter is approx. +/- 2 ms
- on LabView RT the jitter is far below  1 microsecond
 
🙂 HU
0 Kudos
Message 4 of 9
(4,329 Views)

Hi Hurban,

I have tried to open your example but I can't because I have version 8.0 and the example is in version 8.2. I don't know if it is possible but can you save it in a previous version?Thanks

Regards

Vicente

0 Kudos
Message 5 of 9
(4,240 Views)

Here is 8.0

🙂 HU

0 Kudos
Message 6 of 9
(4,223 Views)

Hi Hurban,

 

Thanks for your example; it is very similar to what I am trying to do. In fact, it uses the same Sub-Vis that my program. However, I think I can’t write simply TRUE and 5 ms later FALSE, because I need to choose exactly the signal that must be changed. I would like to modify the EOT signal, that it’s in pin 15, P2.1. I attach you the original program and all I changed to get my purpose. In the original program there are four Sub-Vis that are the same. I wrote them separately because I will need to change only some signals.

So, could you have a look at the programs? Any possible solution to do it faster?

Thank you very much for your help.

 

Vicente

Download All
0 Kudos
Message 7 of 9
(4,002 Views)
Hi Vicen,
 
I've taken a look at your code and it looks like it can be optimized a lot.  Just wondering, is there a reason why you're using DAQmx Base and not DAQmx? It looks like you are opening and closing your tasks several times in one iteration of your main while loop, while it would be more efficient if you wrote/read to/from all channels at the same time without creating/closing a new task for every port.
 
Regards,
Way S. 
0 Kudos
Message 8 of 9
(3,917 Views)

Hi,

Thanks for your suggestions. There isn't any particular reason for using DAQmx Base, I don't know if it matters. I have created four tasks because the original example had four Sub-VIs with identical content. At the moment I have a new version, where I can get a pulse of only 30 ms, although the aim continues being 5 ms. I know it is very untidy and it can be more efficient. However, the delay I think it is not caused by the different opening and closing tasks. Because, if I open one or four Sub-Vis I have the same delay: 30 ms.

PICTURE

To get the pulse I need to change a couple of things. On one side, we need to write to the cluster the new parameters, that is something I can change with the EOT button . On the other hand, we also need to change the input of the ‘Write VI’.

This is the quickest version I have got. However, I don’t know if it might be improved. I think the solution must be inside the Vis that I’m showing in the picture, but I don’t know what should I change. Does anybody have any idea?

Thanks in advance

Download All
0 Kudos
Message 9 of 9
(3,824 Views)