Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

CO Pulse Ticks waveform

Hello,

 

I am using an NI USB-6353 and Labview 2013. I would like to be able to use the CO Pulse Ticks along with the Start Digital Edge functions in order to create a digital waveform graph. My hope is to create a graph that spits out 0s until the edge is triggered, waits for the specified initial delay, completes the specified number of "high ticks" (1s), and then returns to 0s. All I want and need is one pulse. 

 

The code attached already works for what I need it to do and I'm assuming I need to add to it in order to get what I want. Again, I would just like to be able to display a graph on the front panel that displays 0s for low ticks and 1s for high ticks according to the CO Pulse Ticks (with time as the x axis).

 

Any advice would be much appreciated.

 

Cheers

0 Kudos
Message 1 of 6
(6,128 Views)

Hey MUengineer,

 

So if I understand you correctly, you would basically like to see the output of the code that you have attached on a graph?

 

If so, you should be able to create a Digital Input task and read that PFI2 line to see the output. That should give you 0s until the ticks are generated, and then show you whenever the edge happens.

 

Does this sound like what you're trying to do?

Ty Prather
Technical Marketing Specialist
National Instruments
0 Kudos
Message 2 of 6
(6,101 Views)

Thanks for the reply Ty P.

 

I'm afraid I'm still having trouble. I should have mentioned that I'm still pretty new to Labview. The picture I posted is someone else's code and I'm trying to make improvements to it. If you could be a little more specific in which order and which types of functions and indicators to use that would be great. Remember pictures are worth a thousand words!

 

Thanks,

MU

0 Kudos
Message 3 of 6
(6,034 Views)

Hey MU,

 

No problem. We try not to just write and provide code solutions via the forums, but there are actually a few good examples of this already included in LabVIEW. If you open the Example Finder, you should be able to find an example called "Digital - Continuous Input" that would be a good starting point for acquiring digital signals.

 

If you look at the USB-6353 Specifications sheet, you can see on Page 16 that PFI12 is the same as Port2 line4. So reading on Port2 line4 would let you see the output of your counter task. (Here is the specifications sheet: http://www.ni.com/pdf/manuals/370787b.pdf)

 

Does this make sense?

Ty Prather
Technical Marketing Specialist
National Instruments
0 Kudos
Message 4 of 6
(6,010 Views)

Ty P,

 

I'm not sure I understand the difference between a PFI and it's corresponding port/line. Is it that one is an input and the other an output?

 

I've played around with the example and made a few changes to my code. I think what I'm trying to do is slightly different though. Currently, my code will trigger a solid state relay (connected to PFI 1) to make the LED light up for the specified pulse when an analog input voltage reaches a certain level. In addition to seeing the LED in the SSR light up, I'd like to display a digital waveform on the front panel with the exact same pulse.

 

Below, Capture2 is an updated version of my code. It gives the error code displayed in Capture3. I guess my question is why is this error occuring and how can I tell it to read the channel. I thought that I was telling it to read PFI 1 by using the Channel Node. Also I thought the CO Pulse Ticks was supposed to create a channel? This seems like it should be a simple fix but maybe not.

 

Thanks for your help,

MU

 

Download All
0 Kudos
Message 5 of 6
(5,989 Views)

MU,

 

The error you're seeing is due to the fact that you're using a Counter Output task and trying to use a Read vi. Outputs must use write VIs, inputs must use read VIs (in general). 

 

There area few ways to do this in software, but if you really do just want to read the counter output, you just need to tie PFI1 to another PFI line and then use a digital read on that line. I was mistaken earlier when I told you to read the same pin that you were outputting to. I tested this and it gives a resource reserved error for that pin. You can solve that by just connecting PFI1 physically to another pin and reading that one.

 

As far as the difference between PFI and Port/Line, there is no physical difference, it's just the naming scheme.

Ty Prather
Technical Marketing Specialist
National Instruments
0 Kudos
Message 6 of 6
(5,968 Views)