Discussion:
6503
(too old to reply)
can we generate frequency using counters . if so then what is the range and resolution.
2007-05-09 14:40:17 UTC
Permalink
Hi All
 
i am using PCI 6503 card.
 
I have to read one digital line of a digital port. Assume Port 0 line 0. I have made two VIs. In one vi i am reading digital line  without using While loop but with using RUN CONTINUOUSLY button on the toolbar .But i am not able to read that line.
 
& In another VI , I am reading the same line but using while loop. i am able to read that line.
 
could any body tell me what is the reason behind it ?
 
Thanks
J


with while loop.vi:
http://forums.ni.com/attachments/ni/70/6831/1/with while loop.vi


without while loop.vi:
http://forums.ni.com/attachments/ni/70/6831/2/without while loop.vi
can we generate frequency using counters . if so then what is the range and resolution.
2007-05-11 04:10:12 UTC
Permalink
Hi Sandra
 
Thanks for the reply.
 
I am using simulated PCI 6503 card.
 
Regards
J
Sandra T
2007-05-14 13:40:12 UTC
Permalink
Hello J,

I see that you are using a simulated device. There are some caveats of using a
simulated device. Take a look at the following link to

<a href="http://zone.ni.com/devzone/cda/tut/p/id/3698#toc2" target="_blank">NI-DAQmx Simulated
Devices</a>

With digital reads with simulated devices, the data is returned as if each
8-bit port were counting up. When you run the code with the while loop, you
will see this. If you just run the code with the run continuous, it is actually
initializing, arming reading and then cleared ever single time, so it really
doesn't count up. It is as if you reset the counter every time.

Running the code continuously, is bad programming practice, because you are
wasting processing resources. If you use a while loop it will only create the
channel, arm and clear task once.

I hope this clarifies some of your questions.

Regards,&nbsp; Sandra T.Application Engineer | National Instruments
Continue reading on narkive:
Loading...