LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How does digital I/O simulation work


Dug and looked but not finding how the digital I/O simulation of a board really works. (PCI-6229 in V8.0)

A simple example works fine (DIs toggle as 8-bit ports count up) but when I try to go across more than one VI level the base VI reports the initial condition (all 0 or false) repeatedly. Make the demonstration pretty boring and hard to tell what's working and not.

Tips, advice or references appreciated.

0 Kudos
Message 1 of 3
(2,718 Views)

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.

0 Kudos
Message 2 of 3
(2,690 Views)
Thanks, Jennifer.

I figured it *should* work but somehow it's not behaving. I'll look for something that might be reseting the data. I effected a work-around by looping on the reads a random number of times. Gets the data twinkling.

0 Kudos
Message 3 of 3
(2,685 Views)