编写了一个进行算术运算的函数,结果提示多屋:error(0054):operands of *,/ must be arithmetic。代码如下:
#include "apdefap.h"
#pragma option(mbcs)
double GetCurrentSpeed()
{
#define m_nCurSpeed "dSpeed"
extern double m_dCurSpeed;
GetTagDWord(m_nCurSpeed ); //Return-Type: DWORD
m_dCurSpeed=m_nCurSpeed/3*10000; //实际上是*1000/300
return m_dCurSpeed;
}
最佳答案
#include "apdefap.h"
#pragma option(mbcs)
double GetCurrentSpeed()
{
double m_nCurSpeed;
double m_dCurSpeed;
m_nCurSpeed=GetTagDWord("dSpeed" ); //Return-Type: DWORD
m_dCurSpeed=m_nCurSpeed/3*10000; //实际上是*1000/300
return m_dCurSpeed;
}
提问者对于答案的评价:
非常感谢,问题解决了
原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc180648.html