Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

6503

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
Download All
0 Kudos
Message 1 of 4
(3,780 Views)
Hello J,

Are you testing this with a real device or are you testing with a simulated device?

Regards,
  Sandra T.

Applications Engineer | National Instruments
0 Kudos
Message 2 of 4
(3,770 Views)
Hi Sandra
 
Thanks for the reply.
 
I am using simulated PCI 6503 card.
 
Regards
J
0 Kudos
Message 3 of 4
(3,766 Views)
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

NI-DAQmx Simulated Devices

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,
  Sandra T.

Application Engineer | National Instruments
0 Kudos
Message 4 of 4
(3,744 Views)