![]() |
Forum Index : Microcontroller and PC projects : MMEdit Time Set & Run Macro
Author | Message | ||||
Chopperp![]() Guru ![]() Joined: 03/01/2018 Location: AustraliaPosts: 1097 |
@TassyJim Could you please guide or show me how to create a Macro to set the time & date on a CMM, then run the program. Your Set Time Macro works OK (Top of the list) & I got a RUN macro to go but I would like to combine the two if possible. I am not a Macro man!! Thanks Brian ChopperP |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
The help file is missing two codes this macro: date$= "\d"\ntime$="\h"\nrun\n gives: > date$= "03/02/2019" > time$="11:01:58" > run The quotes are there because MMBasic needs them around the date and time. some setups might require \r\n instead of just \n and don't forget the final \n If you want a ctrl-c first, add \003 to the start although you might need delays. Delays weren't working very well last time I played with them. Something else I must get back to. Jim VK7JH MMedit |
||||
Chopperp![]() Guru ![]() Joined: 03/01/2018 Location: AustraliaPosts: 1097 |
Hi Jim Thanks for that. Unfortunately I can only get the first part of the macro to work. Date$ or Time$ if I delete the date$ bit etc Not sure of the format for delay or how to add it. Went silly when I did try some things. (just printed single characters) Remember, I am not a MACRO man & this is for a CMM. (Took me ages to work out what a \ntime$ & \nrun was....) I also don't know what ctrl-c does or why you would need \003 More help needed please. Brian ChopperP |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
ctrl-c stops a running program and returns to the command prompt. ctrl-c is chr$(3) Because I didn't have an escape sequence for crtl-c, you can use the one for any chr$ MMEdit uses it a lot to make sure the 'mite is at the command prompt. Try putting everything on one line: date$ = "\d" : time$ = "\h" : run\n The spaces are just there for clarity. There do no harm. There wasn't enough time between commands. By putting it all on one line (with the :), MMBasic reads the full line then processes each part in turn at it's own pace. Jim VK7JH MMedit |
||||
Chopperp![]() Guru ![]() Joined: 03/01/2018 Location: AustraliaPosts: 1097 |
Thanks very much Jim, that worked. Makes more sense now. Was getting a tad frustrated. Brian ChopperP |
||||
Chopperp![]() Guru ![]() Joined: 03/01/2018 Location: AustraliaPosts: 1097 |
Hi Jim again. I had some fun trying to save Macros. The Description would disappear, & also the test Titles kept changing & old test Macros kept reappearing. Eventually tracked the problem down to a corrupt Macro.inf file. Had about 13-14 entries instead of 10. Manually editing, saving it & rerunning MM Edit, seemed to fix the problems. Brian ChopperP |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |