![Anybus CompactCom 40 Common Ethernet Design Manual Download Page 44](http://html1.mh-extra.com/html/anybus/compactcom-40-common-ethernet/compactcom-40-common-ethernet_design-manual_2948756044.webp)
42 (104)
Example (Get_Attribute):
This example shows how to retrieve the IP address using printf() and ABCCMessage().
<?--#exec cmd_argument='printf( "%u.%u.%u.%u",
ABCCMessage(4,3,1,5,0,0,NONE,UINT8[4] ) )'-->
Variable
Value
Comments
object
4
Network Configuration Object (04h)
instance
3
Instance #3 (IP address)
command
1
Get_attribute
ce0
5
Attribute #5
ce1
0
-
msgdata
0
-
c_type
NONE
Command message holds no data
r_type
UINT8[4]
Array of 4 unsigned 8-bit integers
Example (Set_Attribute):
This example shows how to set the IP address using scanf() and ABCCMessage(). Note the
special parameter value “ARG”, which instructs the module to use the passed form data (parsed
by scanf() ).
<?--#exec cmd_argument='scanf("IP", "%u.%u.%u.%u",
ABCCMessage(4,3,2,5,0,ARG,UINT8[4],NONE ) )'-->
Variable
Value
Comments
object
4
Network Configuration Object (04h)
instance
3
Instance #3 (IP address)
command
2
Set_attribute
ce0
5
Attribute #5
ce1
0
-
msgdata
ARG
Use data parsed by scanf() call
c_type
UINT8[4]
Array of 4 unsigned 8-bit integers
r_type
NONE
Response message holds no data
Anybus
®
CompactCom
™
40 Common Ethernet Design Guide
HMSI-27–269 2.1