‎04-08-2021 02:18 PM
My objective is to generate a continuous pulse train using a counter, and then output that signal to an oscilloscope. The bottom piece of the code (i.e. the read digital waveform function & graph indicator) was added as an effort to troubleshoot why I am unable to see the signal on 'scope.
Without the bottom piece of code, the software runs without throwing any errors; but sends no output to the 'scope. With the graph indicator implemented in code, I get Error-200460.
1. Would appreciate some help understanding why the pulse train signal isn't displaying on the 'scope. I re-checked the hardware terminals, and even tried different output channels for each counter. My guess is that the Start Trigger channel isn't receiving any input signal, but none of my different approaches has fixed the problem.
2. Can you help me understand why Error-200460 (read failed because there are no channels in this task) shows up when I try to output the signal to a Waveform indicator on the front panel?
Thank you.
‎04-08-2021 02:44 PM - edited ‎04-08-2021 02:50 PM
Hello,
First of all, remove or disable the read part of your diagram. And try to place a breakpoint on the task wire between Start and Stop. Then run the VI and check what you are generating something while the breakpoint is active.
In your code, your are starting and then immediatly stopping your counter task. So your signal has no time to be continuously generated. I think that's why you do not see anything as output.
Pick a look on the example Counter - Continuous Output.vi (in LabVIEW menu Help » Find Examples... and then under Hardware Input and Output » DAQmx » Counter Output). Here is a snippet:
Counter - Continuous Output.vi
Note that the while loop just check if the task has no error, and waits for a user action on Stop button to actually stop the task. Try this example, and then adapt it in your own code.
About the error, you are trying to read digital data from a counter task: DAQmx does not work like this. You need a Digital Input task to use Digital Waveform polymorphic instance of the DAQmx Read function. Using Counter Output, you can use one of the Counter polymorphic instance of the DAQmx Write function.
Hope this helps,
‎04-09-2021 10:26 AM
Further, if you aren't sure you're getting a triggering signal at PFI36, temporarily bypass the start trigger config. (Just put a case structure around it, and be sure to wire task and error straight across the other case.)
-Kevin P