04-26-2017 11:41 AM
Hi,
I am trying to simulate an edge counter using the Simulated USB-6008 in LabVIEW. In MAX16 I can configure a task "CountEdges" that uses the physical channel DAQ1/ctr0, with PFI0 as the input channel, all on the simulated USB-6008. But unlike the analog input channels, I also have configured in a different task, with return values (a sine wave), I get only a 0 (zero) when I run the task in MAX or LabVIEW. Am I doing something wrong, missing something, or does the simulation not provide anything other that zero?
Usually I have hardware to try my code against, this time ...
Thanks,
04-26-2017 11:53 AM
In my experience, a sine wave is all you'll ever get from simulated devices. Leaves a lot to be desired, doesn't it?
04-26-2017 11:57 AM
Yeah, kind of hoping that the counter would at least give me random numbers or an increasing/decreasing count (like a 1/2 wave sine).
04-26-2017 12:04 PM
Technically, a simulated counter wouldn't give a random number. It should give you a square waveform with the ability to increase/decrease the frequency. It would be your responsibility to count the edges. I've implemented my own very simple simulation VI that is opened up during initialization, if a device is not detected.
04-26-2017 12:07 PM
Well since MAX gave me the option to create a edge counter task against the simulated USB-6008 I had hopes that it would act similarly to the analog inputs in the same simulated 6008, and return a number other than 0.
04-27-2017 03:56 PM
Are you using Square Waveform on the Waveform Generation Palette to simulate?
04-27-2017 03:57 PM
Simulated counters are definitely more limited than simulated analog and digital... Post on ni.com/ideas and maybe the feature will be improved in the future!
04-27-2017 04:45 PM
That simulated counter at least give you confidence that the dev setting are valid. That is something. Values would be nice but don't hold your breath.
04-27-2017 05:24 PM
No, I have not build my own simulation of the counter portion, was hoping that since I could configure a task in MAX for the counter portion of the 6008, like I have for the analog parts, that it would give me a value other than 0. Confirming the device settings isn't helpful, I know this device works, at least in the real world, but it would be nice to work on the code when I can't hook up a real USB-6008 and provide the real world hardware that it is trying to count.
04-27-2017 07:04 PM
Well, today you cannot do that with a simulated counter task. You need simulated counts from another source. Sorry, I didn't write the code though so blame Chris C.