4 using the delete function on modbus channels, Using the delete function on modbus channels -6, Using the delete function on modbus channels – Echelon i.LON SmartServer 2.0 User Manual

Page 255

Advertising
background image

i.LON SmartServer 2.0 Programmer’s Reference

15-6

• If you are creating a new Modbus channel, you only need to specify the <UCPTchannelType>

property; all other properties are optional.

• If you are modifying an existing Modbus channel, you must specify the channel’s

<UCPThandle>. If you do not specify the handle, a new channel is created. All other properties
must be filled; otherwise the values stored in them are erased. The previous section, Using the Get
Function on Modbus Channels
, details the properties you can include in the Set function.

Request (create a new TCP/IP Modbus channel on the SmartServer)

<Set xmlns="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/">
<iLonItem>
<Item

xsi:type="MOD_Channel_Cfg">

<UCPTname>Net/Modbus

Channel

2</UCPTname>

<UCPTannotation>IP</UCPTannotation>
<UCPTchannelType

LonFormat="UCPTchannelType">CT_TCP_IP_MASTER</UCPTchannelType>

</Item>
</iLonItem>
</Set>

Response

<SetResponse xmlns="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/">
<iLonItem>
<UCPTfaultCount>0</UCPTfaultCount>
<Item

xsi:type="MOD_Channel_Cfg">

<UCPTname>Net/Modbus

Channel

2</UCPTname>

<UCPTannotation>IP</UCPTannotation>
<UCPThidden>0</UCPThidden>
<UCPTlastUpdate>2008-04-02T11:43:37.460-07:00</UCPTlastUpdate>
<UCPTuri>MOD_Channel_Cfg.htm</UCPTuri>
<UCPThandle>1</UCPThandle>
<UCPTchannelType

LonFormat="UCPTchannelType">CT_TCP_IP_MASTER</UCPTchannelType>

<UCPTport>502</UCPTport>
<UCPTretryCount

LonFormat="UCPTretryCount">1</UCPTretryCount>

</Item>
</iLonItem>
</SetResponse>

15.1.4

Using the Delete Function on Modbus Channels

You can use the Delete function to delete a Modbus channel on the SmartServer. The Delete function
takes an <Item> element with a MOD_Channel_Cfg type as its input. The <Item> element only needs
to include the Modbus channel’s <UCPTname> property in the Delete Request as demonstrated in the
following code sample:

Request

<Delete xmlns="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/">
<iLonItem>
<Item

xsi:type="MOD_Channel_Cfg">

<UCPTname>Net/Modbus Channel 2</UCPTname>

</Item>

</iLonItem>
</Delete>

Response

<DeleteResponse xmlns="http://wsdl.echelon.com/web_services_ns/ilon100/v4.0/message/">
<iLonItem >

<UCPTfaultCount>0</UCPTfaultCount>

<Item>
<UCPTname>Net/Modbus

Channel

2</UCPTname>

</Item>
</iLonItem>

Advertising