技术支持:关于LNS 3.0 DataPoint调用的问题 点击:1938 | 回复:2



gongkongedit

    
  • 精华:1099帖
  • 求助:0帖
  • 帖子:14392帖 | 54470回
  • 年度积分:0
  • 历史总积分:622
  • 注册:2008年9月08日
发表于:2001-08-30 11:10:00
楼主
以下是国内一个开发商遇到的问题,欢迎大家参与。 调用DataPoin.SetValue()函数时,当AutoWrite的属性设置为TRUE时,产生Data Server出错,当AutoWrite的属性设置为FALSE时,没有错误产生,但调用Write方法写节点的网络变量没有任何反应。不知DataPoin.SetValue()函数时的调用是否有特殊要求。 BOOL CMyPropertyMonitoring::WriteNvVal(CString m_page, CString m_nvname, CString m_val, CString m_tag) { LcaMonitorSets m_tempMonitors; LcaMonitorSet m_tempMonitor; LcaNvMonitorPoints m_tempPoints; LcaNvMonitorPoint m_tempPoint; LcaDataPoint nvDataPoint; m_tempMonitors = MyGlobal.pVniAppDevice->GetMonitorSets(); try { m_tempMonitor = m_tempMonitors.GetItem(COleVariant(m_page)); } catch(COleDispatchException * pE) { GenericErrorHandler(this, pE ); return false; } try { m_tempPoints = m_tempMonitor.GetNvMonitorPoints(); } catch(COleDispatchException * pE) { GenericErrorHandler(this, pE ); return false; } try { m_tempPoint = m_tempPoints.GetItem(COleVariant(m_nvname)); } catch( COleDispatchException * pE ) { // If it breaks, then error out. GenericErrorHandler( this, pE ); return false; } nvDataPoint = m_tempPoint.GetDataPoint(); try { switch(m_tag.GetAt(0)) { case F: nvDataPoint.SetValue(atof(m_val));//**例如m_val = 3.14159,运行程序后将产生Data Server #370号错误 break; case I: nvDataPoint.SetFormattedValue (COleVariant (m_val)); break; case S: nvDataPoint.SetFormattedValue (COleVariant (m_val)); break; default: break; } } catch (COleDispatchException * pE) { GenericErrorHandler (this, pE); return false; } if (!(nvDataPoint.GetAutoWrite())) nvDataPoint.Write(); return TRUE; }



gongkongedit

  • 精华:1099帖
  • 求助:0帖
  • 帖子:14392帖 | 54470回
  • 年度积分:0
  • 历史总积分:622
  • 注册:2008年9月08日
发表于:2001-08-30 09:45:00
1楼
Zhuo Yi, I ve received your request for more information regarding the DataPoints SetValue and Write methods. In reading your response, I assume you are using VC++, as you wouldnt otherwise be calling SetValue (in VB it would be just Value). For some background information, the proper behavior of the DataPoint class is that when the AutoWrite property is set to true, then calling SetValue will send the value to the device as well. With it set to false, it doesnt send the value to the device, but just holds it internally in LNS. When you then call the Write() function, the current value held internally in LNS will be sent to the device. If calling SetValue with AutoWrite set to true always throws an exception, then the same should be thrown when you call Write. However, depending on the exception being thrown, you may receive the exception when you call SetValue, or you may Can you give me the full description of the error that you get? It appears that you may be receiving an exception value that is outside of the valid range. Thank you, Aaron Wood Applications Engineer Product Support & Training Echelon Corp.

yz

  • 精华:14帖
  • 求助:0帖
  • 帖子:38帖 | 137回
  • 年度积分:0
  • 历史总积分:320
  • 注册:2001年6月28日
发表于:2001-08-30 11:10:00
2楼
由于LNS3.0是美国ECHELON公司LONWORKS技术的软件平台的核心技术 也是ECHELON目前推广其所有解决方案中,网络操作管理的唯一标准。 因此,是否掌握LNS3.0,意味着能否跟踪Lonworks技术最新发展。国内将会有更多的用户开始应用LNS网络操作系统,进行网络管理监控系统的研发。 大家对于在使用LNS3.0过程中,遇到的问题,可以EMAIL给我。

热门招聘
相关主题

官方公众号

智造工程师