2 Different scripts

6 years 9 months ago - 6 years 9 months ago #29532226 by alptekinarslan
2 Different scripts was created by alptekinarslan
Hello,
I have an MDC 1460.

I want to use 2 different scripts ;
-First one will be used to read counter value of an encoder and set minimum and maximum travel limits for the motor.
-Second one must delete these previously set travel limits,or reset default factory counter values.

I want to assign 2 different RC switches(so 2 different Pulse In ) to run these 2 different scripts.
( If pulse in does not do the work I can connect 2 RC switches to Digitial inputs and trigger to run a script, I guess)

So, my questions are;
Is it possible to store 2 different scripts into the controller? and then run them by a different pulse in? or should I use DINs? If yes, how can I store and then call/run 2 different scripts by an RC command or DIN? is it explained in manual? I red almost all pages about microscripting but couldn't find it.

Second important question: I am using an encoder, and;
There are 6 pulse in inside MDC 1460, the datasheet says

"Note1: Encoder input requires RC inputs 3, 4, 5 and 6 to be disabled. Encoders are enabled in factory default."

Is there any way of utilizing all RC inputs while using an ENCODER? The encoder occupies pin 10 and 15 which are also used for RC 5 and RC 6, but what about RC3 and RC4? Can I still use them? I want to use them.

Appreciate your help.

Please Log in or Create an account to join the conversation.

6 years 9 months ago #29532228 by blake
Replied by blake on topic 2 Different scripts
Hello,

Yes what you have described is absolutely possible. You do not use two different microbasic scripts it would all be in a single microbasic script and then separated into blocks, see "GoTo" and "GoSub" statement blocks in our User Manual on page 152.
Then you simply tell your program to go to whichever block you choose based on the logic.

When an encoder is being used then RC5/6, ANA5/6 and DIN5/6 cannot be used at the same time and must be disabled. The logic pins are shared and only one input type can be used on a single pin at a time. In the datasheet the note you are referring to, Note 2, is actually a typo. Only RC inputs 5 and 6 need to be disabled when an encoder is being used. RC inputs 3 and 4 can still be used.
The following user(s) said Thank You: alptekinarslan

Please Log in or Create an account to join the conversation.

6 years 9 months ago #29532229 by alptekinarslan
Replied by alptekinarslan on topic 2 Different scripts
Hello,

Thank you very much for your quick response. I'll try it now.

Please Log in or Create an account to join the conversation.

6 years 9 months ago #29532245 by alptekinarslan
Replied by alptekinarslan on topic 2 Different scripts
Hello,

I enabled Pulse in 1,2,3 and pulse in 4, and they are connected to the channels on my radio control, at the same time encoder is connected to pin 10 and pin 15,and so pulse in 5 and pulse in 6 are disabled. But in this configuration all RC channels works and I can see the changes on Roborun software. However the encoder doesn't work.Please see the pictures also.
So do you have any idea about where I have the mistake?

Thank you.
Attachments:

Please Log in or Create an account to join the conversation.

6 years 9 months ago #29532246 by blake
Replied by blake on topic 2 Different scripts
I see two things from the photos you sent. First on the run tab screen I see that the UnderVolt fault is lit. This means you don't have enough or any voltage on VMOT. You need to power this in order for the motors to turn.

Second in your pulse input configuration you don't have the "Input Use" set for PIn4 and Pin5. You need to have these set to either motor command or feedback to have them work properly. Double check your configuration and let me know if you are still having problems
The following user(s) said Thank You: alptekinarslan

Please Log in or Create an account to join the conversation.

6 years 9 months ago #29532247 by alptekinarslan
Replied by alptekinarslan on topic 2 Different scripts
Yes you are right, I didn't connect V mot, I was just trying to figure the input issue with encoder, so no needed to run the motor at that moment, I guess it has no effect on encoder case.

I changed the the input use of pulse in 3 and pulse in 4 as feedback, but still the same situation, encoder counter seems not working.
To make it sure, I enabled the encoder and tried it, didn't work, I disabled the encoder and tried it, didn't work. IN both cases the counter doesn't change.

If you need any configuration details from the controller and roborun please tell me and I will provide it. I tried many combinations but i cant get the counter work.
Thank you so much

Please Log in or Create an account to join the conversation.

6 years 9 months ago #29532248 by blake
Replied by blake on topic 2 Different scripts
I'm sorry I misunderstood your issue origionally, I thought that you were having problems with the pulse inputs when you are actually having a problem with the encoder input.

Yes please send your configuration file to me at This email address is being protected from spambots. You need JavaScript enabled to view it.. Reference this forum thread so I know who it's from.

Please Log in or Create an account to join the conversation.

6 years 9 months ago #29532249 by alptekinarslan
Replied by alptekinarslan on topic 2 Different scripts
Thank you,
I send 2 configurations, in one of them the encoder works but I can use only 2 pulse in from my radio control.
In the other one, I can utilize form 4 pulse in, but the encoder doesn't work, I mean the counter value doesn't increase or decrease.

Please Log in or Create an account to join the conversation.

6 years 9 months ago #29532251 by blake
Replied by blake on topic 2 Different scripts
An edit to my original post:

Note 2 from the datasheet is not a typo and in fact correct. In order for the encoder signals to be recognized and used, pulse inputs 3, 4, 5 and 6 must be disabled.

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.075 seconds