⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pwm-twido.twd

📁 使用TWIDO ,PLC 开发PWM实例,PWM输出驱动LED 亮度,100级亮度等级.
💻 TWD
📖 第 1 页 / 共 2 页
字号:
<?xml version="1.0"?>
<TwidoApplication>
    <FileVersion>2.1</FileVersion>
    <CodePage>936</CodePage>
    <SymbolTable/>
    <Resources>
        <MODEM>
            <HAYES_INIT_COMMAND>$</HAYES_INIT_COMMAND>
        </MODEM>
        <AppTable>
            <AppTableVersion>3</AppTableVersion>
            <CompatibilityFlags>5</CompatibilityFlags>
            <LevelChosen>255</LevelChosen>
            <Password>$</Password>
            <AppName>脦麓脙眉脙没</AppName>
            <AppVersion>1</AppVersion>
            <AppSignature>14420</AppSignature>
            <AppMaxCycleTime>250</AppMaxCycleTime>
            <AppMinCycleTime>0</AppMinCycleTime>
            <Protection>0</Protection>
            <Autoload>1</Autoload>
            <AppReadyToRun>1</AppReadyToRun>
            <LenListIdTableModBuffer>4863</LenListIdTableModBuffer>
            <AppIntModBufferLength>25280</AppIntModBufferLength>
            <AppMaxModsAllowed>1580</AppMaxModsAllowed>
            <AppDiffLadderSize>0</AppDiffLadderSize>
            <AppNumExtLabel>2</AppNumExtLabel>
            <AppNumModsUsedInt>0</AppNumModsUsedInt>
            <LangVersion>1</LangVersion>
            <CompilerVersion>1</CompilerVersion>
            <CompilerSettings>0</CompilerSettings>
            <HardwarePartNumber>TWDLMDA20DRT</HardwarePartNumber>
            <HardwareID>2230</HardwareID>
            <HWOptionsStatus>0</HWOptionsStatus>
            <AppTableChksum>61042</AppTableChksum>
            <AppStructChksum>46223</AppStructChksum>
        </AppTable>
        <KWTable/>
        <CfgTable>
            <CfgTableVersion>5</CfgTableVersion>
        </CfgTable>
        <SwObjList>
            <Timer>
                <TMIndex>0</TMIndex>
                <PresetValue>5</PresetValue>
                <TimeBase>3</TimeBase>
                <TimeType>0</TimeType>
                <ModifyFlag>1</ModifyFlag>
            </Timer>
            <Timer>
                <TMIndex>1</TMIndex>
                <PresetValue>8</PresetValue>
                <TimeBase>3</TimeBase>
                <TimeType>0</TimeType>
                <ModifyFlag>1</ModifyFlag>
            </Timer>
            <PLS>
                <PLSIndex>0</PLSIndex>
                <PresetValue>20</PresetValue>
                <TimeBase>8</TimeBase>
                <PlsPwmType>2</PlsPwmType>
                <ModifyFlag>1</ModifyFlag>
            </PLS>
            <BaseDigInput>
                <BDI12Filter>0</BDI12Filter>
                <BDI3Filter>4095</BDI3Filter>
                <BDICapture>0</BDICapture>
                <BDIRunStop>0</BDIRunStop>
                <BDINumInputs>12</BDINumInputs>
                <BDIIsDedicated>0</BDIIsDedicated>
            </BaseDigInput>
            <BaseDigOutput>
                <BDONumOutputs>8</BDONumOutputs>
                <BDOOutputStat>0</BDOOutputStat>
                <BDOIsDedicated>1</BDOIsDedicated>
            </BaseDigOutput>
            <BaseAnalogInput>
                <BAINumInputs>2</BAINumInputs>
                <BAIPrecision>0</BAIPrecision>
            </BaseAnalogInput>
            <ExpansionModule>
                <ExpModulePartNumber>TWDAMM3HT</ExpModulePartNumber>
                <ExpModuleNumInputs>2</ExpModuleNumInputs>
                <ExpModuleNumOutputs>1</ExpModuleNumOutputs>
                <ExpModuleKind>1</ExpModuleKind>
                <ExpModuleType>61441</ExpModuleType>
                <ExpModuleIndex>1</ExpModuleIndex>
                <ExpModuleExtra>0</ExpModuleExtra>
                <analogChannelInputMaskTag>0</analogChannelInputMaskTag>
                <AnalogChannel>
                    <AnalogChannelType>0</AnalogChannelType>
                    <AnalogChannelNumber>0</AnalogChannelNumber>
                    <AnalogChannelMode>255</AnalogChannelMode>
                    <AnalogChannelMin>0</AnalogChannelMin>
                    <AnalogChannelMax>4095</AnalogChannelMax>
                    <analogChannelExtraTag>0</analogChannelExtraTag>
                </AnalogChannel>
                <AnalogChannel>
                    <AnalogChannelType>0</AnalogChannelType>
                    <AnalogChannelNumber>1</AnalogChannelNumber>
                    <AnalogChannelMode>255</AnalogChannelMode>
                    <AnalogChannelMin>0</AnalogChannelMin>
                    <AnalogChannelMax>4095</AnalogChannelMax>
                    <analogChannelExtraTag>0</analogChannelExtraTag>
                </AnalogChannel>
                <AnalogChannel>
                    <AnalogChannelType>1</AnalogChannelType>
                    <AnalogChannelNumber>0</AnalogChannelNumber>
                    <AnalogChannelMode>255</AnalogChannelMode>
                    <AnalogChannelMin>0</AnalogChannelMin>
                    <AnalogChannelMax>4095</AnalogChannelMax>
                    <analogChannelExtraTag>0</analogChannelExtraTag>
                </AnalogChannel>
                <AnalogChannel>
                    <AnalogChannelType>1</AnalogChannelType>
                    <AnalogChannelNumber>1</AnalogChannelNumber>
                    <AnalogChannelMode>255</AnalogChannelMode>
                    <AnalogChannelMin>0</AnalogChannelMin>
                    <AnalogChannelMax>4095</AnalogChannelMax>
                    <analogChannelExtraTag>0</analogChannelExtraTag>
                </AnalogChannel>
            </ExpansionModule>
            <ExpansionModule>
                <ExpModulePartNumber>TWDD--8-T</ExpModulePartNumber>
                <ExpModuleNumInputs>0</ExpModuleNumInputs>
                <ExpModuleNumOutputs>8</ExpModuleNumOutputs>
                <ExpModuleKind>0</ExpModuleKind>
                <ExpModuleType>32773</ExpModuleType>
                <ExpModuleIndex>2</ExpModuleIndex>
                <ExpModuleExtra>0</ExpModuleExtra>
                <analogChannelInputMaskTag>0</analogChannelInputMaskTag>
            </ExpansionModule>
            <CommObj>
                <CmDeviceRemote>0</CmDeviceRemote>
                <CmDeviceTypeRemote>0</CmDeviceTypeRemote>
                <CmIndex>0</CmIndex>
                <CmPort1Address>0</CmPort1Address>
                <CmPort1LnCfg>179</CmPort1LnCfg>
                <CmPort1Protocol>2</CmPort1Protocol>
                <CmPort1MbTimeout>0</CmPort1MbTimeout>
                <CmPort1RespTimeout>10</CmPort1RespTimeout>
                <CmPort1EndOfFrame>10</CmPort1EndOfFrame>
                <CmPort2Address>1</CmPort2Address>
                <CmPort2LnCfg>180</CmPort2LnCfg>
                <CmPort2Protocol>0</CmPort2Protocol>
                <CmPort2MbTimeout>10</CmPort2MbTimeout>
                <CmPort2RespTimeout>10</CmPort2RespTimeout>
                <CmPort2EndOfFrame>10</CmPort2EndOfFrame>
                <CmPort1StartOfFrame>0</CmPort1StartOfFrame>
                <CmPort1SecondEndOfFrame>0</CmPort1SecondEndOfFrame>
                <CmPort1SizeASCIIFrame>0</CmPort1SizeASCIIFrame>
                <CmPort2StartOfFrame>0</CmPort2StartOfFrame>
                <CmPort2SecondEndOfFrame>0</CmPort2SecondEndOfFrame>
                <CmPort2SizeASCIIFrame>0</CmPort2SizeASCIIFrame>
                <CmFlagSilenceUsed>0</CmFlagSilenceUsed>
                <CmAsciiEofTxEnabler>0</CmAsciiEofTxEnabler>
                <CmPunitLnCfg>132</CmPunitLnCfg>
                <CmPunitMbTimeout>20</CmPunitMbTimeout>
            </CommObj>
        </SwObjList>
        <MacCfgList/>
    </Resources>
    <Program>
        <ListInstruction>LD    %S13</ListInstruction>
        <ListInstruction>[ %MW100 := 1200 ]</ListInstruction>
        <ListInstruction>R     %M0</ListInstruction>
        <ListInstruction>S     %Q0.0.3</ListInstruction>
        <ListInstruction>R     %Q0.0.2</ListInstruction>
        <ListInstruction>LD    [ %MW100 > 2 ]</ListInstruction>
        <ListInstruction>SR0</ListInstruction>
        <ListInstruction>LD    1</ListInstruction>
        <ListInstruction>SR5</ListInstruction>
        <ListInstruction>LD    1</ListInstruction>
        <ListInstruction>SR6</ListInstruction>
        <ListInstruction>LD    1</ListInstruction>
        <ListInstruction>[ %MW0 := %MW14 AND 16#FF00 ]</ListInstruction>
        <ListInstruction>LD    [ %MW0 = 16#100 ]</ListInstruction>
        <ListInstruction>SR1</ListInstruction>
        <ListInstruction>LD    [ %MW0 = 16#200 ]</ListInstruction>
        <ListInstruction>SR2</ListInstruction>
        <ListInstruction>LD    [ %MW0 = 16#300 ]</ListInstruction>
        <ListInstruction>SR3</ListInstruction>
        <ListInstruction>LD    [ %MW0 = 16#400 ]</ListInstruction>
        <ListInstruction>SR4</ListInstruction>
        <ListInstruction>END</ListInstruction>
        <ListInstruction>SR1:</ListInstruction>
        <ListInstruction>LD    1</ListInstruction>
        <ListInstruction>[ %PWM0.R := %MW14 AND 16#FF ]</ListInstruction>
        <ListInstruction>RET</ListInstruction>
        <ListInstruction>SR2:</ListInstruction>
        <ListInstruction>LD    1</ListInstruction>
        <ListInstruction>BLK   %PWM0</ListInstruction>
        <ListInstruction>LD    1</ListInstruction>
        <ListInstruction>IN</ListInstruction>
        <ListInstruction>END_BLK</ListInstruction>
        <ListInstruction>RET</ListInstruction>
        <ListInstruction>SR3:</ListInstruction>
        <ListInstruction>LD    1</ListInstruction>
        <ListInstruction>BLK   %PWM0</ListInstruction>
        <ListInstruction>LD    0</ListInstruction>
        <ListInstruction>IN</ListInstruction>
        <ListInstruction>END_BLK</ListInstruction>
        <ListInstruction>RET</ListInstruction>
        <ListInstruction>SR4:</ListInstruction>
        <ListInstruction>LD    1</ListInstruction>
        <ListInstruction>[ %MW1 := %MW14 AND 16#FF ]</ListInstruction>
        <ListInstruction>[ %MW1 := SHR( %MW1, 1 ) ]</ListInstruction>
        <ListInstruction>LD    %S17</ListInstruction>
        <ListInstruction>S     %Q0.2.1</ListInstruction>
        <ListInstruction>LDN   %S17</ListInstruction>
        <ListInstruction>R     %Q0.2.1</ListInstruction>
        <ListInstruction>LD    1</ListInstruction>
        <ListInstruction>[ %MW1 := %MW14 AND 16#FF ]</ListInstruction>
        <ListInstruction>[ %MW1 := SHR( %MW1, 2 ) ]</ListInstruction>
        <ListInstruction>LD    %S17</ListInstruction>
        <ListInstruction>S     %Q0.2.2</ListInstruction>
        <ListInstruction>LDN   %S17</ListInstruction>
        <ListInstruction>R     %Q0.2.2</ListInstruction>
        <ListInstruction>LD    1</ListInstruction>
        <ListInstruction>[ %MW1 := %MW14 AND 16#FF ]</ListInstruction>
        <ListInstruction>[ %MW1 := SHR( %MW1, 3 ) ]</ListInstruction>
        <ListInstruction>LD    %S17</ListInstruction>
        <ListInstruction>S     %Q0.2.3</ListInstruction>
        <ListInstruction>LDN   %S17</ListInstruction>
        <ListInstruction>R     %Q0.2.3</ListInstruction>
        <ListInstruction>LD    1</ListInstruction>
        <ListInstruction>[ %MW1 := %MW14 AND 16#FF ]</ListInstruction>
        <ListInstruction>[ %MW1 := SHR( %MW1, 4 ) ]</ListInstruction>
        <ListInstruction>LD    %S17</ListInstruction>
        <ListInstruction>S     %Q0.2.4</ListInstruction>
        <ListInstruction>LDN   %S17</ListInstruction>
        <ListInstruction>R     %Q0.2.4</ListInstruction>
        <ListInstruction>RET</ListInstruction>
        <ListInstruction>SR0:</ListInstruction>
        <ListInstruction>LD    1</ListInstruction>
        <ListInstruction>[ %MW100 := %MW100 - 1 ]</ListInstruction>
        <ListInstruction>LD    [ %MW100 > 1000 ]</ListInstruction>
        <ListInstruction>S     %Q0.2.1</ListInstruction>
        <ListInstruction>S     %Q0.2.2</ListInstruction>
        <ListInstruction>S     %Q0.2.3</ListInstruction>
        <ListInstruction>LD    [ %MW100 &lt; 1000 ]</ListInstruction>
        <ListInstruction>AND   [ %MW100 > 800 ]</ListInstruction>
        <ListInstruction>R     %Q0.2.1</ListInstruction>
        <ListInstruction>R     %Q0.2.2</ListInstruction>
        <ListInstruction>R     %Q0.2.3</ListInstruction>
        <ListInstruction>LD    [ %MW100 &lt; 800 ]</ListInstruction>
        <ListInstruction>AND   [ %MW100 > 600 ]</ListInstruction>
        <ListInstruction>S     %Q0.2.1</ListInstruction>
        <ListInstruction>S     %Q0.2.2</ListInstruction>
        <ListInstruction>S     %Q0.2.3</ListInstruction>
        <ListInstruction>LD    [ %MW100 &lt; 600 ]</ListInstruction>
        <ListInstruction>AND   [ %MW100 > 400 ]</ListInstruction>
        <ListInstruction>R     %Q0.2.1</ListInstruction>
        <ListInstruction>R     %Q0.2.2</ListInstruction>
        <ListInstruction>R     %Q0.2.3</ListInstruction>
        <ListInstruction>LD    [ %MW100 &lt; 400 ]</ListInstruction>
        <ListInstruction>AND   [ %MW100 > 200 ]</ListInstruction>
        <ListInstruction>S     %Q0.2.1</ListInstruction>
        <ListInstruction>S     %Q0.2.2</ListInstruction>
        <ListInstruction>S     %Q0.2.3</ListInstruction>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -