Blocs fonctionnels du FM 350-1
2.5 Appel des blocs fonctionnels
myInstFM3501Ctrl
END_VAR
END_INTERFACE
IMPLEMENTATION
PROGRAM ExampleFM3501
VAR
FMOutputArray
END_VAR
// CALL INSTANCE of _FM3501_control
myInstFM3501Ctrl(
EnableSwGate
EnableStopGate
ExecResetOpError
CntrRange
PeriIn
Data
PeriOut
// following IN_OUT parameters are set by the application
// and reset by the FB! (shake-hand-effect)
SetStartValue
SetPrepStartValue
setCmpValue1
setCmpValue2
resetSyncState
resetCntrState
);
// TRANSFER DATA TO FM
myPeripheralOutputFM3501 := FMOutputArray;
// EVALUATE AND DISPLAY STATUS MESSAGES
MyStateFMStartup
MyOperationError
END_PROGRAM
END_IMPLEMENTATION
Remarque
Le programme ExampleFM3501 doit être placé dans le système exécutif.
28
: _FM3501_control;
: ARRAY [0..15] of BYTE;
:= mySetSoftwareGate,
:= myStopGate,
:= myResetError,
:= TRUE,
:= myPeripheralInputFM3501,
:= myDataFM3501,
:= FMOutputArray,
:= myLoadStartValue,
:= myLoadPrepareStartValue,
:= myLoadComparisonValue1,
:= myLoadComparisonValue2,
:= myResetSyncState,
:= myResetCounterState,
:= myInstFM3501Ctrl.startup;
:= myInstFM3501Ctrl.errorOperation;
// ExampleFM3501
// create FB instance
// Program in BackroundTask
// Array for FM output data
// Control software gate
// Control internal gate
// Acknowledge operator error
// Counter range
// input address
// Transfer data structure
// FM output data array
// Load counter
// Load counter in preparation
// Load new comparison value 1
// Load new comparison value 2
// Reset synchronization bit
// Reset status bit
// Assign array of FM output data
// to I/O variables
// Start-up status
Complément aux modules FM 350-1, FM 350-2, FM 352
Description fonctionnelle, Édition 03/2009
(1)
(3)
(4)
(5)
(7)
(6)