ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA resource Board Type default value

Hi,

I am using an Arduino Mega 2560. Everytime I open Labview I have to change the Board Type from 'Uno' to 'Mega 2560' in de VISA resource.

This is a lot of work, because I have to change it in every low level analog/digital read/write block. I tried to change te default value in some of the case statements, but this isn't working.

Does someone know how to change the general default value in 'Mega 2560'?

I hope someone can help me. 

0 Kudos
Message 1 of 4
(5,548 Views)

On the block diagram you can right-click on the board type wiring wiring terminal and select create->constant. Change the constant to Mega and save your work.

If you need a front panel control then right-click on the board type wiring terminal and select create->control. Go to the front panel and change the control to the Mega. Right-click on the front panel control and select data operations->make current value default. Save your work and enjoy the result. (you should also update the label for the control! Uno is no longer the default).

Cheers

VI snippet.png

0 Kudos
Message 2 of 4
(3,987 Views)

Drog, thanks for your help, I appreciate it!

Unfortunately I don't think this is the solution, as in all of the read/write blocks for the pins the Board Type is still set to 'Uno'. Also I tried to change the default value in the Init.vi file, but that didn't help either.

But when I select 'Mega2560' in all the blocks, I still can't use analog pin numbers higher than 5 so maybe something else is wrong?

0 Kudos
Message 3 of 4
(3,987 Views)

-Martijn-

You should never have to enter every sub VI to change the board type.  When you specify a board type in the init VI that information will be passed along in the 'Arduino Resource' cluster.

Can you post your code so we can take a look at it?  I checked the code that checks to make sure the pin you specified exists, and it should support analog inputs 0-8.  It looks like we should update this to allow AI0-AI15.

-Sam K

0 Kudos
Message 4 of 4
(3,987 Views)