LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set control default values programmatically (arduino distribution)

Solved!
Go to solution

So I know this has been discussed before but I have a unique situation.  I will be downloading code to Arduinos using the Labview Compiler for Arduino toolkit.  I would like to programmatically set some default control values on each Arduino using a Labview GUI.  The Arduino toolkit I am using has a compile VI that takes a VI, compiles it, and then downloads it to the Arduino.  How can I change the default value for the VI's controls before it's compiled and downloaded?

0 Kudos
Message 1 of 11
(8,729 Views)

If it is a LabVIEW VI, set the Controls as you want them to be, right-click the Edit Menu (while viewing the Front Panel), and choose "Make Current Values Default".  Note that if you've selected a Control, the message will read "Make Selected Values Default".

 

Bob Schor

0 Kudos
Message 2 of 11
(8,713 Views)

Thanks but I want to do this programmatically without having to open the VI.  I will have a GUI that will download the program to multiple Arduinos and the control values will be different for each one.

0 Kudos
Message 3 of 11
(8,697 Views)
Solution
Accepted by NiAchilles

Have you tried using property nodes to set the values and then method nodes to "make current default" and save the VI?

1.jpg

Message 4 of 11
(8,687 Views)

That worked!!  You rule.  I had to add an error handler because I kept getting an error message from the Set Values as Default block saying that the target VI was not in edit mode, even though it was.  Anyway it set the control default values successfully so I just ignore the error.  Thanks for the help!

0 Kudos
Message 5 of 11
(8,653 Views)

Not sure why you would be getting that error, but I'm glad it's working for you. And since we're on the subject, a simpler alternative way is to use the Ctrl Val.Set method:

 

1.jpg

0 Kudos
Message 6 of 11
(8,635 Views)

Hi to all,

       I don't know why i get the error message like "vi is not in edit mode"?, cn you explain me this? and also is that possible to visualise the modified values in user panel? bcoz everytime i need to see the values befor i set in the user panel

0 Kudos
Message 7 of 11
(7,804 Views)

hi paulrobinson,

 

Are you running the program and getting the error using the example program linked earlier to this post?

 

Since this forum hasn't been active for 2 years and a solution has been marked, I would recommend you starting a new post to get more insight on what you are seeing! 

 

best,

Cici Z.

Applications Engineer

National Instruments

0 Kudos
Message 8 of 11
(7,791 Views)

Hi cici.z,

      First of all thanks for your reply, and i got a slution for this problem by using get and set values.

 

 

Regards,

paul

0 Kudos
Message 9 of 11
(7,774 Views)

Hi cici, 

       Here i have attached a vi to read and write the data in a same ini. file but when i write the data in a same section it is not appending instead of that it creating a new section how can i do this part?

Regards,

Paul

0 Kudos
Message 10 of 11
(7,739 Views)