08-28-2006 01:28 PM
08-29-2006 01:07 PM
Hello Glen,
Every time a session (analog or digital) is started with a simulated board the data begins at an initial state. For digital ports, all lines will be low. You should be able to carry the current 'count' through multiple VI levels (sub VIs) without restarting at zero.
If you open the example "Read Dig Port.vi" under Help>>Find Examples you can test a few cases to see how the simulated device reacts:
1) If you run and stop, run and stop you will notice that each time the data begins at zero.
2) If you move the start and place a stop task into the loop, the data will continue to count up (within a single run). The data returns to zero when the task is cleared and a new task is created.
3) Create a blank VI and place a DAQmx Read inside. Create controls/indicators for the task in, task out and data. Add each of them to the connector pane and drag this VI as a sub-VI in the example. Place it in the loop between the read and the stop task (or the loop output if the stop is no longer there). You will notice that the values returned are consecutive. If the main VI reads 1, the sub VI will read 2, followed by 3 and 4 respectively in the following loop iteration.
I am guessing the reset is somehow happening in your code. If you cannot diagnose it with the above information, perhaps you could post a simplified version of your code which demonstrates the reset.
Hopefully this helps,
Jennifer O.
08-29-2006 01:24 PM