Writing a Batch File for MS-DOS Serial Port Communication

In summary, a batch file is a text file that contains a series of commands that can be executed by the command line interpreter in MS-DOS. To write a batch file for MS-DOS serial port communication, you will need to use the "mode" command to configure the serial port settings and the "copy" command to send and receive data. Other commands such as "echo" and "pause" can also be used for displaying messages and pausing the execution of the batch file. Common uses of batch files for serial port communication include automating tasks like data transfer, device configuration, and data backup. Batch files can also be used for other tasks, such as automation, running multiple commands, and creating custom scripts. No special software
  • #1
gimini75
52
0
Hello

Can anyone help me please, I want to write a batch file in MS-DOS to:

Communicate with the serial port, send data to the serial port from a specified file and for a respond to come back from the driver that first command being done and now ready for next line of data to be send it through the serial port to a stepper driver.


Thanks for your help
 
Physics news on Phys.org
  • #2
That's going to be tricky to do with batch
The normal tool for doing this sort of thing is expect http://expect.nist.gov/
 
  • #3
.

Hello, writing a batch file for MS-DOS serial port communication can be a useful tool for automating data transfer and communication between devices. To begin, you will need to have a basic understanding of MS-DOS and how to use the serial port commands.

First, you will need to specify the serial port you want to communicate with using the "mode" command. This will set the baud rate, parity, and other settings for the serial port.

Next, you can use the "echo" command to send data from a specified file to the serial port. Make sure to include the appropriate commands or characters to indicate the end of the data transmission.

To receive a response from the driver, you can use the "echo" command again to send a command or prompt to the driver. The driver should then send a response back to the computer, which can be captured using the "set /p" command. This will store the response in a variable that can be used in the batch file.

Once the first command has been completed and a response has been received, you can use the "goto" command to move on to the next line of data to be sent to the driver.

Overall, writing a batch file for MS-DOS serial port communication requires a good understanding of the serial port commands and how to use them effectively. With some practice and experimentation, you can create a batch file that efficiently communicates with a stepper driver and automates your data transfer process. Best of luck with your project.
 

Related to Writing a Batch File for MS-DOS Serial Port Communication

What is a batch file?

A batch file is a text file that contains a series of commands that can be executed by the command line interpreter in MS-DOS.

How do I write a batch file for MS-DOS serial port communication?

To write a batch file for MS-DOS serial port communication, you will need to use the "mode" command to configure the serial port settings and the "copy" command to send and receive data. You can also use other commands like "echo" and "pause" to display messages and pause the execution of the batch file.

What are some common uses of batch files for serial port communication?

Batch files for serial port communication can be used to automate tasks such as transferring data between two devices connected through a serial port, configuring and testing serial port devices, or creating a backup of data from a serial port device.

Can batch files be used for both serial port communication and other tasks?

Yes, batch files can be used for a variety of tasks in addition to serial port communication. They can be used to automate repetitive tasks, run multiple commands at once, or create custom scripts for specific purposes.

Do I need any special software or tools to write and execute a batch file for MS-DOS serial port communication?

No, you do not need any special software or tools. Batch files can be created and executed using the built-in command line interpreter in MS-DOS. However, you may need to install any necessary drivers for your specific serial port device.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
12K
  • Programming and Computer Science
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
25K
Replies
10
Views
965
Back
Top