PDA

View Full Version : Looking for a vb program for rw210


excossum
01-18-2008, 08:22 AM
i am looking for a vb program for the rw 210, that will allow me to put plain txt on to a tag, one that is simple and easy to use. my main goal is to encyrpt the data using a form of hardware encyrption. i may be in over my head but i got to try this....

Alex
01-18-2008, 09:30 AM
I take it you don't have any vb programming experience? This would be a pretty easy task to do with APSX's .NET API, provided of course you have vb programming experience...

excossum
01-18-2008, 10:07 AM
i do have some experience with vb, what is APSX's .NET API? is that the test app? that you can get all the read and wirte commands from? i am sure i could wirte a vb to do what i want, if i knew where to start, any ideas would be a great help.

Alex
01-18-2008, 10:42 AM
I should clarify something. What version of vb do you have experience with? I believe this API will only work with vb versions that use the .NET framework. (vb.NET 2003 and above). If you don't have any of these versions available to you, Microsoft provides the Express languages for free:

I'll be giving you directions using 2005 below:
http://www.microsoft.com/express/2005/

This is the latest version of Express, but I'm not sure if my directions below will be the same:
http://www.microsoft.com/express/download/


The APSX's .NET API is an Application Programming Interface that you reference (actually you reference the DLL) in your application. Once you reference this DLL in your application, you have access to all of the events, methods, objects, etc. used to interact with APSX RW-210 and RW-310. You do have the C-100 converter right?
The APSX .NET API can be found in the \APSXTEST\bin directory in the APSX Test Application Source Code download at the following link:

http://www.apsx.com/Downloads.aspx

You will also need to download the APSX Help File (CHM) which documents all of the API and will help answer most questions.

When you create a new vb.NET application, go to (I'm using vb 2005) Project -> Add Reference, click on the Browse tab, and navigate to the directory that I referred to above and make a reference to APSXDLL.dll. Once you make the reference, in the Solution Explorer Window to your right, select the second icon from your left "Show All Files". Then, go click on the plus sign next to References, right click on APSXDLL, and go to properties. Make sure that Copy Local is set to true in your properties window and your good to go!

I'd start off by opening the Test Application Source Code and go through all of that code, set break points and look up everything they did in the CHM file.

I know this may sound a little overwhelming at first, and it will be. I'm not going to lie. But, don't get discouraged. Once you learn about this sort of stuff, you'll be able to use this knowledge you've gained everywhere:)

excossum
01-18-2008, 11:06 AM
thanks for the info I will give it a try wish me luck, I have used vb before but like you said it is overwhelming.... but i am sure i'll come out with something. if I run in to any problems will it be ok to ask on this?

Alex
01-18-2008, 11:14 AM
if I run in to any problems will it be ok to ask on this?

Of course it is! That's what the community is here for!

We'd love it if you could document your project in your own blog here in the TR Community. Just go to the blogs section (http://forums.trossenrobotics.com/blog.php):)

excossum
01-19-2008, 02:57 PM
i got the reference added and i have been looking at the source code for the test program, and the help file. but i just can see how to get it started, i know what i want to do i just dont know the code that i need for vb to make it happen lol. i just need the code to open and close the device and the code to write data to and from the tags. i just simpley need a program to be able to write plain text to and read text from a tag. anyone got any suggests on how to get started?.

excossum
02-15-2008, 07:51 AM
everything so far has been going good, but i am still haveing problems with getting the VB code 2005 is like a new beast to me, all i need is a code to write and read text to a tag using the 210 RW. if anyone has any ideas it would be a great help.

Alex
02-15-2008, 10:31 AM
Have you opened up the source code for the APSXTEST application yet? It may go through a conversion because of different versions of vb, but it will truely help you in understanding how to interact with the APSX reader/writer. I can't write the program for you, but hopefully I can help at least point you in the right direction and teach you a few things about vb.

Crap! I just tested out the APSXTEST application source on vb 2005 and found there is something wrong with it, at least the version that I just downloaded. In order to get this working to compile, test and execute it, please do the following:
Download the APSXTEST application source code (http://www.apsx.com/documents/apsxtestcodes.zip) and extract the files
With visual basic 2005 installed, double click on APSXTEST.vbproj. You'll probably be prompted to go through a conversion. If so, go through the conversion process. Review the Conversion report for errors & warnings and if all is ok click the X to close out the Conversion Report.
Once the conversion process is finished, off to the right you'll see the Solution Explorer window, under "Solution Explorer" you see a small navbar. Highlight over the second icon from the left and it should say "Show All Files". Click on this
In the Solution Explorer window you should now see a folder called "References". Expand this folder and look for APSXDLL. There's probably an exclamation mark to the left of it. If so, right click on APSXDLL and choose "remove".
If there wasn't an exclamation mark to the left, skip this step & step 6 and move to step 7. Right click on References and choose "Add Reference"
Select the Browse tab and navigate to your bin directory in the application source code files.
Build your application by going to the menu option "Build -> Build Solution". You'll be prompted to save your .sln file. Save this file in your root directory of APSXTEST.
Once built, you will see in the Output window at the bottom if there are any errors during the build. Hopefully you see ========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========, but if not, let me know.Ok, whew, that was a mess, sorry about that:)

Now, to get to the fun stuff. In your Solution Explorer, double click on dlltest.vb to open the form. Now that you have the form open, you can now see how APSX interacts with their API (Application Programming Interface). To do this, simply double click on any of the buttons on the form and it will take you to the code editor window and to the specific event that is used for that specific button. I would start off with the open and close ports buttons.

To view any of these methods in action, when you are in the code editor, look to the left and you'll see a grey bar. This is your breakpoint area (not sure on the exact word off hand). Basically, this is where you set what is called a breakpoint. I cannot express how valuable breakpoints are in high-level programming. They're mainly used to better understand and debug the code that you're looking at it.


In this example, I'm going to show you how to set a breakpoint for the open port button. To do this, go back to your form view and double click on the Open Port button. Now, it should have taken you to the code editor again. On the line that it took you too, just above that you'll see Private Sub btnOpenPort_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpenPort.Click. To the left of this click in the breakpoint area and it should now highlight that line. Now run the application by clicking the play looking button in the navigation bar, just underneath the menu option "Window". You should now have your form up and running. Click on the Open Port button and viola, execution stops and you're taken to the code editor at the breakpoint you just set. Pressing F11 will step into the code one line at a time. You'll see a dialog box that comes up that says "No Source Code available for the current location". Don't worry about this. It mainly means that APSX isn't showing you the source code of their API, which is very common. Just click OK and then hit F5 to continue execution.

Now that you know how to bring the form up and set breakpoints, the only thing left is for you to look up all of the methods/fields/properties, etc. for the APSX API and see what they all do. You find these in the APSXRFID.chm help file under APSXRFID Commands -> APSXDLL -> apsxrfid Class.

Once you better understand their API and how it all works, you'll understand how to build your app.

excossum
02-15-2008, 11:31 AM
thanks alex, you been a great help, i will let you know when i get it working, i think i named this post wrong lol, your right i want to write this code myslef that way i will understand it, i hate using something i do understand.