佳佳 发表于 2024-12-13 09:25:53

单片机实现PLC指令程序

<p><a href="forum.php?mod=attachment&amp;aid=72324" title="attachment"><img src="/source/plugin/zhanmishu_markdown/template/editor/images/upload.svg" alt="upload" /> 附件:ST_plc.rar</a></p>

科学妞妞 发表于 2024-12-13 10:16:58

<p><img alt="ciya" class="emoji" src="https://www.stcaimcu.com/static/image/smiley/default/ciya.gif" title="ciya" /></p>

jwd 发表于 2024-12-13 10:23:53

<p>是啥?</p>

佳佳 发表于 2024-12-13 10:49:50

<p>void main_PLC(void)<br />
{</p>
<pre><code>LD_X(0);
OR_Y(0);
ANI_X(3);
OUT_Y(0);

LD_X(1);
OUT_Y(1);

LD_X(2);
OUT_T(10,5);
OUT_Y(2);
LD_T(10);
OUT_Y(3);

LD_M8000(13);
OUT_Y(5);

LDI_X(1);
OUT_M(5);
LDP_M8000(13);
INC_D(4);
LD_M8000(13);
ALT_Y(4);

LD_GE(d,5);
OUT_Y(6);
</code></pre>
<p>}</p>
<p>PLC指令解析C程序</p>

jovewang 发表于 2024-12-13 10:50:55

<p>有没有介绍?</p>
<p>编译通过不过。PLC编程用什么软件?</p>

佳佳 发表于 2024-12-13 11:12:54

jovewang 发表于 2024-12-13 10:50
有没有介绍?
编译通过不过。PLC编程用什么软件?

见注释

wlhet 发表于 2024-12-13 11:23:43

<p>下载看看</p>

jwd 发表于 2024-12-13 13:11:18

佳佳 发表于 2024-12-13 10:49
void main_PLC(void)
{
LD_X(0);


厉害!不过好像没有沿信号

jovewang 发表于 2024-12-13 15:33:43

<p>Rebuild target 'ST_plc'<br />
compiling PLC_Main.c...<br />
compiling PLC_Instruct.c...<br />
sources\PLC_Instruct.c(17): error C231: 'ACC_BIT': redefinition<br />
sources\PLC_Instruct.c(18): error C231: 'MPS_BIT': redefinition<br />
sources\PLC_Instruct.c(559): error C187: not an lvalue<br />
sources\PLC_Instruct.c(622): error C187: not an lvalue<br />
sources\PLC_Instruct.c(633): error C187: not an lvalue<br />
compiling PLC_Timer.c...<br />
compiling PLC_User.C...<br />
compiling PLC_uart.c...<br />
compiling TM1628.c...<br />
compiling MAX6675.c...<br />
compiling PLC_eeprom.c...<br />
Target not created.</p>
<p>怎么编译通不过?</p>
<p>梯形图是用什么软件写?</p>

佳佳 发表于 2024-12-13 17:24:07

jovewang 发表于 2024-12-13 15:33
Rebuild target 'ST_plc'
compiling PLC_Main.c...
compiling PLC_Instruct.c...


编译没问题
compiling PLC_Main.c...
compiling PLC_Instruct.c...
compiling PLC_Timer.c...
compiling PLC_User.C...
compiling PLC_uart.c...
compiling TM1628.c...
compiling MAX6675.c...
compiling PLC_eeprom.c...
linking...
Program Size: data=127.1 xdata=1609 code=13557
creating hex file from ".\OBJ\LED_KEY"...
".\OBJ\LED_KEY" - 0 Error(s), 0 Warning(s).
页: [1] 2
查看完整版本: 单片机实现PLC指令程序