PDA

View Full Version : Final stages of programming a new machine... would like a critical eye on my program



rossfree
- 25th November 2012, 11:58
Hi all,

I'm in the final stages of programming a semi-automated machine I designed for work. I'm a mechanical designer by trade but hobby a bit in electronics and programming. I talked my boss into letting me design a multi-function circuit board to run the machine instead of using PLC's. When I jump in, I go right for the deep end!

This is the longest program I've ever written in PBP. I've occasionally programmed small hobby type stuff over the years with long spans of time between projects so I feel like I start from square one every time I get back into it, trying to relearn the most basic of program statements.

I'm proud of the circuit board. It has eighteen 24vdc driving outputs we used to control pneumatic solenoids and relays, two thermocouple inputs, two 4-20ma outputs, four dedicated (powered) slotted-sensor inputs, three potentiometer inputs, eight digital inputs, four on-board pololu stepper controllers (for running small stepper motors), three on-board push-buttons, grey code encoder and LCD. It will run a small machine nicely. Actual board design credit goes to my friend Ken. My vision, his hard work.

I would love to post the code but it's long and I'm not sure there would be much interest on this forum to read through it. Still, I would love to hear from other more skillful programmers how they would clean it up or do things differently. I do not consider myself as anything more than a beginner. There is know one around me that can critique what I have done so that I can learn and become better. You can't hurt my feelings. I know i am a poor programmer. But hey... I also know that this machine is working so I have that to be happy about.

Is there any interest in looking over my program?

Regards!

Ross

mackrackit
- 25th November 2012, 21:15
If the code/project is working and the code is well commented it sounds like a great job!!!

Ioannis
- 26th November 2012, 08:37
Sure, go ahead. Comments are needed as Dave stated, so we do not try to decrypt your thoughts.

Ioannis

rossfree
- 26th November 2012, 11:20
Thanks guys. I will upload later today.

Came to a stopping point last night. The machine is not finished but it runs and runs well. Still have operator control menus to write and a couple more safety things but I'm very pleased. I started this programming straining to remember how to make it "blink". Ha! Nine days later, over a hundred hours, one day off for Thanksgiving, and twenty pages of code. Bless you Microcode Studio! I've never used so many variables. I am quite certain the code could be a third it's length with the right programmer.

Upload later today,

Ross