Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

devicet : can't access config state for poll i/o

I am using your devicenet interface card on my laptop. I need to be able to
set an attribute for the I/O connection. The attribute is
PRODUCED_CONNECTION_PATH for the poll connection (instance #2 of the
Connection Object ID #5).

However, this attribute can only be set if the Poll I/O connection is in
the
configuring state, as shown in the attached pdf file taken from the
DeviceNet
Specifiation (page V-I, rev2, page 5-43).

The Poll i/o connection is normally taken to the CONFIGURING STATE as
follows:

I use the Master/Slave predefined connection
(typically)

ALLOCATE EXPLICIT CONNETION (1)
SET EPR FOR EXPLICIT CONNECTION TO 0 (NO TIME OUT)
(epr == expected packet rate)
ALLOCATE POLL CONNECTION

Poll connection is now in the configuration mode, allowing the above
attributes to be set over the explicit connection.

To change the poll connection to the Established State, you just set the
poll
epr, or

SET EPR FOR POLL TO 0 (NO TIME OUT) OR TO ANY OTHER RATE DESIRED.

Now when I use your subroutines to open the poll io channel (ncOpenDnetIO
(...)), your subroutine always immediately sets the poll epr, causing the
mode to be Established which prevents me from setting the attributes on the
connection object.

Any solution?

Also, do you have any lower level commands that I can use, where I can
build
up my own devicenet messages?

I think you need to write a new subroutine, as follows:

NAME:

ncConfigDnetIO( IntfName, DeviceMacID, etc)

FUNCTION:

allocates the poll connection, but does not set the epr, establishing the
poll connection into the CONFIGURING STATE.

You then need a function to set the epr, although I could do just do that
with an explicit message.
You will also need to update NC_ATTR_STATE to include configuring as a
state.

Also, in the subroutine ncOperateDnetInf, you have the following opcodes:
START
STOP
ACTIVE
IDLE

Since these terms are not used in the DeviceNet specification, I'm a little
bit at a loss to understand what they do. Please refer to section 5-4.6 of
volume 1 (page 5-36 of rev2) and look at the Figure 5.14 and Table 5.22.
These are the I/O Configuration Object State Transistion Diagram andthe I/O
Connection State Event Matrix, respectively. Could you explain how your
opcodes above correspond to the DeviceNet Spec?

If I were to guess I might make the following assumptions:
START ----> take connection to "configuring state"
STOP ----> delete the connection, taking it to the"non-existent state"
ACTIVE ---> take the connection to the "established state"
IDLE ---- > take the connection to the "timed out state"

Am I guessing correctly? I really don't want to have to reverse engineer
this. Also, it would be a help if you used the terminology in the
DeviceNet
specification, instead of making up your own.

Finally, since the poll produced_connection_path is volatile, it is not
possible to preset with another controller and then use it on your system.

--
Jerry C. Wyss, Colorado Flow Technology, Inc.
4939 N Broadway Suite #66A, Boulder CO 80304
Work: (303) 440-0730 Home: (303) 494-1971 (voice/fax)
Fax: (303) 545-2615 Mobile: (303) 641-3225 (preferred number to call)
VoiceMail: (800) 253-2047
0 Kudos
Message 1 of 4
(4,536 Views)
I've done some further "computer code experiments" to determine what START, STOP etc do in your subroutine.
START does not take you to a config mode -- it allocates the poll channel, sets the Expected Packet Rate and starts sending poll requests. So it blows right by the config state on the poll channel.
I'm attaching a pdf file that shows the access rules for the poll channel, taken from the DeviceNet Spec.
This clearly shows that the assembly path (attribute 14) can only be SET when the poll mode is in the configuration state.
0 Kudos
Message 2 of 4
(4,536 Views)
Try using Explicit Messaging (EM) to allocate the IO connection manually. Then, change the desired attributes. After closing the IO connection, doing an ncOpenDNetIO should allocate the connection with the same attributes. Attached is a C program that demonstrates this.
Message 3 of 4
(4,536 Views)
Thank you for the suggestion to use the explicit message to allocate the poll directly. Great idea. Also, thank you for the code fragment. I corrected a few typos and have attached it here. (choice byte for poll is 0x02, not 0x20 and service data for allocation needs the mastermacid as a byte after the choice byte.) It now compiles.
Thanks again.
0 Kudos
Message 4 of 4
(4,536 Views)