1671
Brains Development / Re: Suffering From Brain Damage....
« on: August 19, 2008, 12:39:19 AM »
OK, *maybe* I've answered my own question, but I'm not at the machine, so can't test it right now. Here's an approach I think should work:
;; If OEM4 button is pressed, and current Jog % is below 30%, then set V0 to 30%
V0 = (~OEMInput4 && (Jog%DRO < 30)) * 30
;; If OEM4 button is pressed, and current Jog % is between 30% and 50%, then set V0 to 50%
V0 = (~OEMInput4 && (Jog%DRO >= 30) && (Jog%DRO < 50)) * 50
;; If OEM4 button is pressed, and current Jog % is between 50% and 75%, then set V0 to 75%
V0 = (~OEMInput4 && (Jog%DRO >= 50) && (Jog%DRO < 75)) * 75
;; If OEM4 button is pressed, and current Jog % is between 75% and 100%, then set V0 to 100%
V0 = (~OEMInput4 && (Jog%DRO >= 50) && (Jog%DRO < 75)) * 100
;; If OEM4 button is pressed, and current Jog % is 100, then set V0 to 10%
V0 = (~OEMInput4 && (Jog%DRO = 100)) * 10
;; If OEM4 button is *not* being pressed, copy V0 to Jog % DRO
Jog%DRO = OEMInput4 * V0
I hope this makes sense. Is there a better way to do this?
I don't suppose the format of the brain files is documented? I'd love to write a Perl parser that would take a text-based brain description (similar to the above) and output a binary brain file.
Regards,
Ray L.
;; If OEM4 button is pressed, and current Jog % is below 30%, then set V0 to 30%
V0 = (~OEMInput4 && (Jog%DRO < 30)) * 30
;; If OEM4 button is pressed, and current Jog % is between 30% and 50%, then set V0 to 50%
V0 = (~OEMInput4 && (Jog%DRO >= 30) && (Jog%DRO < 50)) * 50
;; If OEM4 button is pressed, and current Jog % is between 50% and 75%, then set V0 to 75%
V0 = (~OEMInput4 && (Jog%DRO >= 50) && (Jog%DRO < 75)) * 75
;; If OEM4 button is pressed, and current Jog % is between 75% and 100%, then set V0 to 100%
V0 = (~OEMInput4 && (Jog%DRO >= 50) && (Jog%DRO < 75)) * 100
;; If OEM4 button is pressed, and current Jog % is 100, then set V0 to 10%
V0 = (~OEMInput4 && (Jog%DRO = 100)) * 10
;; If OEM4 button is *not* being pressed, copy V0 to Jog % DRO
Jog%DRO = OEMInput4 * V0
I hope this makes sense. Is there a better way to do this?
I don't suppose the format of the brain files is documented? I'd love to write a Perl parser that would take a text-based brain description (similar to the above) and output a binary brain file.
Regards,
Ray L.