I
I need to get an Attach interrupt that works on on CPU 215's and above, to work on a CPU 214. With the original code it is possible to use EVENT 21 (Timer T32 CT=PT interrupt), however this EVENT cannot be used with a CPU 214
This is the original code.
//Tachometer Example
//
BEGIN
NETWORK 1 //Tacho timer
//
//Free running 5 second timer.
//Used to count pulses from speed sensors.
LDN T32
TON T32 +5000
END_ORGANIZATION_BLOCK
SUBROUTINE_BLOCK Initialise:SBR0
//INITIALISE SUBROUTINE
//
BEGIN
NETWORK 1 //Initialise HSC
//
//This network Initialises the High Speed Counter HSC0
LD SM0.0
MOVB 16#F8 SMB37
MOVD +0 SMD38
MOVD +0 SMD42
HDEF 0 0
ENI
HSC 0
NETWORK 2 //Attach Interrupt
//
//This network attaches INT0 to the event of Timer T32 reaching its preset time.
LD SM0.0
ATCH COUNT:INT0 21
ENI
END_SUBROUTINE_BLOCK
INTERRUPT_BLOCK COUNT:INT0
//COUNT INTERRUPT ROUTINE
//
BEGIN
NETWORK 1 //Transfer the count of HSC0
//
//This network transfers the count of HSC0 to the variable VD100
//
//
LD SM0.0
MOVD HC0 VD100
NETWORK 2 //Clear the HSC0
//
//now clear the HSC0 ready for the next counting period.
LD SM0.0
MOVB 16#C0 SMB37
MOVD +0 SMD38
HSC 0
***********************************************
// Above at 'ATCH COUNT:INT0 21 is where I have the problem. In need to get something else that can interrupt the program at the 5 second gate time and then continue on to put the count at address VD100 etc etc and continue working.
I tried using the EVENT No. 12, however, this stops the PLC from seeing the pulse input at I0.0, so the HSC doesn't count anything.
Is it possible to use timed interrupts for this application??? If so how's the best way I have had no luck with then inregating with the program. Or do I need to start again and rewrite the program.
Any help would be greatly appriciated,
Thank you
Iain Davidson
Queensland
Australia
This is the original code.
//Tachometer Example
//
BEGIN
NETWORK 1 //Tacho timer
//
//Free running 5 second timer.
//Used to count pulses from speed sensors.
LDN T32
TON T32 +5000
END_ORGANIZATION_BLOCK
SUBROUTINE_BLOCK Initialise:SBR0
//INITIALISE SUBROUTINE
//
BEGIN
NETWORK 1 //Initialise HSC
//
//This network Initialises the High Speed Counter HSC0
LD SM0.0
MOVB 16#F8 SMB37
MOVD +0 SMD38
MOVD +0 SMD42
HDEF 0 0
ENI
HSC 0
NETWORK 2 //Attach Interrupt
//
//This network attaches INT0 to the event of Timer T32 reaching its preset time.
LD SM0.0
ATCH COUNT:INT0 21
ENI
END_SUBROUTINE_BLOCK
INTERRUPT_BLOCK COUNT:INT0
//COUNT INTERRUPT ROUTINE
//
BEGIN
NETWORK 1 //Transfer the count of HSC0
//
//This network transfers the count of HSC0 to the variable VD100
//
//
LD SM0.0
MOVD HC0 VD100
NETWORK 2 //Clear the HSC0
//
//now clear the HSC0 ready for the next counting period.
LD SM0.0
MOVB 16#C0 SMB37
MOVD +0 SMD38
HSC 0
***********************************************
// Above at 'ATCH COUNT:INT0 21 is where I have the problem. In need to get something else that can interrupt the program at the 5 second gate time and then continue on to put the count at address VD100 etc etc and continue working.
I tried using the EVENT No. 12, however, this stops the PLC from seeing the pulse input at I0.0, so the HSC doesn't count anything.
Is it possible to use timed interrupts for this application??? If so how's the best way I have had no luck with then inregating with the program. Or do I need to start again and rewrite the program.
Any help would be greatly appriciated,
Thank you
Iain Davidson
Queensland
Australia