![]() |
Forum Index : Microcontroller and PC projects : Tera Term instruction required
Page 1 of 2 ![]() ![]() |
|||||
Author | Message | ||||
Chrisk![]() Senior Member ![]() Joined: 21/12/2014 Location: AustraliaPosts: 122 |
Hi guys Every month I need to transfer and delete 30 or so files from my maximite all with the same extension. I am currently using MM Edit but this requires me to transfer and then delete these files individually. Could I use Tera Term and what would be the command line for a copy and then erase of all 30. Regards Chris K |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
MMBasic doesn't have a bulk transfer option so you will have to write a macro for TeraTerm. I assume (silly thing to do) that the file names are based on the date so you should be able to construct the file names in TeraTerm macro language. Jim VK7JH MMedit |
||||
Chopperp![]() Guru ![]() Joined: 03/01/2018 Location: AustraliaPosts: 1097 |
For my CMM SD files, I have a hard switch which along with software stops all SD card activity & closes files. I then remove the SD card, bung it into a laptop & do the file transfer & delete stuff. The card then gets put back into the CMM & switch pressed again to resume SD card activity. My main write period is every 5 mins & I'm also careful that there is no other incidental stuff being recorded. No need to stop the CMM. Brian Edit, I should add that a Flag is set so that if the card is not there, no write attempts are made. Flag cleared when card re-inserted & switch pressed. ChopperP |
||||
Turbo46![]() Guru ![]() Joined: 24/12/2017 Location: AustraliaPosts: 1642 |
Another approach would be to write a program for the Maximite (or extend the existing one) to transfer the files via a serial link to a PC running a program in written in MMBasic for DOS. You should of course verify that the files have been saved and are correct before deleting (KILLing) the files on the Maximite - either manually or by program. Bill Keep safe. Live long and prosper. |
||||
Chrisk![]() Senior Member ![]() Joined: 21/12/2014 Location: AustraliaPosts: 122 |
Thanks for your replies guys. The CMM is in a greenhouse within a weather poof case so it isn't so easy to access the SD card every month. I had thought of transferring data via a serial link but I thought that a bulk transfer every month using MM Edit would suffice although it is a little slow and painful when you have the 30 files. Tassy Jim - yes the file names are based on the date so it sounds like the macro would be the best way to go. Now my question is has anyone got an example of such a macro that I could adapt? ![]() Cheers Chris K |
||||
Turbo46![]() Guru ![]() Joined: 24/12/2017 Location: AustraliaPosts: 1642 |
I've never looked at them but this might help. Bill Keep safe. Live long and prosper. |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
You will have to play around a bit to get your file names correct but this "should" work. send #3 n = 0 do n = n + 1 int2str xday n thisfile = "test" strconcat thisfile xday strconcat thisfile ".txt" sendln "XMODEM SEND " #34 thisfile #34 pause 3 recfile = "C:\Users\documents\" strconcat recfile thisfile xmodemrecv recfile 1 1 pause 10 loop while result = 1 Timeouts take a very long time but once you have the system working, it will only time out when you run out of days in the month. Jim VK7JH MMedit |
||||
Chrisk![]() Senior Member ![]() Joined: 21/12/2014 Location: AustraliaPosts: 122 |
Thanks Jim and Bill. Now a silly question, where would I run this program from? The only thing I have used Tera Term for is ^C, close #1, load files and run. Chris K |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Save the script with an extension of .ttl I put mine in the TeraTerm folder To run it: In TeraTerm, Control/Macro The TeraTerm help file has a full set of commands for TTL in it. Jim VK7JH MMedit |
||||
Chrisk![]() Senior Member ![]() Joined: 21/12/2014 Location: AustraliaPosts: 122 |
Hi Guys Jim, finally got around to trying out the short program however not even the first file is transferred. I created files test1 - test6 and placed them on the micromite. What appears on the screen after timing out is: > XMODEM SEND "test1.txt" Error: Remote did not respond > Any ideas? Chris K |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3378 |
In Teraterm, did you do File, Transfer, XMODEM, Receive? PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Assuming he is running it with the .ttl script file, that should have happened automatically. Can you show us the complete ttl file? Jim VK7JH MMedit |
||||
Chrisk![]() Senior Member ![]() Joined: 21/12/2014 Location: AustraliaPosts: 122 |
Hi Guys/Jim Thanks for your quick response. It is virtually the same as Jim had written above except for the location where I left it as c:\Users Here it is below. send #3 n = 0 do n = n + 1 int2str xday n thisfile = "test" strconcat thisfile xday strconcat thisfile ".txt" sendln "XMODEM SEND " #34 thisfile #34 pause 3 recfile = "C:\Users\" strconcat recfile thisfile xmodemrecv recfile 1 1 pause 10 loop while result = 1 |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
try a longer pause instead of pause 3, try pause 50 or more to start with. VK7JH MMedit |
||||
Chrisk![]() Senior Member ![]() Joined: 21/12/2014 Location: AustraliaPosts: 122 |
Hi Jim I have tried 60 and then 80, still the same response. I have carried out everything as you requested. Run from Control/Macro It runs immediately to give the first line XMODEM SEND "test1.txt" then after quite a few seconds up comes the error message Error: Remote did not respond. I am using Tera Term version 4.86 would that be a problem? Regards Chris K ![]() |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
pause is in seconds not ms as I thought. try pause 1 If I find time, I will try and set up a test but it might be a while. Jim VK7JH MMedit |
||||
Chrisk![]() Senior Member ![]() Joined: 21/12/2014 Location: AustraliaPosts: 122 |
Thanks Jim No rush, I can always do it using MMedit and that is only once a month. Chris K ![]() |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Try updating your TeraTerm. I just tested on V4.94 and it transferred 6 consecutive files without problems. I used an Armite H7 as the mite but all versions that allow file transfers should work the same. > > XMODEM SEND "test1.txt" > XMODEM SEND "test2.txt" > XMODEM SEND "test3.txt" > XMODEM SEND "test4.txt" > XMODEM SEND "test5.txt" > XMODEM SEND "test6.txt" > XMODEM SEND "test7.txt" Error: Could not find the file After each file, a dialog box flashed briefly and on the final file (which doesn't exist), the save file dialog stayed up. I cancelled this dialog and the macro completed as it should. send #3 n = 0 do n = n + 1 int2str xday n thisfile = "test" strconcat thisfile xday strconcat thisfile ".txt" sendln "XMODEM SEND " #34 thisfile #34 pause 3 recfile = "C:\Users\Jim\Documents\" strconcat recfile thisfile xmodemrecv recfile 1 1 pause 10 loop while result = 1 Make sure that you are saving to a location that has write permissions. Jim VK7JH MMedit |
||||
Chrisk![]() Senior Member ![]() Joined: 21/12/2014 Location: AustraliaPosts: 122 |
Hi Jim Yep got a new version of Tera Term and also looked at the location where I was writing the files. ![]() Played around with the pause values and found the second pause at one(1) provided the same error. However tried 5 and it did work correctly. Sorry to have put you to so much trouble and thank you again. Kind regards Chris K ![]() ![]() ![]() |
||||
Chrisk![]() Senior Member ![]() Joined: 21/12/2014 Location: AustraliaPosts: 122 |
Hi again How does one do the equivalent of MMBasic's INPUT ["prompt string$";] store the string as a variable and then be able to print it (to verify it is correct) in a Tera Term macro. Chris K |
||||
Page 1 of 2 ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |