LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 Digital Pulses on Different Physical Channels with USB 6211

Hello everyone,


I ran into a problem with digital pulses and would be glad to hear from more experienced users.
I am using USB 6211 and I need to generate 2 digital pulses (TTL 0V - 5V) on two separate physical channels (PFI 4 and PFI 5 would be fine as those are the default outputs for two counters). The shape of these pulses is schematised on the figure below.
The first pulse has LOW IDLE and HIGH state width in the range of 20 ms to 500 ms. The second pulse has HIGH IDLE and should be in its LOW state whenever the first pulse changes the state from HIGH to LOW or from LOW to HIGH. The delay between the 2nd pulse going LOW and 1st pulse going HIGH is in the millisecond range. Both pulses should be retriggerable.
I searched for similar problems on the forum and found an interesting example:

 

Create two pulses using usb 6211

However, in this example both pulses go HIGH and then LOW only once. What I need is that one of the pulses (the 2nd one) goes actually twice HIGH and LOW, ie. what I call 2nd pulse is actually two pulses in the sequence. By playing with the relative delays of those two pulses, their low and high times I could (should) obtain the shape I need.


I tried modifying the above mentioned example and added DAQmx Timing (Implicit) on the second channel (one that should produce 2 pulses, see Figure below and attached vi).  When I put "Sample mode = Finite Samples" and "Samples per Channel = 1" everything behaves as in the original example, ie. two single pulses on PFI 4 and PFI 5. So far so good. I thought that I could obtain two pulses in sequence by just changing the value on "Samples per Channel = 2". Instead of two pulses in sequence on the PFI 5 I obtain the following error:


Error -50103 occurred at DAQmx Start Task.vi:1
Possible reason(s):
The specified resource is reserved. The operation could not be completed as specified.
Task Name: _unnamedTask<3D12> 


I would be happy if someone could help me to sort this out. I guess that loops are not welcomed here as the timings are such that I want to avoid any software timings that would produce jitter and non consistent delays between pulses. If someone get a solution that looks more or less like my example it would be nice as it would be easier for me to integrate it in my (more complex) VI. However I would be glad to see any solution that works (waveforms, digital ports write...).


More generally, I would also like to know the best way of generating multiple digital pulses on different physical channels (PFI 0 to PFI 7 for example), where one pulse could actually be made of a single or multiple LOW-HIGH-LOW (or HIGH-LOW-HIGH) transitions as this is very common task in my field. Is it possible with only two counters or should I use another DAQ card?

 

Thanks in advance.

Download All
0 Kudos
Message 1 of 2
(2,687 Views)

Hello foruc,

 

The error you are seeing is expected, as each part of the card, whether it is Analog Inputs, Digitil lines, or Counters, is regarded as a resource. Therefore if you try to have more than one task for one of these resources you will see this error. As you can observe in the code that was posted on the link you mentioned, there is only one task, and its reference is passed between the two counter channel configurations. Another thing I would do is I would have the error cluster wired through all configurations, first for the primary channel, and then the secondary one, and then pass it through the Start Task VI for the secondary channel and then finally pass it through the primary channel (the one that provides the trigger) as a final step. You need all configurations to be over and done with, and all secondary tacks to have already started before you start the task that will provide the trigger.

 

I hope this will help, try it out and let us know how you get on.

 

Kind Regards,

Michael S.
Applications Engineer
NI UK & Ireland

Message Edited by sahpek on 02-05-2010 11:34 AM
0 Kudos
Message 2 of 2
(2,612 Views)