Typing out to the Monitor from a C# script

Tips and tricks for Adept ACE

Typing out to the Monitor from a C# script

Postby NHuntoon » Mon Oct 28, 2013 10:11 am

How do you output to the Monitor from a C# script? I have a custom vision script and I want to output intermediate values to the monitor while it's executing. I'm running inside namespace Ace.Custom. The V+ command 'TYPE' doesn't work. Can I map the V+ commands to C# commands?

Thanks
NHuntoon
 
Posts: 4
Joined: Wed Jul 24, 2013 6:37 am

Re: Typing out to the Monitor from a C# script

Postby KevinS » Mon Oct 28, 2013 10:52 am

NHuntoon wrote:How do you output to the Monitor from a C# script?

The C# Program has a Trace Window that you can use to print values.

Trace.PNG
Trace.PNG (13.91 KiB) Viewed 9730 times


NHuntoon wrote:The V+ command 'TYPE' doesn't work. Can I map the V+ commands to C# commands?

V+ and C# are two different programming languages and do not share the same keywords. You can use the C# program to interact with the Adept Controller object through the exposed methods and properties. There is not an easy way to print a V+ TYPE instruction from C#. However, you can print the value of V+ variables in C# using trace message by accessing the interface IVpLink.

Vplus_Trace.PNG
Vplus_Trace.PNG (29.15 KiB) Viewed 9730 times


I would also recommend looking into the Adept ACE reference guide, available from the help menu in Adept ACE. The API contains lots of C# examples.
KevinS
 

Re: Typing out to the Monitor from a C# script

Postby NHuntoon » Mon Oct 28, 2013 10:59 am

Thanks,

I actually found the Trace command and was starting to use that as a work around. I was hoping to get an output on the Monitor as we have several other outputs that go to the monitor and it would have been nice to get everything on the same display. For troubleshooting now though Trace is working.

thanks for the input.
NHuntoon
 
Posts: 4
Joined: Wed Jul 24, 2013 6:37 am

Re: Typing out to the Monitor from a C# script

Postby KevinS » Mon Oct 28, 2013 11:05 am

You could have a V+ program do all the TYPEs and execute this program from C#?

// Execute program "print.prog" on task 2
adeptController.ExecuteVPlusInstruction("EXECUTE 2 print.prog");

or

// Execute program "print.prog" on task 2 with no timeout
adeptController.Link.Execute("print.prog", 2, 0);

execute.png
execute.png (7.1 KiB) Viewed 9728 times
KevinS
 

Re: Typing out to the Monitor from a C# script

Postby seank » Fri Jan 17, 2014 1:59 pm

For reference, you can also execute a type to the monitor through C# like this:

Code: Select all
         
IAdeptController adeptController = (IAdeptController) ace["/SmartController 47/SmartController 47"];
adeptController.ExecuteVPlusInstruction("type \"debug\"");
Sean Kelly
Applications Engineer
Adept Technology, Inc.
seank
 
Posts: 12
Joined: Fri Jul 29, 2011 10:46 am

Re: Typing out to the Monitor from a C# script

Postby Rajat Rohit » Mon Jul 03, 2017 10:13 pm

Hi,

I am using adept ACE on my windows PC for Cobra i600 robot running micro V+ OS. As shown in the above reply I tried created an object of IAdeptController and used the command "adeptcontroller.ExecuteVPlusInstruction("EXECUTE 0 prog_name");" to run the micro V+ program through C#. The program is running through this sentence and executing statements after this, but the V+ command execution is not reflected or isn't running.

If i use adeptController.Link.execute("prog_name",0,0); the program gets stuck at this instruction without going further.

How can i solve this problem to run my Micro V+ program from C#?
Can someone please help me in this?

Thanks.
Rajat Rohit
 
Posts: 8
Joined: Wed Jun 14, 2017 11:24 pm

Re: Typing out to the Monitor from a C# script

Postby Guenter Grass » Thu Jul 06, 2017 12:27 am

Hi Rajat,

the iCobra was designed to run as a standalone product. It does not use a SmartController. It uses the Micro V+ instead of the V+ programming language. In addition the interface to ACE was not as fully implemented as with V+ based robots.

Since you can't run a Micro V+ based robot in emulation I can only guess what might be the cause
- maybe the method was not implemented for the iCobra robot
- did you drag your robot into the C# program and then used IntelliSense to choose the methods which are available?
- you try to start a program in task 0. Task 0 can only be used if the robot is ready (High Power on, calibrated and not used by any manual control).

We don't have an iCobra any more. So I can't do any further tests.

Best Regards
Günter
Guenter Grass
 
Posts: 189
Joined: Thu Oct 16, 2008 4:34 am


Return to Adept ACE

Who is online

Users browsing this forum: No registered users and 2 guests