Asked — Edited

VB Tutorial #1 - Getting Started

Visual Basic Tutorial 1 - Getting Started While assumptions are not generally a good thing, I am going to start this tutorial project by assuming that the reader has a copy of VB Express and that you have at least a passing acquaintance with it and are comfortable using its IDE. If not, then please get a copy of VB Express (a free copy is available from Microsoft) and go through it's tutorials to become familiar with terms, procedures, etc. As well, I assume you have downloaded the EZ SDK from the EZ-Robot website and have installed it and know where the DLL has been put. 1.1 The first thing you need to is to get VB to recognize the EZ module. Follow these steps: a) Start up VB with a new project; call it whatever you would like say like MyProject. It should be a Windows Form Application. This will produce a form called appropriately enough Form1. Feel free to change this name if you like as well as any of the form's properties. (See why I assumed you knew VB already!!).

b) Now we will add the EZ controls to the Toolbox. If the Toolbox is not showing then use View Other Windows Toolbox to display it. Right Click on the Toolbox. A dropdown menu should appear; select the Add Tab. A new entry in the Toolbox should show up where you can enter the name EZ-B or some other name of your liking. Now highlight the EZ-B tab and Right Click. From the dropdown menu, select Choose Items. A Choose Toolbox Items form should be displayed. Browse to where you put the EZ-B DLL from the SDK and press Enter. The Choose Toolbox Items form will now have 2 new entries; EZB and EZ_B Connect1. Select both items by checking the check boxes on the left and press the OK button. The Choose Toolbox Items form will close and the Toolbox should now have 3 new entries under the EZ-B entry. They are: Pointer EZB EZB_Connect

1.2 Now for your first program. Well it's not really a true program but it will actually do something and an important something as well. We will get the PC to talk to the EZ module.

1.2.1 Go the Toolbox and double click on the EZB_Connect. This will put a special EZ control on the form. This control will contain a button labelled Connect, a label which should default to Auto and another button, this one labelled Debug. You can move the control around to wherever you would like on the form, however, the top left corner is a good place for now.

1.2.2. Now for the fun stuff. Your program is ready to run. All you need to do is attach power to your EZ module and set up the Bluetooth connection. Details in the Getting Started instructions that came with your EZ module work fine. Once you attach power to the module, the LED will start flashing. Run your program by pressing the F5 key, press the Connect button and the Connect button will dim for a while. In a few seconds, the LED on the module stop flashing and the Connect button will change to Disconnect.

1.2.3. If all went well, your program will control whether or not your PC and the EZ module talk to each other. The next tutorial will actually write some code that will let you do something useful.


ARC Pro

Upgrade to ARC Pro

Synthiam ARC Pro is a new tool that will help unleash your creativity with programming robots in just seconds!

PRO
Synthiam
#1  

This is great!!! Thank you! :D

United Kingdom
#2  

I'm on a steep learning curve so this is very helpful can't wait for #2

#3  

It seems I have some problems with my very first step. I double click EZB_Connect to add it to the form. Do I need to add something to the code?


System.InvalidOperationException was unhandled
  Message=An error occurred creating the form. See Exception.InnerException for details.  The error is: Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
  Source=WindowsApplication1
  StackTrace:
       at WindowsApplication1.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
       at WindowsApplication1.My.MyProject.MyForms.get_Form1()
       at WindowsApplication1.My.MyApplication.OnCreateMainForm() in trihoufs1users$zzhangMy DocumentsVisual Studio 2010ProjectsWindowsApplication1WindowsApplication1My ProjectApplication.Designer.vb:line 35
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.IO.FileLoadException
       Message=Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
       Source=EZ_B
       StackTrace:
            at EZ_B.EZB.init()
            at EZ_B.EZB..ctor()
            at EZ_B.EZB_Connect..ctor()
            at WindowsApplication1.Form1.InitializeComponent() in trihoufs1users$zzhangMy DocumentsVisual Studio 2010ProjectsWindowsApplication1WindowsApplication1Form1.Designer.vb:line 25
            at WindowsApplication1.Form1..ctor()
       InnerException: 

Netherlands
#4  

So i can see your missing dot net 3,5.

But if your at this stage, and you fix this by installing dot net 3,5 your next error will be lock. Read the readme in the sdk for the rest of the info.

#5  

I solve it by adding some code to the applications config.

Check it here.

My bad, forgot to check Readme.txt

So many problems using VS2010, even hot keys got changed. "Fix: Disable the loader lock MDA. Debug/Exceptions (ctrl-D, E), Open the Managed Debugging Assistants tree node and uncheck Loader Lock." Now it is ctrl+Alt+E

Thank you Pabi!o.

ZZ

Australia
#6  

hi I am using vb express 2008 on windows 7

I get this fare as this then get error

b) Now we will add the EZ controls to the Toolbox. If the Toolbox is not showing then use View Other Windows Toolbox to display it. Right Click on the Toolbox. A dropdown menu should appear; select the Add Tab. A new entry in the Toolbox should show up where you can enter the name EZ-B or some other name of your liking. Now highlight the EZ-B tab and Right Click. From the dropdown menu, select Choose Items. A Choose Toolbox Items form should be displayed.

Browse to where you put the EZ-B DLL from the SDK and press Enter.

my location (C:\EZ-SDK\DLL) what do i click on

Australia
#7  

hi i fixed the problem:) it now is all working ok :)

Australia
#8  

hi now i get and error Warning 1 Referenced assembly '......\EZ-B SDK Windows\EZ-SDK\DLL\EZ_B.dll' targets a different processor than the application. myprojectX

Netherlands
#9  

jup that is the error you get when windows 7 is x64. you have to change it to x86 :)

PRO
Synthiam
#10  

There is a readme.txt file in the zip. If you follow each step, it'll work great :)

Australia
#11  

hi its fix the problem was when i remove vs 11 beta it removed net 3.5 now it con's with eb-z and move servo so have save it as a template

PRO
Synthiam
#12  

nice!!! :D

You're gonna love the EZ-SDK. And you can copy the code into the VB/C# script control in ARC and make your own :)

You'll have to combine the designer script with the main code if pasted in the script control.

Australia
#13  

hi yep it will be fun. i write a lot of VB for MS Access . love putting thing in modules, at way I only need to change small amounts of code :))

PRO
Belgium
#14  

hi all.you have to have the ez-b controler to use this vs? blush

#15  

@nomad18.08 said: "you have to have the ez-b controler to use this vs?"

I'm going to say no. In the same sense you don't need an ez-b controller to use the ARC software. Obviously it's not going to physically connect to anything with an an EZ-B. But if you wanted to develop other things such as camera tracking, voice recognition, text-speech and so forth you could do all of those without an EZ-B.

PRO
Belgium
#16  

i download it and no errors sofar.thank you for making this post very helpfull.

PRO
Belgium
#17  

am trying to download ARC on a vista laptop.it dont work.als the sdk dont work.?

#18  

@nomad18.08 What error messages are you getting?

#19  

If your system is Windows Vista, the highest version of the Microsoft .NET framework that will run on Vista is 4.0. Both the ARC software (above version 12-1-13) and the newest version of the SDK were developed with the .NET 4.5 framework which only works on Windows 7 and above operating systems. So the latest versions of the ARC application and the SDK will not run on Vista or older systems, only Windows 7 or above.

Do you have a Windows 7 or above system you can run and install the software on?

EDIT/Correction - actually Windows Vista with service pack 2 installs will support .Net 4.5 per Microsoft's website: http://www.microsoft.com/en-us/download/details.aspx?id=30653 You may just need to download it and update Vista if you are not on SP2.

PRO
Belgium
#20  

for my win7 is all ok. but my windows vista home not.as you explained it will not work.thanks i was hoping to get on my vista so i can train whit the i-qbot.

#21  

@nomad18.08 See my correction. If Vista is on Sp2 you can install .net 4.5 http://www.microsoft.com/en-us/download/details.aspx?id=30653

PRO
Belgium
#22  

oh i will checkt that.thanks :D

PRO
Belgium
#23  

the sdk and dotnet did install perfect. the ARC not.get error not supportedx86 you have a link for

#24  

I didn't really follow what you said there. Maybe you should post the exact error messages(s).

#26  

In way that makes sense. It does states on the download page the ARC application is only supported to run on Windows 7 and 8.x. I figured if .Net 4.5 was installed the application should run. I guess the app does a system check as well. Your Vista install is only 32bit correct, not 64 bit?

#28  

Anyonw else get an error at run time: Type 'EZ_B.EZB' is not defined Type 'EZ_B.EZB_connect' is not defined

I'm trying to do the sample like the directions suggest. I'm using Visual Studio profession 2010, have .net4.5 on a Windows 8.0 OS and the compile is set for x86. I was able to add the EZ_B.dll to the tool box and get the tools and add the EZ_B Connect. I'm puzzled.

confused

PRO
Belgium
#29  

would it be a great app.excample you can send text whit your mobile phone to and jd says it. :D

#30  

I solved my own problem. I was using a full version of Visual Studio 2010 which only supports up to the .Net 4.0 framework or older. Not the newer 4.5. So to use the current SDK you really must use either the newest Visual Studio Express versions (which is free) or obtain Visual Studio 2013, which is what I did.

The new Visual Studio Express versions can be found here: http://www.visualstudio.com/en-US/products/visual-studio-express-vs

And of course you must download the 4.5 framework if you don't already have it.

@DJSures - in the current SKD, the Read Me file still states to use the 4.0 framework.

PRO
Belgium
#31  

i think i found lesson one. User-inserted image