01-31-2014 04:00 AM
Hello.
I'm trying to create a hall sensor simulator using the NI USB-6221.
The idea is to have three digital outputs that outputs a digital pulse train according to six different steps.
See the table below.
And it's interesting to have this working at e.g. 5000 RPM's (meaning 2 milliseconds between each step).
My question is, is this even possible with the NI USB-6221?
I tried creating a simple state machine, driving the outputs according to a predefined table. But it became evident that this is much too slow. The NI USB-6221 uses around 10-15 ms to output a digital value from LabVIEW.
Thanks for any ideas on how to do this.
Solved! Go to Solution.
01-31-2014 04:42 AM
01-31-2014 05:37 AM
Hi GerdW.
Thanks for your answer. Can you give some hints on how you would go about doing this then?
Since it has only two counters, I cannot set three generated output signals with 120 degree phase shift.
Are you thinking about creating pulse sequences on three outputs, and looping these?
BR,
Øystein.
02-03-2014 01:46 PM
Looking at the data sheet.
http://sine.ni.com/ds/app/doc/p/id/ds-10/lang/en
Under Digital I/O you can see that the maximum clock rate of the digital lines on Port 0 is 1MHz. This means you can go from a high to a low once every 1 micro second. Your hardware is capable.
The software side of things you need to realize that to change the digital line from a high to a low that quick you will need to be using some kind of timing that doesn't involve Windows. Windows (and other operating systems) aren't deterministic. So instead of being in a loop changing from one state to the other, put in the buffer of the DAQ card a series of digital states, and then tell the DAQ hardware to play them at a specified rate. Then your timing is done by the hardware, not by your software.
Search the example finder for Digital - Continuous Output for an example on how to do this.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
02-04-2014 01:39 AM
Hi Hooovahh.
Thanks for your answer. I found a solution, and you are right, the solution actually was exactly as you suggest.
First setting up a continous counter task to a certain output pin, and then setting up a second task outputting a buffered pattern using the first counter task as hardware timing.
It's then possible to change the "RPM's" of the simulated hall sensor pattern just by real-time changing the frequency of the hardware timing.