I am having problem with changing default values!
I right-clicked on the constant and chose Make the current value default but it seems it doesnt work.
I am having problem with changing default values!
I right-clicked on the constant and chose Make the current value default but it seems it doesnt work.
I’m not sure what your talking about maybe take a screenshot. What I think is happening is that you need to put a constant coming off of whatever port your using.
The problem is when I have 2 victors in the code and I want one of them to be connected to Pwm port 5 and the other to Pwm port 6. What happens in the code is instead taking the values I ve given to the Motors Pwm ports it takes the default values and because of that I should make the constant or control value I ve given the default value. ı thought ı could just make it by right clicking on the value and choosing data operation and then make the cureent value as default.
It seems when I run the code I couldnt do that because just one of the motors works!
Your description doesn’t seem to be giving us enough information. Can you attach a copy of your vi, or at least show us a picture of your program so we can look at it?
This is the begin.vi of my code.
I double click on one of the victors and change its PWM channel and set that as the default value from that window. Also the other victors PWM default value changes. How can I solve this problem.
Begin.vi (31.5 KB)
Begin.vi (31.5 KB)
I only see one victor open in the begin.vi you posted. Maybe that’s why only one victor works.
Sorry I uploaded the wrong code! We figured out that one of the victors was burnt out.
Your code looks perfect. There’s no reason to make the values “default”, wiring up constants is fine.
(You might want to have your motor names be more description than “motora” though)
This is because these vi’s are not reentrant. For a more detailed explanation of reentrant behaviour, start here: LabVIEW Wiki
What you need to do is set these values to constants in your Begin.vi, in the same manner that the Default Framework does.
Oh! Thanks, David, now I see what he’s talking about.
To change the PWM channel assigned to a Victor, you don’t mess with anything inside the Motor Open vi. You change the value of the constant wired to its PWM channel input terminal. Hover the cursor over the constant until it turns into a hand icon, then you can use the constant as a popup menu and select the channel you want to use.
As a general rule, you should never be changing anything inside the library VI functions.
This is a good quote.
And FYI, this was the clue.