通讯时的指示灯显示

zhoolong zhoolong 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
上位机接收到数据,
比如说:AA 55 00 00 ff 00 00 ff 00 00,共10个数据,
AA为Data[1],依次则最后一个数据为Data[10],
如果第五个数据Data[5]和第八个数据Data[8]我想用指示灯显示,Data[5]为State1,Data[8]为State2,
当我在TTimer1中用语句State1=Data[5]时,
会提示:
Project Project1.exe raised exception class EDBEngineError with message 'Invalid use of keyword.,,,,,,,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,Line Number:1'.Process stopped. Use Step or Run to continue。

如果没有语句State1=Data[5]时,接收数据正常,但指示灯没反应,然后我单独试了一下,
State1:

static int onoff=0;
Shape1->Brush->Color=clRed;
Shape2->Brush->Color=clRed;
Shape3->Brush->Color=clRed;
Shape4->Brush->Color=clRed;
Shape5->Brush->Color=clRed;
Shape6->Brush->Color=clRed;
Shape7->Brush->Color=clRed;
Shape8->Brush->Color=clRed;

Shape1-Shape8都是红色的,
我判断是接收的数据Data[5]没有跟State1连起来

请教怎么连接数据,还有报错是什么原因,谢谢
...全文

相关推荐

评论 13
收藏 已收藏
分享
返回顶部
zhoolong
网络及通讯开发 1,317 成员 8,874 内容