是否有将现有结构化文本 PLC 代码转换为功能块图的已知方法?(甚至是 Beckhoff 的 CFC)
我知道这很困难,因为语言所基于的流程不同。
也许只是部分或至少一些结构与正确的变量连接到功能块?
我必须根据 FBD 的外观在 Visio 中创建一个逻辑代码概览,并且至少有一些结构来作为我的绘图的基础,而不必从基本 ST 代码中绘制所有内容,这将是一个很大的帮助。
一个小的示例代码将是这个在 ST 中完成的“BrakeControl”FB,但我需要映射更大的 FB:
IF stSettings.bExists THEN
IF stSettings.eMode = E_OPMode.eOPModeOpen OR stSettings.eMode = E_OPMode.eOPModeClose THEN
// close brake manual - only possible if below max braking rpm and hydraulic closed
bCloseBrake := stSettings.eMode = E_OPMode.eOPModeClose AND stIO.stGenerator.IstGen_Speed.fPercent < stSettings.fStartRev AND itfHydCtrl.IsClosed;
ELSE
IF stIOs.IbBrake_Auto AND stIOs.IbBrake_Worn AND
(itfTurbCtrl.State = E_TurbState.eTurbStateFault OR
itfTurbCtrl.State = E_TurbState.eTurbStateStop OR
itfTurbCtrl.State = E_TurbState.eTurbStateReady )
THEN
IF stIO.stGenerator.IstGen_Speed.fPercent < stSettings.fStartRev AND itfHydCtrl.IsClosed THEN
bCloseBrake := TRUE;
END_IF
END_IF
IF stIOs.IbBrake_Auto AND NOT stIOs.IbBrake_Worn AND itfTurbCtrl.ManualMode THEN
IF stIO.stGenerator.IstGen_Speed.fPercent < stSettings.fStartRev AND stIO.stPenstock.IbBypass_Closed
AND stIO.stPenstock.IbMIV_Closed AND itfHydCtrl.IsClosed THEN
bCloseBrake := TRUE;
END_IF
END_IF
END_IF
IF bBrakeRelease THEN
bCloseBrake := FALSE;
END_IF
stIOs.QbBrake_On := bCloseBrake;