circuitcellar.com
Magazine Support   Digital Library   Products & Services   Suppliers Directory 
 
 





 

Issue 99, October 1998
Networking with DeviceNet—Part 2: A Weather Station Application


by Jim Brady

Start Can Chips Chip Setup Real Time Message Flow Connections Timers Analog Input Point Identity Object Fragmented Messages Getting Physical Applying DeviceNET Software,Sources

MESSAGE FLOW

Figure 1 shows message routes in the system. Explicit and I/O Poll messages come in through their respective mailboxes. Explicit messages are routed via the path specified in the message and can access almost any object in the device. I/O Poll messages grab preselected data from a buffer in the Assembly object and quickly send it.

The weather-station sends three bytes—device status, temperature, and humidity. I can send more data by adding it to the existing assembly or creating a second assembly. The device manufacturer determines which data goes into the assemblies.

At the top of Figure 1 is the unconnected port, which the master uses to allocate the connections it wants to use. Technically, connections don’t exist prior to allocation.

This situation implies using C++ dynamic allocation. Although you can do this, I chose to create static objects at the beginning of main() and use the constructor to set the initial connection state to nonexistent.