Oneliner to get / read the serial buffer and return the value to the standard outputBatch script to read/write data using COM portSerial port output buffer size in Windows 7reading serial port blocks for unknown reasonReading data from serial port from Arduino on Windows via PHP. Data not matching serial monitor outputVBScript read text file created in windows terminal substitutes characterstty - write/read to uart scriptsending serial commands to arduinoecho command to serial port in LinuxRead/Write on Serial Port in Windows Universal PlatformReading serial commands takes too much timeProblem with passing constantly reading serial buffer data to another class

Watching something be written to a file live with tail

Why is Minecraft giving an OpenGL error?

Intersection point of 2 lines defined by 2 points each

How much of data wrangling is a data scientist's job?

Perform and show arithmetic with LuaLaTeX

strTok function (thread safe, supports empty tokens, doesn't change string)

How can I prevent hyper evolved versions of regular creatures from wiping out their cousins?

Why are electrically insulating heatsinks so rare? Is it just cost?

What defenses are there against being summoned by the Gate spell?

Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?

Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?

Find the result of this dual key cipher

Important Resources for Dark Age Civilizations?

Paid for article while in US on F-1 visa?

Why can't I see bouncing of a switch on an oscilloscope?

A newer friend of my brother's gave him a load of baseball cards that are supposedly extremely valuable. Is this a scam?

What are these boxed doors outside store fronts in New York?

Today is the Center

Alternative to sending password over mail?

How does quantile regression compare to logistic regression with the variable split at the quantile?

How do I draw and define two right triangles next to each other?

If human space travel is limited by the G force vulnerability, is there a way to counter G forces?

How to efficiently unroll a matrix by value with numpy?

Are the number of citations and number of published articles the most important criteria for a tenure promotion?



Oneliner to get / read the serial buffer and return the value to the standard output


Batch script to read/write data using COM portSerial port output buffer size in Windows 7reading serial port blocks for unknown reasonReading data from serial port from Arduino on Windows via PHP. Data not matching serial monitor outputVBScript read text file created in windows terminal substitutes characterstty - write/read to uart scriptsending serial commands to arduinoecho command to serial port in LinuxRead/Write on Serial Port in Windows Universal PlatformReading serial commands takes too much timeProblem with passing constantly reading serial buffer data to another class






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








2















I'm pretty sure this question should have been asked before, but I can't find the answer. I want to read the content of the serial buffer and echo it to the console / terminal / standard output.




Requirements:



  1. CMD / batch commands, no powershell

  2. it must be a oneliner

  3. preferably using copy, type, more and other simple commands like these.


Attempts:



A. First assuming I have set the parameters:



mode COM7:9600,N,8,1,P


Then from here I have tried



copy COM7 CON


and



type COM7


but it just doesn't return anything.



B. Also answers on this page are for copying the content of the serial buffer to a file, but I need to print it to the terminal or at least store it in a variable.



C. From here I also tried:



set /P "var=" < COM7 & echo %var%


but it just returns %var% obviously not reading the buffer. Adding the cmd /V:ON /C at the beginning of the above command also did not help.



D. from this page



copy COM7 > CON


and



copy COM7 2>&1


and



copy COM7 | more


all led to the error:




Access is denied.
0 file(s) copied.





I would appreciate if you could help me find the right command. Thanks for your help in advance.










share|improve this question

















  • 1





    I'm afraid I can't test on my computer. Anyway, variant A. seems reasonable to me, variant C. as well; variant D. however seems to be useless as there is no copy destination given (when copying files, copy uses the original file name together with the current directory as the default dest., but when a device like com# is given, it might just mirror the data back, like copy con mirrors back to con). Nevertheless, all these commands need to receive some end marker to terminate (end-of-file, ASCII 26, Ctrl+Z, and for set /P, end-of-line too; perhaps a null byte might work too?)...

    – aschipfl
    Mar 22 at 0:02












  • @aschipfl so if I have understood you correctly, A and C are the right direction. Would you be kind to elaborate?

    – Foad
    Mar 22 at 0:05






  • 2





    As I said, I can't test it, so it's a bit difficult. I don't know where the Access denied. message should come from (by the way, does this only relate to attempt D.?). Anyway, variant A. is of correct syntax at least. Variant C. cannot work as written, since echo %var% returns the value of var present before the whole line executes (sorry, I forgot this before); you could use set /P "var=" < COM7 & call echo %^var%, or enable delayed expansion by running cmd with the /V option. But all relies on terminated text data (end-of-file, etc.).

    – aschipfl
    Mar 22 at 0:16






  • 1





    N. B.: You could also try more < com7...

    – aschipfl
    Mar 22 at 0:16






  • 1





    @Foad Does the other computer have com7 enabled? if not, find out which com it uses.

    – Gerhard Barnard
    Mar 22 at 12:05

















2















I'm pretty sure this question should have been asked before, but I can't find the answer. I want to read the content of the serial buffer and echo it to the console / terminal / standard output.




Requirements:



  1. CMD / batch commands, no powershell

  2. it must be a oneliner

  3. preferably using copy, type, more and other simple commands like these.


Attempts:



A. First assuming I have set the parameters:



mode COM7:9600,N,8,1,P


Then from here I have tried



copy COM7 CON


and



type COM7


but it just doesn't return anything.



B. Also answers on this page are for copying the content of the serial buffer to a file, but I need to print it to the terminal or at least store it in a variable.



C. From here I also tried:



set /P "var=" < COM7 & echo %var%


but it just returns %var% obviously not reading the buffer. Adding the cmd /V:ON /C at the beginning of the above command also did not help.



D. from this page



copy COM7 > CON


and



copy COM7 2>&1


and



copy COM7 | more


all led to the error:




Access is denied.
0 file(s) copied.





I would appreciate if you could help me find the right command. Thanks for your help in advance.










share|improve this question

















  • 1





    I'm afraid I can't test on my computer. Anyway, variant A. seems reasonable to me, variant C. as well; variant D. however seems to be useless as there is no copy destination given (when copying files, copy uses the original file name together with the current directory as the default dest., but when a device like com# is given, it might just mirror the data back, like copy con mirrors back to con). Nevertheless, all these commands need to receive some end marker to terminate (end-of-file, ASCII 26, Ctrl+Z, and for set /P, end-of-line too; perhaps a null byte might work too?)...

    – aschipfl
    Mar 22 at 0:02












  • @aschipfl so if I have understood you correctly, A and C are the right direction. Would you be kind to elaborate?

    – Foad
    Mar 22 at 0:05






  • 2





    As I said, I can't test it, so it's a bit difficult. I don't know where the Access denied. message should come from (by the way, does this only relate to attempt D.?). Anyway, variant A. is of correct syntax at least. Variant C. cannot work as written, since echo %var% returns the value of var present before the whole line executes (sorry, I forgot this before); you could use set /P "var=" < COM7 & call echo %^var%, or enable delayed expansion by running cmd with the /V option. But all relies on terminated text data (end-of-file, etc.).

    – aschipfl
    Mar 22 at 0:16






  • 1





    N. B.: You could also try more < com7...

    – aschipfl
    Mar 22 at 0:16






  • 1





    @Foad Does the other computer have com7 enabled? if not, find out which com it uses.

    – Gerhard Barnard
    Mar 22 at 12:05













2












2








2


1






I'm pretty sure this question should have been asked before, but I can't find the answer. I want to read the content of the serial buffer and echo it to the console / terminal / standard output.




Requirements:



  1. CMD / batch commands, no powershell

  2. it must be a oneliner

  3. preferably using copy, type, more and other simple commands like these.


Attempts:



A. First assuming I have set the parameters:



mode COM7:9600,N,8,1,P


Then from here I have tried



copy COM7 CON


and



type COM7


but it just doesn't return anything.



B. Also answers on this page are for copying the content of the serial buffer to a file, but I need to print it to the terminal or at least store it in a variable.



C. From here I also tried:



set /P "var=" < COM7 & echo %var%


but it just returns %var% obviously not reading the buffer. Adding the cmd /V:ON /C at the beginning of the above command also did not help.



D. from this page



copy COM7 > CON


and



copy COM7 2>&1


and



copy COM7 | more


all led to the error:




Access is denied.
0 file(s) copied.





I would appreciate if you could help me find the right command. Thanks for your help in advance.










share|improve this question














I'm pretty sure this question should have been asked before, but I can't find the answer. I want to read the content of the serial buffer and echo it to the console / terminal / standard output.




Requirements:



  1. CMD / batch commands, no powershell

  2. it must be a oneliner

  3. preferably using copy, type, more and other simple commands like these.


Attempts:



A. First assuming I have set the parameters:



mode COM7:9600,N,8,1,P


Then from here I have tried



copy COM7 CON


and



type COM7


but it just doesn't return anything.



B. Also answers on this page are for copying the content of the serial buffer to a file, but I need to print it to the terminal or at least store it in a variable.



C. From here I also tried:



set /P "var=" < COM7 & echo %var%


but it just returns %var% obviously not reading the buffer. Adding the cmd /V:ON /C at the beginning of the above command also did not help.



D. from this page



copy COM7 > CON


and



copy COM7 2>&1


and



copy COM7 | more


all led to the error:




Access is denied.
0 file(s) copied.





I would appreciate if you could help me find the right command. Thanks for your help in advance.







windows batch-file cmd serial-port serial-communication






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 21 at 23:03









FoadFoad

1,78321335




1,78321335







  • 1





    I'm afraid I can't test on my computer. Anyway, variant A. seems reasonable to me, variant C. as well; variant D. however seems to be useless as there is no copy destination given (when copying files, copy uses the original file name together with the current directory as the default dest., but when a device like com# is given, it might just mirror the data back, like copy con mirrors back to con). Nevertheless, all these commands need to receive some end marker to terminate (end-of-file, ASCII 26, Ctrl+Z, and for set /P, end-of-line too; perhaps a null byte might work too?)...

    – aschipfl
    Mar 22 at 0:02












  • @aschipfl so if I have understood you correctly, A and C are the right direction. Would you be kind to elaborate?

    – Foad
    Mar 22 at 0:05






  • 2





    As I said, I can't test it, so it's a bit difficult. I don't know where the Access denied. message should come from (by the way, does this only relate to attempt D.?). Anyway, variant A. is of correct syntax at least. Variant C. cannot work as written, since echo %var% returns the value of var present before the whole line executes (sorry, I forgot this before); you could use set /P "var=" < COM7 & call echo %^var%, or enable delayed expansion by running cmd with the /V option. But all relies on terminated text data (end-of-file, etc.).

    – aschipfl
    Mar 22 at 0:16






  • 1





    N. B.: You could also try more < com7...

    – aschipfl
    Mar 22 at 0:16






  • 1





    @Foad Does the other computer have com7 enabled? if not, find out which com it uses.

    – Gerhard Barnard
    Mar 22 at 12:05












  • 1





    I'm afraid I can't test on my computer. Anyway, variant A. seems reasonable to me, variant C. as well; variant D. however seems to be useless as there is no copy destination given (when copying files, copy uses the original file name together with the current directory as the default dest., but when a device like com# is given, it might just mirror the data back, like copy con mirrors back to con). Nevertheless, all these commands need to receive some end marker to terminate (end-of-file, ASCII 26, Ctrl+Z, and for set /P, end-of-line too; perhaps a null byte might work too?)...

    – aschipfl
    Mar 22 at 0:02












  • @aschipfl so if I have understood you correctly, A and C are the right direction. Would you be kind to elaborate?

    – Foad
    Mar 22 at 0:05






  • 2





    As I said, I can't test it, so it's a bit difficult. I don't know where the Access denied. message should come from (by the way, does this only relate to attempt D.?). Anyway, variant A. is of correct syntax at least. Variant C. cannot work as written, since echo %var% returns the value of var present before the whole line executes (sorry, I forgot this before); you could use set /P "var=" < COM7 & call echo %^var%, or enable delayed expansion by running cmd with the /V option. But all relies on terminated text data (end-of-file, etc.).

    – aschipfl
    Mar 22 at 0:16






  • 1





    N. B.: You could also try more < com7...

    – aschipfl
    Mar 22 at 0:16






  • 1





    @Foad Does the other computer have com7 enabled? if not, find out which com it uses.

    – Gerhard Barnard
    Mar 22 at 12:05







1




1





I'm afraid I can't test on my computer. Anyway, variant A. seems reasonable to me, variant C. as well; variant D. however seems to be useless as there is no copy destination given (when copying files, copy uses the original file name together with the current directory as the default dest., but when a device like com# is given, it might just mirror the data back, like copy con mirrors back to con). Nevertheless, all these commands need to receive some end marker to terminate (end-of-file, ASCII 26, Ctrl+Z, and for set /P, end-of-line too; perhaps a null byte might work too?)...

– aschipfl
Mar 22 at 0:02






I'm afraid I can't test on my computer. Anyway, variant A. seems reasonable to me, variant C. as well; variant D. however seems to be useless as there is no copy destination given (when copying files, copy uses the original file name together with the current directory as the default dest., but when a device like com# is given, it might just mirror the data back, like copy con mirrors back to con). Nevertheless, all these commands need to receive some end marker to terminate (end-of-file, ASCII 26, Ctrl+Z, and for set /P, end-of-line too; perhaps a null byte might work too?)...

– aschipfl
Mar 22 at 0:02














@aschipfl so if I have understood you correctly, A and C are the right direction. Would you be kind to elaborate?

– Foad
Mar 22 at 0:05





@aschipfl so if I have understood you correctly, A and C are the right direction. Would you be kind to elaborate?

– Foad
Mar 22 at 0:05




2




2





As I said, I can't test it, so it's a bit difficult. I don't know where the Access denied. message should come from (by the way, does this only relate to attempt D.?). Anyway, variant A. is of correct syntax at least. Variant C. cannot work as written, since echo %var% returns the value of var present before the whole line executes (sorry, I forgot this before); you could use set /P "var=" < COM7 & call echo %^var%, or enable delayed expansion by running cmd with the /V option. But all relies on terminated text data (end-of-file, etc.).

– aschipfl
Mar 22 at 0:16





As I said, I can't test it, so it's a bit difficult. I don't know where the Access denied. message should come from (by the way, does this only relate to attempt D.?). Anyway, variant A. is of correct syntax at least. Variant C. cannot work as written, since echo %var% returns the value of var present before the whole line executes (sorry, I forgot this before); you could use set /P "var=" < COM7 & call echo %^var%, or enable delayed expansion by running cmd with the /V option. But all relies on terminated text data (end-of-file, etc.).

– aschipfl
Mar 22 at 0:16




1




1





N. B.: You could also try more < com7...

– aschipfl
Mar 22 at 0:16





N. B.: You could also try more < com7...

– aschipfl
Mar 22 at 0:16




1




1





@Foad Does the other computer have com7 enabled? if not, find out which com it uses.

– Gerhard Barnard
Mar 22 at 12:05





@Foad Does the other computer have com7 enabled? if not, find out which com it uses.

– Gerhard Barnard
Mar 22 at 12:05












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55290515%2foneliner-to-get-read-the-serial-buffer-and-return-the-value-to-the-standard-ou%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55290515%2foneliner-to-get-read-the-serial-buffer-and-return-the-value-to-the-standard-ou%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현