VirtualBench

cancel
Showing results for 
Search instead for 
Did you mean: 

I/O

Solved!
Go to solution

Hi.

I am working with Virtualbench. I want to program the IO's to four input and four outputs. I have tried to watch the example given by NI at:

http://www.ni.com/example/52071/en/

I have tested the example and from how I can see, it works as it defines all io's as output. If I apply any voltage to the inputs, the input Array Indicators does not change. If I remove the Virtualbench.dig.Write.vi in the program, the input array indicators is capable of seeing changes applied to the input channels. However, then all IO's are defined as inputs. I would like to have the inputs defined as above. Is this not possible?

\Morten

0 Kudos
Message 1 of 14
(7,685 Views)

With that example, try changing the "output lines" to only the lines you want to use as outputs (for example, "dig/4:7"). The Dig Write.vi will set the direction of the lines specified "Lines" parameter to be outputs.

——
Brandon Streiff
ni.com/compactdaq · ni.com/daq
0 Kudos
Message 2 of 14
(7,679 Views)

Hi Brandon.

Thanks for your reply. Alread tried that. (seemed obvious:-) I get this error doing that:

 

Error -375904 occurred at VirtualBench.lvlib:Dig Write.vi:3220001

Possible reason(s): NI-VirtualBench: Number of lines to write doesn't match the provided data.

 

I type in this string in output lines: VirtualBench/dig/4:7

and in input lines: VirtualBench/dig/0:3

Any other idears...

 

\Morten.

0 Kudos
Message 3 of 14
(7,675 Views)

You'll need to write an array of size 4 instead of an array of size 8. In the example, the front panel control is an array of size 8 in order to work with the default "dig/0:7" setting.

 

On the front panel "Output Array Control", you can use "Data Operations→Delete Element" from the right-click menu to remove four of the controls.

——
Brandon Streiff
ni.com/compactdaq · ni.com/daq
0 Kudos
Message 4 of 14
(7,670 Views)

These things I believe i have played arround with... I still cannot make i work... Attached is edited project. Mabye you can have a look.

\Morten

0 Kudos
Message 5 of 14
(7,666 Views)

Sorry...

Forgot to make current settings to default. Attached once again...

0 Kudos
Message 6 of 14
(7,664 Views)

Hi.

I got it to work. After deleting the array it needs to me 'activated' once again. This is done by clicking on the MSB or clicking on every button in the array. Why is this?

\Morten.

0 Kudos
Message 7 of 14
(7,657 Views)
Solution
Accepted by topic author morten.munch

@morten.munch wrote:

Hi.

I got it to work. After deleting the array it needs to me 'activated' once again. This is done by clicking on the MSB or clicking on every button in the array. Why is this?

\Morten.


Beecause the default is an empty array.  Once you have it with 4 elements, save that value as the default (right-click on the array, Data Operations->Save Value As Default).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 8 of 14
(7,649 Views)

I have a write wired to a read and am just trying to have the virtual bench mimic itself.

When I run the program i get: Error -375904 occurred at VirtualBench.lvlib:Dig Write.vi:3220001  Number of lines to write doesn't match the provided data.

I dont understand what is wrong. Also when i select a line on my virtual bench in the example project I get the same error.broken dio.PNG

0 Kudos
Message 9 of 14
(6,987 Views)

looks like your "data" array is an empty array.

 

What determines your loop rate?

0 Kudos
Message 10 of 14
(6,983 Views)