Sie sind auf Seite 1von 10

'----------------------------------------------------------------------

' Created: Wednesday, February 18, 2009


'
'0 Description: digital commands for
'
'----------------------------------------------------------------------
'----------------------------------------------------------------------
' HEAD2 - STATUS - The pipe is clamped
' TAGS: DOFlag_HEAD_Clamp
' DIFlag_PRES_Clamp
' STAT_HEAD_Clamp
'----------------------------------------------------------------------
LD_BOOL DOFlag_HEAD2_Clamp
AND DIFlag_HEAD2_PresClamp
S STAT_HEAD2_Clamp
LDN_BOOL DOFlag_HEAD2_Clamp
ANDN DIFlag_HEAD2_PresClamp
R STAT_HEAD2_Clamp
'---------------------------------------------------------------------
' HEAD2 - STATUS - X axis clamp disable command - disable X axis when
' head is clamped to the pipe
' TAGS: DOFlag_HEAD_Clamp
' STAT_HEAD_Clamp
' CMD_XClamp_Disable
'---------------------------------------------------------------------
LD_BOOL DOFlag_HEAD2_Clamp
S CMD_X2_Disable
LDN_BOOL STAT_HEAD2_Clamp
R CMD_X2_Disable
'---------------------------------------------------------------------
' HEAD2 - STATUS - An index has completed
' TAGS: DIFlag_HEAD_InPos
' STAT_HEAD_IdxDone
'
' LOGIC: on rising edge of index command, reset the index done status
' On a falling edge of the head in position prox switch,
' assume that the disc has moved and has now settled back
' to one of the index marker holes.
'----------------------------------------------------------------------
LDN_BOOL DIFlag_HEAD2_Load
ANDN DIFlag_HEAD2_InPos
OR DIFlag_HEAD2_InPos
ST_BOOL STAT_HEAD2_IdxDone
'---------------------------------------------------------------------
' HEAD2 - STATUS - Update the chip in position status
' TAGS: STAT_HEAD_IdxDone
' OS_HEAD_IdxDone
' STAT_DISC_x
' DIFlag_HEAD_Load
'
' LOGIC: When index command is active, count pulses on the chip
' detection prox switch. If the count is > 1, there was no
' chip in the tray. If the count = 1, there is a chip in
' the tray. If the count is zero, the tray never moved.
'---------------------------------------------------------------------
LD_BOOL CMD_HEAD2_Index
AND DIFlag_HEAD2_Load
UPCTR(C_HEAD2_DiscCount, CMD_HEAD2_CReset, PRST_Disc_Count)
LDN_BOOL CMD_HEAD2_Index
ST_BOOL CMD_HEAD2_CReset
EQ_INT(C_HEAD2_DiscCount[0], 1)
AND CMD_HEAD2_Index
AND DIFlag_HEAD2_InPos
PT OS_HEAD2_DiscStat
LD_BOOL OS_HEAD2_DiscStat
S STAT_HEAD2_InPos
'---------------------------------------------------------------------
' HEAD2 - STATUS - press a disc into the current hole
'---------------------------------------------------------------------
LD_BOOL DOFlag_HEAD2_Plunge
NT OS_HEAD2_DiscIn
LD_BOOL OS_HEAD2_DiscIn
AND STAT_HEAD2_InPos
JMPCN discin:
S STAT_HEAD2_InHole
MOVE_INT(CALC_HEAD2_Hole_I, 1, TEMP_HEAD2_DIHHole)
MOVE_INT(CALC_Row_I, 1, TEMP_HEAD2_DIHRow)
discin:
NE_INT(CALC_HEAD2_Hole_I, TEMP_HEAD2_DIHHole)
R STAT_HEAD2_InHole
NE_INT(CALC_Row_I, TEMP_HEAD2_DIHRow)
R STAT_HEAD2_InHole

'---------------------------------------------------
'Head 2 - status - press a snap ring into hole

'------------------------------------------------

'---------------------------------------------------------------------
' HEAD2 - STATUS - Update the chip in position status buffer on the
' press side.
' TAGS: DOFlag_HEAD_Plunge
' STAT_DISC_4
'
' LOGIC: If the plunge cylinder is activated for any reason, empty
' out the fourth position
'---------------------------------------------------------------------
LD_BOOL OS_HEAD2_DiscIn
R STAT_HEAD2_InPos
'---------------------------------------------------------------------
' HEAD2 - STATUS - Cylinder head shifted to the left
' TAGS: DOFlag_HEAD_Left
' DIFlag_HEAD_Plug
'----------------------------------------------------------------------
LD_BOOL DOFlag_HEAD2_Left
AND DIFlag_HEAD2_Plug
TMR_TENTHS(T_HEAD2_Left, PRST_HEAD2_Left)
ST_BOOL TBit_HEAD2_Left
LD_BOOL TBit_HEAD2_Left
ST_BOOL STAT_HEAD2_Left
'---------------------------------------------------------------------
' HEAD2 - STATUS - Cylinder head shifted to the right
' TAGS: DOFlag_HEAD_Left
' DIFlag_HEAD_Probe
'----------------------------------------------------------------------
LDN_BOOL DOFlag_HEAD2_Left
AND DIFlag_HEAD2_Test
TMR_TENTHS(T_HEAD2_Right, PRST_HEAD2_Right)
ST_BOOL TBit_HEAD2_Right
LD_BOOL TBit_HEAD2_Right
ST_BOOL STAT_HEAD2_Right

'------------------------------------------------------------
' HEAD2- STATUS - The press cylinder and pressure cylinder
'------------------------------------------------------------
'----------------------------------------------------------------------
' HEAD2 - STATUS - The press cylinder is inserted in the pipe
' TAGS: DOFlag_HEAD_Plunge
' STAT_HEAD_PressDown
'----------------------------------------------------------------------
LD_BOOL DOFlag_HEAD2_Plunge
ANDN DIFlag_HEAD2_Plug
ANDN DIFlag_HEAD2_Test
AND DIFlag_HEAD2_PresPlug
TMR_TENTHS(T_HEAD2_PressDown, PRST_HEAD2_PressDown)
ST_BOOL TBit_HEAD2_PressDown
LD_BOOL TBit_HEAD2_PressDown
ST_BOOL STAT_HEAD2_PressDown
'----------------------------------------------------------------------
' HEAD2 - COMMAND - Permissive to Start HYD2
' TAGS: ALM_ESD
' PERM_HEAD_HydOn
'
'----------------------------------------------------------------------
LDN_BOOL ALM_ESD
ANDN DIFlag_HMI1_LockOut
ST_BOOL PERM_HEAD2_HydOn
'----------------------------------------------------------------------
' HEAD2 - COMMAND - Start and stop hydraulic pump 2
' TAGS: HMICMD_HEAD_HydOn
' PERM_HEAD_HydOn
' HMICMD_HEAD_HydOff
' CMD_HEAD_HydOn
'----------------------------------------------------------------------
LD_BOOL HMICMD_HEAD2_HydOn
S CMD_HEAD2_HydOn
LD_BOOL HMICMD_HEAD2_HydOff
ORN PERM_HEAD2_HydOn
R CMD_HEAD2_HydOn
'----------------------------------------------------------------------
' HEAD2 - COMMAND - Issue DOFlag for hydraulic pump 2
' TAGS: CMD_HYD2_Start
' DOFlag_HYD2_On
'----------------------------------------------------------------------
LD_BOOL CMD_HEAD2_HydOn
ST_BOOL DOFlag_HEAD2_HydOn
'----------------------------------------------------------------------
' HEAD2 - COMMAND - Activate the logic and control power for the Bimba
' TAGS: ALM_ESD
' DOFlag_BIMBA_Power
'
' LOGIC: IF there is no ESD alarm THEN
' Enable Bimba power
'----------------------------------------------------------------------
LDN_BOOL ALM_ESD
ST_BOOL DOFlag_HEAD2_BimbaPwr
'-------------------------------------------------------------------------------
'HEAD2 - Command - Permissive to activate the press cylinder and pressure select
'-------------------------------------------------------------------------------
-

'----------------------------------------------------------------------
' HEAD2 - COMMAND - permissive to activate the press cylinder
' TAGS: STAT_HEAD_IdxDone
' PERM_HEAD_Insert
'----------------------------------------------------------------------
LDN_BOOL DOFlag_HEAD2_Left
ANDN DIFlag_HEAD2_Load
ANDN DIFlag_HEAD2_InPos
OR DOFlag_HEAD2_Left
AND STAT_HEAD2_IdxDone
ANDN STAT_HEAD2_InHole
ANDN DIFlag_HMI1_LockOut
ST_BOOL PERM_HEAD2_Insert
'----------------------------------------------------------------------
' On loss of permissive for head insert, reset HMI manual command
'----------------------------------------------------------------------
LDN_BOOL PERM_HEAD2_Insert
R HMICMD_HEAD2_Insert
'----------------------------------------------------------------------
' HEAD2 - COMMAND - Auto Command to activate the press cylinder for test cycle
' TAGS: AUTO_SEQ_Test
' AUTO_SEQ_Setup
' STAT_HEAD_Clamp
'
' LOGIC: IF .... AUTO_SEQ_Test
' AND NOT AUTO_SEQ_Setup
' AND ... STAT_HEAD_Clamp
' OR(
' IF .... AUTO_SEQ_Press
' AND NOT AUTO_SEQ_Unclamp) THEN
' enable auto_insert command
'----------------------------------------------------------------------
LD_BOOL AUTO_SEQ2_Test
ANDN AUTO_SEQ2_TestUp
OR(
LD_BOOL AUTO_SEQ2_Press ANDN AUTO_SEQ2_PressUp
)
ST_BOOL AUTO_HEAD2_Insert

'-------------------------------------------------------------------------
'HEAD 2- Command - Command to activate the press cylinder, pressure select
'

'-------------------------------------------------------------------------
'----------------------------------------------------------------------
' HEAD2 - COMMAND - Command to activate the press cylinder
' TAGS: HMICMD_HEAD_Insert
' PERM_HEAD_Insert
' CMD_HEAD_Insert
'----------------------------------------------------------------------

LD_BOOL HMICMD_HEAD2_Insert
OR AUTO_HEAD2_Insert
AND PERM_HEAD2_Insert
ST_BOOL CMD_HEAD2_Insert
'----------------------------------------------------------------------
' HEAD2 - COMMAND - DOFlags to activate the press cylinder
' TAGS: CMD_HEAD_Insert
' DOFlag_HEAD_Plunge
' DOFlag_HEAD_Retract
'----------------------------------------------------------------------
LD_BOOL CMD_HEAD2_Insert
' AND DOFlag_HEAD2_HydOn
ST_BOOL DOFlag_HEAD2_Plunge
LDN_BOOL CMD_HEAD2_Insert
' AND DOFlag_HEAD2_HydOn
ST_BOOL DOFlag_HEAD2_Retract
'----------------------------------------------------------------------
' HEAD2 - COMMAND - permissive to activate the shift cylinder
' TAGS: STAT_HEAD_PressDown
' PERM_HEAD_Probe
' PERM_HEAD_Press
'----------------------------------------------------------------------
LDN_BOOL STAT_HEAD2_PressDown
ANDN DIFlag_HMI1_LockOut
ST_BOOL PERM_HEAD2_Probe
ST_BOOL PERM_HEAD2_Press
'----------------------------------------------------------------------
' HEAD2 - COMMAND - Auto Command to activate the probe command
' TAGS: AUTO_SEQ_Next
' AUTO_HEAD_Probe
'----------------------------------------------------------------------
LD_BOOL AUTO_SEQ2_PressUp
ANDN AUTO_SEQ2_Unclamp
OR CMD_HEAD2_AutoStop
AND STAT_HEAD2_Left
ST_BOOL AUTO_HEAD2_Probe
'----------------------------------------------------------------------
' HEAD2 - COMMAND - Command to activate the probe command
' TAGS: HMICMD_HEAD_Probe
' PERM_HEAD_Probe
' CMD_HEAD_Probe
'----------------------------------------------------------------------
LD_BOOL HMICMD_HEAD2_Probe
OR AUTO_HEAD2_Probe
AND PERM_HEAD2_Probe
PT OS_HEAD2_Probe
LD_BOOL OS_HEAD2_Probe
S CMD_HEAD2_Probe
LD_BOOL OS_HEAD2_Press
R CMD_HEAD2_Probe
'----------------------------------------------------------------------
' HEAD2 - COMMAND - Auto Command to activate the press command
' TAGS: AUTO_SEQ_Setup
' AUTO_HEAD_Press
'----------------------------------------------------------------------
LD_BOOL AUTO_SEQ2_Setup
ST_BOOL AUTO_HEAD2_Press
'----------------------------------------------------------------------
' HEAD2 - COMMAND - Command to activate the press command
' TAGS: HMICMD_HEAD_Press
' PERM_HEAD_Press
' CMD_HEAD_Press
'----------------------------------------------------------------------
LD_BOOL HMICMD_HEAD2_Press
OR AUTO_HEAD2_Press
AND PERM_HEAD2_Press
PT OS_HEAD2_Press
LD_BOOL OS_HEAD2_Press
S CMD_HEAD2_Press
LD_BOOL OS_HEAD2_Probe
R CMD_HEAD2_Press
'----------------------------------------------------------------------
' HEAD2 - COMMAND - DOFlags to shift left or return right
' TAGS: CMD_HEAD_Probe
' CMD_HEAD_Press
' DOFlag_HEAD_Left
'----------------------------------------------------------------------
LD_BOOL CMD_HEAD2_Press
' AND DOFlag_HEAD2_HydOn
ST_BOOL DOFlag_HEAD2_Left
'----------------------------------------------------------------------
' HEAD2 - COMMAND - permissive to activate the clamp cylinder
' TAGS: ALM_ESD
' PERM_HEAD_Clamp
'----------------------------------------------------------------------
LDN_BOOL ALM_ESD
ANDN DIFlag_HMI1_LockOut
ST_BOOL PERM_HEAD2_Clamp
'----------------------------------------------------------------------
' HEAD2 - COMMAND - Command to activate the clamp cylinder
' TAGS: HMICMD_HEAD_Clamp
' HMICMD_HEAD_UnClamp
' PERM_HEAD_Clamp
' CMD_HEAD_Clamp
'----------------------------------------------------------------------
LD_BOOL HMICMD_HEAD2_Clamp
OR AUTO_SEQ2_Clamp
S CMD_HEAD2_Clamp
LD_BOOL HMICMD_HEAD2_Unclamp
OR AUTO_SEQ2_Unclamp
OR AUTO_SEQ2_Done
OR CMD_HEAD2_AutoStop
ORN PERM_HEAD2_Clamp
R CMD_HEAD2_Clamp
'----------------------------------------------------------------------
' HEAD2 - COMMAND - DOFlags to activate the clamp cylinder
' TAGS: CMD_HEAD_Clamp
' DOFlag_HEAD_Clamp
'----------------------------------------------------------------------
LD_BOOL CMD_HEAD2_Clamp
' AND DOFlag_HEAD2_HydOn
ST_BOOL DOFlag_HEAD2_Clamp
'----------------------------------------------------------------------
' HEAD2 - COMMAND - permissive to move chip cartridge into position
' TAGS: STAT_HEAD_PressDown
' PERM_HEAD_Index
'----------------------------------------------------------------------
LDN_BOOL STAT_HEAD2_PressDown
ANDN DIFlag_HMI1_LockOut
ST_BOOL PERM_HEAD2_Index
'----------------------------------------------------------------------
' HEAD2 - COMMAND - auto index command
' TAGS: AUTO_SEQ_Setup
' T_HEAD_AutoIndex
' PRST_HEAD_AutoIndex
' TBit_HEAD_AutoIndex
' AUTO_HEAD_Index
'
'----------------------------------------------------------------------
LD_BOOL AUTO_SEQ2_Setup
ANDN AUTO_SEQ2_Press
S AUTO_HEAD2_Index
LD_BOOL AUTO_SEQ2_Setup
AND AUTO_SEQ2_Unclamp
OR(
LDN_BOOL AUTO_SEQ2_Setup
ANDN DOFlag_HEAD2_Plunge
)
R AUTO_HEAD2_Index
'----------------------------------------------------------------------
' HEAD2 - COMMAND - move chip cartridge to press position
' TAGS: HMICMD_HEAD_Index - HMI command to manually index
cartridge
' PERM_HEAD_Index
' TBit_Stopper_Up - Timer for delay on res
etting stopper up signal
' DIFlag_HEAD_InPos - detect when cartridge
has moved off of index position
' DOFlag_LOADER_Rotate - rotate cartridge
' DOFlag_STOP_Up - pull up stopper to all
ow rotation
'
' LOGIC: IF .... command to shift cartridge into position THEN
' set doflag to extend cylinder
'
'----------------------------------------------------------------------
LD_BOOL HMICMD_HEAD2_Index ' Detect rising
edge on head index command
OR AUTO_HEAD2_Index
AND PERM_HEAD2_Index
S CMD_HEAD2_Index
LDN_BOOL HMICMD_HEAD2_Index
ANDN AUTO_HEAD2_Index
R CMD_HEAD2_Index
LD_BOOL CMD_HEAD2_Index
ST_BOOL DOFlag_HEAD2_Slide
'----------------------------------------------------------------------
' HEAD2 - COMMAND - Set bimba target position equal to actual position
' when running test cylinder
' TAGS: DOFlag_HEAD_Left
' DOFlag_HEAD_Plunge
' CALC_BIMBA_Pos
' CALC_BBOut_Target
'
' LOGIC: IF ... shifted to probe position
' AND .. Plunge cylinder is down THEN
' set a fast update bit to eliminate slow position
update
' Set bimba target = current position
'
' IF ... clamp has just been released THEN
' set bimba target = home position
'----------------------------------------------------------------------
LDN_BOOL DOFlag_HEAD2_Left
AND DOFlag_HEAD2_Plunge
ST_BOOL AUTO_HEAD2_BimbaUpd
JMPCN BBoffset:
MOVE_REAL(CALC_BIMBA2_Pos, 1, CALC_BIMBA2_Target)
BBoffset:
LD_BOOL DOFlag_HEAD2_Clamp
NT OS_HEAD2_ClampOff
LD_BOOL OS_HEAD2_ClampOff
JMPCN BBHome:
MOVE_REAL(K_BIMBA2_Home, 1, CALC_BIMBA2_Target)
BBHome:
'----------------------------------------------------------------------
' HEAD2 - COMMAND - Set and reset DAQ trigger bit
'
' Set when head is left (in press position) and cylinder pushes down
' Reset when cylinder releases
'----------------------------------------------------------------------
LD_BOOL DOFlag_HEAD2_Left
AND DOFlag_HEAD2_Plunge
TMR_HUNDS(T_HEAD2_DAQDelay, PRST_HEAD2_DAQDelay)
ST_BOOL TBit_HEAD2_DAQDelay
LD_BOOL TBit_HEAD2_DAQDelay
S DOFlag_HEAD2_DAQTrig
LD_BOOL STAT_HEAD2_Left
R DOFlag_HEAD2_DAQTrig
'----------------------------------------------------------------------
' HEAD2 - COMMAND - mark the pipe when an insert fault has been detected
'
' Insert failed alarm comes from the DAQ system via a discrete input
' Pulse the mark output for x seconds when the alarm is received
'----------------------------------------------------------------------
LD_BOOL DIFlag_HEAD2_DAQFault
TMR_TENTHS(T_HEAD2_Mark, PRST_HEAD2_Mark)
ST_BOOL TBit_HEAD2_Mark
LD_BOOL DIFlag_HEAD2_DAQFault
ANDN TBit_HEAD2_Mark
ST_BOOL DOFlag_HEAD2_Mark

Das könnte Ihnen auch gefallen