Italy
Asked — Edited

Automatically Connect To A Port

Hello.

I would like my Visual Basic program to automatically connect to Ezboard when i launch the program. Ezboard connection is on COM port 3 on my pc, so i have written the code:

Sub Form1 load Ezb_Connect1.Connect(3.0) ...but it does not work

So i have tried Ezb_Connect1.Connect(3) ...but it does not work

Can you help to solve the question, please? Thank you.


ARC Pro

Upgrade to ARC Pro

ARC Pro is your gateway to a community of like-minded robot enthusiasts and professionals, all united by a passion for advanced robot programming.

#1  

Use create a shortcut tool and in it you can specify a script to run when you open it.

OR

You can create a windows batch file like this Start "C:\Program Files (x86)\EZ-Robot Inc\ARC.quot; "C:\Program Files (x86)\EZ-Robot Inc\ARC.ARC.exe" "C:\Users\Technopro\Documents\ARC.Jarvis Ph. 1.EZB" "Auto start script"

The bold part is the spot where you saved the .ezb project. "Auto start script" is the script I told it to run when it opens.

Change this to fit what script it will run and in that script put your connect command.

United Kingdom
#2  

He is asking about the SDK and VB not ARC. Which very few use so an answer may not come (sorry, i can't help there).

However @technopro, avoid batch files, they are old hat and messy - I've covered it in an old post somewhere, use AHK for a much cleaner method if you even need to pass additional commands, your example would only need to use the link from shortcut creator, there's no sense in using anything else to be honest.

#3  

thanks for the heads up rich.

(playing with autohotkey now:) )

Edit: sick

Italy
#5  

And how can i auto-conect i visual basic when the form load?

I have tried

Ezb_Connect1.Connect(3.0) ...but it does not work

So i have tried Ezb_Connect1.Connect(3) ...but it does not work

Can you help to solve the question, please? Thank you.

Italy
#7  

Thank you, but if i write

Ezb_Connect1.Connect("com3")

I have the error "InvalidcastException" "Invalid cast string com3 type boolean"

if i write

Ezb_Connect1.Connect(com3)

I have the error "com3 not declared"

What am i wronging? Maybe i have to dim com3?

Italy
#8  

Can you help me, DjSures?

PRO
Synthiam
#9  

      ezB_Connect1.Port = "com3";
      ezB_Connect1.Connect(false);

When you press the . after the ezb_Connect1, the visual studio will popup a list of options. You can scroll through and read the titles of each one. There is a description for each one:)

Italy
#10  

Thank you DjSures. Tomorrow i will try to do this.

Italy
#11  

Hello. I have tested the code and this works very fine! Thank you very very much.