Was the post I referenced in vb6? I may have misjudged what language it was - Any help is appreciated... Does anyone know if it's possible to do it in .Net?
Main Topics
Browse All TopicsI've been battling this for a few days now and I stumbled upon this post that is very similar to what I'm trying to accomplish. It uses the exact output also, the xdld command to put the device in download mode. I don't need this process automated however, and I don't want it to do it on startup. I just cant seem to get the code right for opening com1 and sending it the right xdld command. I'm using visual basic 2003 and I know it should be just a few lines, but I'm a novice in this area. Any help in this area is much appreciated, again... all I need to do is open com1, utilize the XDLD command and then I have a separate batch file that will download the file once it is in that mode. Thanks for any help!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Well, that looks a lot like VB6 code. If you're getting an application error it's probably because the MSCOMM32.OCX is not available for use like this.
Try a .NET solution for comm communications:
http://www.codeworks.it/ne
That sample project should allow you to experiement sending the right download code to your device.
Thanks for that valuable piece of information! The next wall I've run in to, is that I'm trying to call a batch file after the port is open and the command has been sent - this has to be within the same application, right? When I just run the batch file by itself after trying to send the command, it seems to just think the port is closed or in use.
Ok, after weeks of waiting for a response from the manufacturer, I have it. I have the command I'm supposed to use, but I'm stuck on getting anything to communicate to it.
REQ: <STX>XDLD<FS>FileName<FS>Downloa
RSP: <STX>XDLD<FS>RetVal<FS>RetValStr
where:
FileName = name of file to be downloaded
DownloadType =
'P' = PARTIAL download (contents of file system are NOT erased)
'F' = FULL download (contents of file system are erased)
ForceRestart = 1 = Force restart the application
2 = Force restart the Device
RetVal = 0 - Unsuccessful operation
1 - Successful operation
RetValString - contains a text description of the result.
Is there anyway you can guide me through setting this up in Visual Studio 2003? I tried inputting this into apps, but it doesn't communicate.
Hopefully you can offer any kind of solution! Thanks
It would be better if I could just have this all happen in a console application and open my port, then send the command, then possibly prompt the batch file I have that sends the file... I've invested hours upon hours with trial and error, and nothing to show for it :/
Business Accounts
Answer for Membership
by: Richie_SimonettiPosted on 2008-11-20 at 04:24:30ID: 23002950
Hi, unfortunatelly, i have no clue regarding VB.net.
You see, i am in the Old and Good School of VB6.
Sorry.