This is more of a curiosity question then a support question so I hope it's ok to post it here. When I install the PLC program, what am I actually doing?
I need to modify the PLC program to work on my machine. So I've been taking a crash course in Centroids PLC programing. All pretty simple stuff. Except when it comes to uploading/programming/installing the binary.
If I were to program an arduino, or back in my misspent youth, an arm microcontroller, I would need to upload the binary to the bootloader on the microcontroller in order to install my code. Here, it seems like I am coping all of the files (macros, source, and source/binary hybrid) into the cnc software root directory. If this is the case, it leads me with a couple of questions.
Can I just write and compile the plc program right in the cnc software's directory and forgo the installation program? Yes, I know, I will need to implement my own backups or version control.
Is the cnc programing uploading the new plc code to the plc? If so, why do I need to power cycle the hardware? If not, then how does the code get to the hardware. Or is there no user editable code on the hardware. If that is true, then does that mean the PLC is virtual? And that would open a whole basket of questions.
PLC program installed where?
Moderator: cnckeith
Re: PLC program installed where?
The output of the compiler is still a text file, but it contains the compiled hex codes (as well as a copy of the source).
The control will load and run whatever compiled PLC program it finds in the file named "mpu.plc" in the control software directory on the hard drive: either c:\cncm\ for a mill control, or c:\cnct\ for a lathe control.
So, as long as you either compile directly to "mpu.plc", or you copy the compiler output to "mpu.plc", then that is the PLC program the control will load on the next startup.
The actual "load" process is done by the CNC12 software. CNC12 strips out the comments (e.g. the copy of the source lines) and transmits the hex codes to the motion control processor.
The control will load and run whatever compiled PLC program it finds in the file named "mpu.plc" in the control software directory on the hard drive: either c:\cncm\ for a mill control, or c:\cnct\ for a lathe control.
So, as long as you either compile directly to "mpu.plc", or you copy the compiler output to "mpu.plc", then that is the PLC program the control will load on the next startup.
The actual "load" process is done by the CNC12 software. CNC12 strips out the comments (e.g. the copy of the source lines) and transmits the hex codes to the motion control processor.
-
- Posts: 24
- Joined: Sun Mar 28, 2021 12:06 am
- Acorn CNC Controller: No
- Allin1DC CNC Controller: No
- Oak CNC controller: Yes
- CNC Control System Serial Number: none
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Re: PLC program installed where?
Hex, binary. It's all executable. LOL
Ahh, ok. That makes sense. I guess it loads the software at each startup. That would make sense since the gui and the plc would need to be on the same page. Atleast , I assume they need to be on the same page.
Thanks.
Ahh, ok. That makes sense. I guess it loads the software at each startup. That would make sense since the gui and the plc would need to be on the same page. Atleast , I assume they need to be on the same page.
Thanks.
-
- Posts: 395
- Joined: Thu Dec 03, 2020 4:54 am
- Acorn CNC Controller: No
- Allin1DC CNC Controller: No
- Oak CNC controller: Yes
- CNC Control System Serial Number: none
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Re: PLC program installed where?
Just to clarify "the next startup" means the next time the PLC is powered up, not the next time CNC12 starts. So, if you change the PLC program, then just restart CNC12, it will warn that the PLC program is different and try install it if you press a key. BUT, it doesn't always work correctly as I found it. Need to power cycle the PLC. It does update the executable code as your new changes might work but some bits will behave funny. Presumably this is due to random memory values already in the PLC or something like that. Anyway, downloading PLC code doesn't reset the PLC, that is all I wanted to say!
-
- Posts: 24
- Joined: Sun Mar 28, 2021 12:06 am
- Acorn CNC Controller: No
- Allin1DC CNC Controller: No
- Oak CNC controller: Yes
- CNC Control System Serial Number: none
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Re: PLC program installed where?
I'm terribly sorry. I meant to respond, but then I just forgot. While I did know about the requirement to power cycle the PLC, it is good information. Thanks. Though, it does confuse me as to why. Would it have been that hard to add a software reset? Or atleast, reinitialize volatile memory? I guess there could be a good reason for not doing this, but I'm going to call it a bug till informed otherwise.ashesman wrote: ↑Wed Jul 07, 2021 3:53 am Just to clarify "the next startup" means the next time the PLC is powered up, not the next time CNC12 starts. So, if you change the PLC program, then just restart CNC12, it will warn that the PLC program is different and try install it if you press a key. BUT, it doesn't always work correctly as I found it. Need to power cycle the PLC. It does update the executable code as your new changes might work but some bits will behave funny. Presumably this is due to random memory values already in the PLC or something like that. Anyway, downloading PLC code doesn't reset the PLC, that is all I wanted to say!
-
- Posts: 395
- Joined: Thu Dec 03, 2020 4:54 am
- Acorn CNC Controller: No
- Allin1DC CNC Controller: No
- Oak CNC controller: Yes
- CNC Control System Serial Number: none
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Re: PLC program installed where?
I couldn't agree more! Maybe there is a possibility that the machine could do something dangerous during the reset, I don't know! Just issue a full hardware reset if that is what is required just like when you power cycle. Cant be any more dangerous than a power cycle right?
Or when the message that says "PLC program changed, press F1....", just ask if you want to also reset.