Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Updating numeric Control with different values with array function

Solved!
Go to solution

Hi ,

I have attached my basic code . I want to run the code for 2 sets of numeric control values with a delay in between and loop it. Something like this

 

abc

Initialize P1=10; P2=20;P3=30;P4=40

Run the code

delay = 10ms

Update P1=150; P2=200;P3=350;P4=500

Run the code

jump to abc

 

I am stuck how to update the values of P1,P2,P3,P4 ? I thought of using a array function but couldn't go further .

 

Thanks for the help,

Ana 

 

0 Kudos
Message 1 of 8
(7,153 Views)
Solution
Accepted by Sshenoy

Hello Ana,

 

One way you could achieve what you are looking for is by using property nodes. These Property nodes will allow you to change control values from the block diagram. You could set up a case structure inside of your while loop that will change the control value via property nodes after a certain number of iterations. Here is a community example that shows how to use property nodes to change boolean controls:

 

https://decibel.ni.com/content/docs/DOC-22669

 

-Erik S

0 Kudos
Message 2 of 8
(7,136 Views)

Hi Erik,

Thanks for your reply. I am trying to use the property node -> value. I am still not sure how to write values to it. Would you be having some simple example for me ?

 

Thanks,

Sahana

0 Kudos
Message 3 of 8
(7,127 Views)

Please correct me. I am still stuck.

Download All
0 Kudos
Message 4 of 8
(7,113 Views)

Got it working 🙂

0 Kudos
Message 5 of 8
(7,097 Views)

Hi,

I am not sure what is the best method to update numeric control P1, P2 , P3, P4 multiple times? I have used property nodes when I had only few values to send. How can I send 4*50 array.  

 

I am using Dynamixel MX 64 servos in my project. I have 4 of them tied in series. P1,P2,P3, P4 represents degree rotation of each servo/axis. Trying to pass multiple set of values to these variables. 

 

Really appreciate your help!

 

Thanks,

Sahana

0 Kudos
Message 6 of 8
(6,903 Views)

Hi Sahana,

 

Instead of using Property Nodes here, you may want to simply index the array of values with a for loop. Here is a Community Example that explains this functionality a bit further:

 

https://decibel.ni.com/content/docs/DOC-20828

 

-Erik S

0 Kudos
Message 7 of 8
(6,869 Views)

Thanks Erik !

0 Kudos
Message 8 of 8
(6,833 Views)