07-19-2005 01:07 PM
07-20-2005 02:57 PM
Hi Phil-
It sounds like you're running into some issues with programming for DIO on your board. I'm not sure what would cause you to read all "high" values after a time, but you are probably correct that it is a timing issue.
Your E Series card does not feature correlated (i.e. hardware-timed) DIO like M Series cards do, so exact synchronization will not be possible. The best method to make sure you are reading the ports in order is to combine programming as illustrated in the NI-DAQmx Examples in the "C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital" directory of your hard drive.
If you look at the "Generate Values" and "Read Values" folders you will find "Write Dig Chan" and "Read Dig Chan" examples, respectively. By combining the programming flows of these examples you should be able to achieve the results you describe. The program flow should be as follows:
Keep in mind that when creating channels that do not comprise complete ports you will need to specify the channel names as "Dev1/port0/lines0:5" and "Dev1/port0/line6" for the two tasks.
You should be able to see better results with this setup. Please let us know if you need more suggestions.
I hope this helps-
07-20-2005 05:46 PM
07-21-2005 08:44 AM
07-21-2005 12:56 PM
Hi Phil-
It sounds like you are actually running into a programming problem. My reason for saying this is that if a task is running on the card you will not be able to monitor the lines in MAX test panels- an error will be thrown by the test panel that amounts to a "resource is reserved" error. This is the text I got when running my application during an attempt to view the test panels:
Error -200587 occurred at Test Panel
Possible Reason(s):
Requested operation could not be performed, because the specified digital lines are either reserved or the device is not present in NI-DAQmx. It is possible that these lines are reserved by another task, the device is being used through the Traditional NI-DAQ interface, or the device is being reset.
If you are using these lines with another task, wait for the task to complete. If you are using the device through the Traditional NI-DAQ interface, and you want to use it with NI-DAQmx, reset (initialize) the device using the Traditional NI-DAQ interface. If you are resetting the device, wait for the reset to finish.
Device: Dev1
So it is beginning to sound like your application is terminating the DAQmx task earlier than expected for an unknown reason. This also explains why the values would update for a while (during the task actually running) and then stop updating. Please take another look at your code or post a small portion of it that is easy to understand and that illustrates the problem.
I hope this helps-
07-22-2005 10:47 AM