Can we control the serial port by writing a batch file through the cmd prompt in windows? and how if we can?
salihkadir
2009-04-10 04:35:36 UTC
Can we control the serial port by writing a batch file through the cmd prompt in windows? and how if we can?
Three answers:
Peter H
2009-04-10 12:17:12 UTC
Tricky one, this. There are two problems to be solved, initialising the port and writing to it. The second part is easy with the redirection symbol > with a line like
type txtfile.txt > com1
which will redirect the output of the type command from the screen to a serial port. The real problem is initialising the serial port with the correct transmission rate, start/stop bits etc to agree with the device at the other end. There is no way of doing this from a command prompt. I used to do it from a C or assembly language program, which you would have to write and incorporate in your batch file.
You may find it easier to use a terminal program like Hyperterminal to communicate with your serial port.
?
2016-09-30 02:25:52 UTC
once you place CMD in a batch document, it won't easily open a clean window, it is going to easily teach you a clean command instantaneous in the comparable window. as quickly as you're finished with the consultation, you could proceed on with something of your batch document with the help of typing "go out". in case you prefer to open a clean window and have the batch document wait until eventually that's closed, do something like this: @echo off initiate /wait "Temp CMD instantaneous" cmd /ok "cls && echo type 'go out' to end this consultation." echo you have exited the command document.
fritya56
2009-04-10 04:51:07 UTC
it was controlled under " interlink " may not be in newer versions .
breaking a connection ? writing to a serial port device ? establishing a connection between comps ?
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.