Need help with my TailStock code. I'm using the tailstock in/out button in the vcp to set the tailstock and run a timer that shuts the output off and sets a memory bit. I'm stumped how I should set the closing code for the same button. I have it look for the memory bit set by the end of the open code but not sure how I should go about setting the IF requirements to set the close sequence. I could just use two different buttons in the vcp to do this but I'm trying to keep it to just one. I'm sure there's an easier way
TailStockStage
;==============================================================================
IF SkinTailStock_M THEN (TailStockOpenPD)
IF (TailStockOpenPD && !SV_PROGRAM_RUNNING && !TailStockActived) || (M32 && SV_PROGRAM_RUNNING)
THEN SET TailStockActived, SET TailStockLED, SET T28
IF T28 > 3000 THEN RST TailStockActived, SET MEM360, RST T28
IF MEM360 THEN (TailStockClosedPD)
IF (TailStockClosedPD && !SV_PROGRAM_RUNNING && ??????) || (M32 && SV_PROGRAM_RUNNING)
THEN SET TailStockDeactivated, SET T28
IF T28 > 3000 THEN RST TailStockDeactivated, RST TailStockLED, RST MEM360, RST T28
I am unsure exactly what you are trying to accomplish? Usually there are two ways to do this, A one output system where when energized the tailstock will extend and keep pressure on the part. Turn off the output and the tailstock retracts. Another system is with 2 outputs, Set one output to extend and another output to retract the tailstock (Sometimes these types also have sensors used to turn off the output at determined locations and ect).
If i could have some more information on how your tailstock works i may be able to provide much better help with this.
(We pride ourselves on providing timely solid technical support but, without good information we may not be able to help and/or reply until such information is posted.)
It has two outputs for the hydraulics. One to extend and one to retract the tailstock. What I wanted to do is use one button in the vcp to flipflop the outputs and shut them off with a timer when the button is toggled each time. Ie
vcpbutton- turn output 1 on, wait 3 seconds and turn off
vcpbutton- turn output 2 on , wait 3 seconds and turn off
The solenoid for the hydraulics holds pressure in the last position it was in so Im having the output switch off to keep the coil from staying on constantly.
Last edited by Obsidian on Wed Nov 25, 2020 1:42 pm, edited 1 time in total.
You can try the following code, this should give you what you want. You may want to remove M32/M33 unless you are planning on creating custom macros as well. I used Aux11LED as the "State" Memory bit, but ofcourse can be changed to an actual memorybit easily.
TailStockExtend IS OUT1
TailStockRetract IS OUT2
TailStock_T IS T33
;==============================================================================
TailStockStage
;==============================================================================
IF True THEN TailStock_T = 3000
IF SkinTailStock_M THEN (TailStockPD)
IF (TailStockPD && !SV_PROGRAM_RUNNING && !Aux11LED && !TailStockRetract) || (M32 && SV_PROGRAM_RUNNING)
THEN SET TailStockExtend, SET Aux11LED, SET TailStock_T
IF (TailStockPD && !SV_PROGRAM_RUNNING && Aux11LED && !TailStockExtend) || (M33 && SV_PROGRAM_RUNNING)
THEN SET TailStockRetract, RST Aux11LED, SET TailStock_T
IF TailStock_T THEN RST TailStockExtend, RST TailStockRetract, RST TailStock_T
(We pride ourselves on providing timely solid technical support but, without good information we may not be able to help and/or reply until such information is posted.)