loading
 
Execute program
Puvan from Malaysia  [10 posts]
17 year
dear Mr Steven,
1) As u told me i create an exe file in Q-Basic and save it in desktop......and when i double click it i can see a program like ms-dos window open and in the same time the stepper motor runs as i programmed in Q-Basic...
But when i open the exe file in roborealm......the ms-dos(Q-basic exe)..open and just blinking so many times and it doesnt start or rotates the stepper motor...how do i settle this problem.....
hope u will help me...coz i have to submit my project by this week...

2) The robo file is for red object....and i have to the same for blue object and green object.....so....for each colour got an Q-basic file....how do i make roborealm jumo loops...this means when i put red object it should run the Q-basic program file set  for the red...otherwise no.....and then when i put the blue it should jump to run the exe file set for blue...and when green it should run the exe file set for the green...

3) And how do i send signal from my sensor to the exe file that is running in roborealm...........i have to input three sensor to control the dc motor..

hope sir will help me to settle this problem and i really appreaciate if sir  do
a robo file for each problem above...in a separate robo file......coz i get confuse if all are in one robo file...hope sir will understand...
here i send one of my robo file to run the exe file but I cannot run the stepper motor….

program.robo
Anonymous 17 year
Puvan,

1.) Try some basic debugging to see what it happening. Log something to a file at the start of your VBScript program and see if that log appears when you try it with RoboRealm. Continue this process until you can see where the program is stopping. Note that RoboRealm will redirect any input and output to the RoboRealm program so you need to use a file to log any internal actions.

2.) You would need to do this in one file. Basically you have 3 parts to the RR pipeline. You essentially process the image 3 times the same way for each of the 3 colors and check if you have anything in view or not. We've attached an example below on how to do this. Note that when the Execute program routine does not function correctly the pipeline will stop running at that point so be sure to specify a correct filename for each of the 3 execute modules.

3.) What kind of sensor are you talking about? An IR sensor? An optical sensor? What form of communication are you using with that sensor?

STeven.

program.robo
execute program
Puvan from Malaysia  [10 posts]
17 year
dear sir,

i still dont know how to run the exe file in execute program......and i try to run it in pipe program...but in pipe the exe only run when i press the reload and run button in the pipe module......i cannot run it automatically when a red object is detected...it is giving error.....(the exe cannot be started and cannot create rrpipe)....let say i save my in dekstop..how do i make the pipe program automatically...run the exe file when a red object is detected and still continues running when the red is not there.......how do i fill in the name...program file.....program  arguments....pipe name....can u give me and example for this......

and for the execute how do i make the execute program to run the exe file for one time only.......
Anonymous 17 year
Puvan,

you cannot use the Pipe Program to execute a generic program. You have to use a Pipe based program for that to work. You MUST stay with the EXECUTE PROGRAM module.

Did you try debugging your QBasic program? Did it actually execute? Did you see any log statements get created? Do you know where it is failing?

You have to surround the execute program with a conditional that ensures that the program is only run once. Think of it as having access to a system call that would run your program. For each iteration of the processing pipeline which executes many times  a second you need to use the conditional statements to prevent it from executing more than once. For example add in a COG module and modify your VBScript module you could use:

SetVariable "execute_program", ""

if GetVariable("COG_BOX_SIZE") > 20 then
  if GetVariable("part_seen") = "" then
    SetVariable "execute_program", 1
    SetVariable "part_seen", 1
  end if
else
  SetVariable "part_seen", 1
end if

which will set the execute_program variable to 1 when the program should be executed for the presence of a part. Note that is resets when no part (or a really small part) is in view.

part_seen and execute_program are my custom variables that are created by this routine. You will need to use a conditional statement after this module that surrounds the EXECUTE PROGRAM module that checks the execute_program variable as to if it should run or not. See the Statements->IF_STATEMENT module to do this.

STeven.
Dear sir
Puvan from Malaysia  [10 posts]
17 year
i dont know how to use the vbs to create the program as sir mention above.......let i save my q-basic file in dekstop named as loop.exe.....
how do i use the vbscript above to execute the program once....can u do for me a robo file for that...and do i need to fill up the program arguments...or output...in the execute module.....i had try another method to run this exe file..it can run once.....but when i click anything at the roborealm...when the program is rinning ....it runs again and again.....i just want the program to run when i put red object once...it runs once......
here i send my robo file which i use ....but it cannot works...
program.robo
dear steven.......
Puvan from Malaysia  [10 posts]
17 year
i dont know how to use the vbs to create the program as sir mention above.......let i save my q-basic file in dekstop named as loop.exe.....
how do i use the vbscript above to execute the program once....can u do for me a robo file for that...and do i need to fill up the program arguments...or output...in the execute module.....i had try another method to run this exe file..it can run once.....but when i click anything at the roborealm...when the program is rinning ....it runs again and again.....i just want the program to run when i put red object once...it runs once......
here i send my robo file which i use ....but it cannot works...and how to make the program to run only once...even if the red is still there...
program.robo
Anonymous 17 year
Puvan,

If you check the robo-file from 7 days ago that is what we provided you. As we think there is an issue with communication we will attempt to better explain this type of task in a tutorial for parts sorting. This tutorial will, however, take a couple weeks to put together. At this point we recommend you review the above robo-file as it shows you how to achieve what you are asking for.

Did you debug the q-basic file?

Thanks,
STeven.
Thank you................
Puvan from Malaysia  [10 posts]
17 year
Dear My.Steven,

I just would like to thank you for ur kind help with my project...
I had finished my project successfully............Thanks a lot..........
Anonymous 17 year
You're welcome. Glad things worked out!

STeven.
colour
Puvan from Malaysia  [10 posts]
17 year
Dear Mr Steven....

As i told u i already finish my project......and i'm preparing for the presentation for this project...here i have show tha accuracy of my project....as i told u i'm using three colour for sorting ...each colour object will run a different execute program each.......the colour is red,blue and green......the problem is nw the camera can detect blue in green colour object......that is not supposed to do rite.......hw do i make sure that it only detect the three original colours.....let say i put orange object which is near to red...how do i make sure the program does not run the execute program when the orange object is detected.....but most probably the blue and green only giving problem...when i put green object it detect some blue in it.....an when i put blue object it detect green in it.....help me sir...can u do for me a robo file for this three colours....red,blue and green...it should not detect this three colours in pink colour,orange colour object and so on....
Anonymous 17 year
Puvan,

Can you post the current .robo file that you are using and we will make the modifications to that file. Can you also include one or two images of a red and an orange color?

You will need to adjust the "Min Intensity" and "Min Hue" in the RGB_Filter module to eliminate the other colors. For example, orange has red components in it and thus will respond when the red filter is on without setting the options correctly. Try 200 for "Min Intensity" and 180 for "Min Hue" and see if that makes a difference.

STeven.
Puvan from Malaysia  [10 posts] 17 year
i send the you the robo file...and together with two image....
and has i said i has to run the exe file for fixed for red object when red is detected and the exe file fixed for the blue object when the blue is detected.......let say i put an object which is the combination of the two colour red and blue but i dont want to run either the red exe file or the blue exe file...but run a diiferent exe file.....
program.robo
Puvan from Malaysia  [10 posts] 17 year
i send the you the robo file...and together with two image....
and has i said i has to run the exe file for fixed for red object when red is detected and the exe file fixed for the blue object when the blue is detected.......let say i put an object which is the combination of the two colour red and blue but i dont want to run either the red exe file or the blue exe file...but run a diiferent exe file.....


program.robo
Anonymous 17 year
Puvan,

You need to adjust the thresholds in the RGB_Filter modules. We made that change and also fixed detecting other colors in the attached robo-file. Please download the latest RoboRealm version needed for the changes that we made.

Please review the robo-file and let us know how it goes. Note the new EXIT module and the changes to ordering of color detection.

Thanks,
STeven.
program.robo

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index