Bei einem Signal alle 30°? Das sind 3000*12 Signale in der Minute, eine tolle PLC ist das.Ich hab da mal was gebastelt ^^
sollte bis ca 3000U/min gut funktionieren
Also das PAE wird am Anfang des OB 1 aktualisiert.Wann wird nochmal das Prozessabbild erneuert??
Ich arbeite mit nem OB38
Muß ich dann ein PEW laden
und das entsprechende Bit maskieren??
Bei einem Signal alle 30°? Das sind 3000*12 Signale in der Minute, eine tolle PLC ist das.
Also das PAE wird am Anfang des OB 1 aktualisiert.
Ja, du musst das PEW laden, doch glaub ich nicht, dass das so schnell mit einer S7/300 geht.
Bei 10ms sind das theoretisch max. 6000 Impulse, aber es sind doch 36000 nach den Vorgaben?
bike
Habe ich auch so gelesen.richtig - ich arbeite mit nur einer Nocke
Wenn ich das richtig verstanden habe
sind die Nocken programmierbar
Also das PAE wird am Anfang des OB 1 aktualisiert.
Ja, du musst das PEW laden, doch glaub ich nicht, dass das so schnell mit einer S7/300 geht.
bike
Über Feedback würde ich mich freuen
Noch lachst Du!
Wir fangen oben an und arbeiten uns langsam durch:
Bausteinbeschreibung - nicht vorhanden!
Symbolik - uneindeutig!
Kommentare - Fehlanzeige!
Struktur - nicht erkennbar!
Zeiten - fix, Mehrwert des Bausteins nicht gegeben!
Hast fein gemacht, gefällt mir - 6 setzen!
Ich kriegs kotzen!
Wie, Bausteinbeschreibung??
Hab den Baustein doch mit "Dreh_Zahl_Richtung"
genannt.
Kann ich für einen Baustein eine richtige Beschreibung schreiben??
Wenn ja - wie??
find ich den Baustein gut.
ä - die sind noch frei für...kleinen grauen felder
Dann frag nicht nach ernst gemeintem Feedback sondern bettel um Anerkennung für Deine ach so tolle Leistung!
wie sieht denn ein Baustein bei Dir aus???
FUNCTION_BLOCK "M_1DRCT"
TITLE =1 DIRECTION DRIVE
//this function_block realize the control of a one direction drive.
//all functions of the drive are monitored and avaible at wRetVal.
//an error also will switch off the EN0 of the function_block.
//
//wRetVal - status
//----------------
//0000 - enable and ready to go
//0001 - start drive
//0003 - start drive and contactor on
//0007 - drive run and all functions ok
//
//wRetVal - error
//---------------
//8000 - no extern enable
//8001 - protectswitch off
//8002 - repairswitch off
//8003 - protectswitch and repairswitch off
//8004 - contactor had not switched in time or is gone
//8005 - motioncontrol had not switched in time or is gone
//
//DATE: 05.08.1997
//AUTHOR: fd
//VERSION: V0.1 BasicVer
AUTHOR : 'fd'
VERSION : 0.1
VAR_INPUT
xPlcPulse : BOOL ; //plug the Mx.0 with 10Hz here
xEnable : BOOL ; //extern enable input (1=ON)
xProtectSwitch : BOOL ; //(1=OK)
xRepairSwitch : BOOL ; //(1=OK)
xContactor : BOOL ; //(1=ON)
xMotionControl : BOOL ; //(1=OK)
xStart : BOOL ; //(1=START)
iContactorTime : INT ; //normally a small number, maybe 10 (mean 1s)
iMotionControlTime : INT ; //a little more than the time the drive needs to run fullspeed
END_VAR
VAR_OUTPUT
xContactorOut : BOOL ; //the output for the drive
wRetVal : WORD ; //status/error information
END_VAR
VAR
xHelpFlagEnable : BOOL ;
xHelpFlagPlcPulse : BOOL ;
xTimeEnable : BOOL ;
xAllFine : BOOL ;
iTimer : INT ;
END_VAR
BEGIN
NETWORK
TITLE =
//
//enable and init the function_block
//
UN #xEnable; //if enable false then
R #xAllFine; //reset intern start enable
R #xContactorOut; //make sure contactor is off
SPBN nore;
L W#16#8000;
T #wRetVal; //write status information
SPA end; //and leave the function
nore: UN #xStart; //if start not and
SPBN ston;
R #xTimeEnable;
L W#16#0; //only enable and all switches on
T #wRetVal; //wRetVal = 0000
NETWORK
TITLE =
//
//init and take ready for trigger
//
ston: U #xEnable; //enable true
U #xStart; //and start
FP #xHelpFlagEnable; //new
SPBN nonw;
L W#16#1; //then
T #wRetVal; //write status information
L 0; //initialize
T #iTimer; //timer with zero
S #xTimeEnable; //and make enable
S #xAllFine; //set the intern enable
NETWORK
TITLE =
//
//check the function
//
nonw: UN #xProtectSwitch;
SPBN pok;
L W#16#8001; //if protectswitch off
UN #xRepairSwitch;
SPBN ron;
L W#16#8003; //if protectswitch and repairswitch off
ron: T #wRetVal; //write error information
R #xAllFine;
R #xContactorOut; //make sure contactor is off
SPA err; //and leave the function
pok: UN #xRepairSwitch;
SPBN rok;
L W#16#8002; //if repairswitch off
T #wRetVal; //write error information
R #xAllFine;
R #xContactorOut; //make sure contactor is off
SPA err; //and leave the function
NETWORK
TITLE =
//
//trigger the drive
//
rok: U #xStart; //if start on
U #xAllFine; //and intern enable also
= #xContactorOut; //do the drive
NETWORK
TITLE =
//
//start the timer for drive connections
//
U #xTimeEnable;
U #xAllFine; //the intern enable
U #xPlcPulse; //do with the PlcPulse
FP #xHelpFlagPlcPulse;
SPBN equ;
L #iTimer; //a timer
+ 1;
T #iTimer;
NETWORK
TITLE =
//
//stop if neccessary - contactor
//
equ: U( ;
L #iTimer; //if the time
L #iContactorTime; //bigger than the settime
>=I ; //for the contactor
) ;
UN #xContactor; //and the contactor off
SPBN cook;
L W#16#8004; //write wRetVal
T #wRetVal;
R #xAllFine; //and reset the intern enable
SPA err;
NETWORK
TITLE =
//
//write status, if contactor OK
//
cook: U #xContactor;
U #xStart;
SPBN noco; //contactor on
L W#16#3; //means 3
T #wRetVal;
NETWORK
TITLE =
//
//stop if neccessary - motion control
//
noco: U( ;
L #iTimer; //if the time
L #iMotionControlTime; //bigger than the settime
>=I ; //for the motion control
) ;
UN #xMotionControl; //and the motion control
SPBN mook;
L W#16#8005; //write wRetVal
T #wRetVal;
R #xAllFine; //and reset the intern enable
SPA err;
NETWORK
TITLE =
//
//write status if motion control OK
//
mook: U #xMotionControl;
U #xStart;
SPBN tim; //motion control on
L W#16#7; //means 7
T #wRetVal;
NETWORK
TITLE =
//
//stop the timer
//
tim: L #iMotionControlTime; //the big time
L 100; //+100
+I ;
L #iTimer;
<=I ;
SPBN end;
SET ;
R #xTimeEnable; //switch off the timer
NETWORK
TITLE =
//
//EN0-handling
//
end: L #wRetVal; //if the wRetVal
L W#16#8000; //bigger than 8000
>D ; //then is an error
SPB err; //and the EN0 are false
SET ; //else the EN0 are true
SAVE ;
err: NOP 0;
END_FUNCTION_BLOCK
U #xEnable; //enable true
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?