Visual Basic Development Bookmark and Share   
 Home > Visual Basic Language > Enter multi-line string command to hardware through VB problem
 

Enter multi-line string command to hardware through VB problem

Hi, I am currently working on a project that using VB.net to send string command to a hardware controller. I have the command strings manual. The problem is the command must enter in follow format:

In hyperterminal

#$#&@(#(Enter)
(start next line)

Then the hardware will run.

In VB, the command will be

port.write("#$#&@(#" & Chr(13) & Chr(10))

Chr(13) = Carriage return
Chr(10) = line feed

My new question is how can I enter two command line at the same time, suppose to move the hardware first and return to home next

I entered

port.Write("$&^**&(" & Chr(13) & Chr(10))
port.Write("#$#&@(#" & Chr(13) & Chr(10))

The program only runs the first line and then stopped.

Thank you very much
qiwenfarmer  Thursday, February 21, 2008 3:42 PM

I think you have to wait for the hardware to complete command 1 before you send command 2.

If the hardware gives no feedback on its status then you can just put a sleep-line between this two lines to wait for some time before sending the second command.

But this depends on the hardware, maybe you have to read some hardware documentation when it is safe to send a new command.

BrainWasher  Thursday, February 21, 2008 4:20 PM

I think you have to wait for the hardware to complete command 1 before you send command 2.

If the hardware gives no feedback on its status then you can just put a sleep-line between this two lines to wait for some time before sending the second command.

But this depends on the hardware, maybe you have to read some hardware documentation when it is safe to send a new command.

BrainWasher  Thursday, February 21, 2008 4:20 PM

You can use google to search for other answers

Custom Search

More Threads

• Collection to class object
• I wan't to make a button in my program that opens it when the computer starts up but how would I do that?
• Software Patent /IP
• How to sort a list from A to Z
• Obtaining Memory Information
• error 91 object not defined etc.
• Oledb connections
• Error in defintion of Array??
• Read from a locked txt file
• WaitAll for multiple handles on a STA thread is not supported.