EmbeddedRelated.com
Forums

one Devicenet Question please

Started by pmm May 13, 2004
Dear sir

(Note to Mr Kevin Kramb:-sir i have followed your previous replies and
i didnot get chance to thank you. thanks for you previous replies they
helped me a lot )
 
I have been working on IO control application. i have a doubt
regarding POLL IO messages .i have a 4 in and 4 out Devicenet IO
module . I wanted to implement the Poll support. i am not able to
decide what will be the data send by the master in the Poll command
,so that my Slave module will open the packet and retrieve the info
and set them appropriately .ie if masterwants to send a command to my
4in 4out device in Poll format what it will send in bit datastream (8
bytes )other than produced and consumed conn Ids
Please reply and help me to complete my project 
Regards
"pmm" <muralipmanohar@hotmail.com> wrote in message
> I have been working on IO control application. i have a doubt > regarding POLL IO messages .i have a 4 in and 4 out Devicenet IO > module . I wanted to implement the Poll support. i am not able to > decide what will be the data send by the master in the Poll command > ,so that my Slave module will open the packet and retrieve the info > and set them appropriately .ie if masterwants to send a command to my > 4in 4out device in Poll format what it will send in bit datastream (8 > bytes )other than produced and consumed conn Ids > Please reply and help me to complete my project > Regards
The Poll Command message sent from the master to the slave can contain any amount of data. If your slave device has four digital outputs then perhaps your plan is for the master to control these outputs. If that is the case then I would expect you will send one byte of data in the Poll Command. Four of the bits in this byte would correspond to how the four outputs should be driven. The remaining four bits could be ignored. Similarly, the Poll Response message sent from the slave to the master can also contain any amount of data. But I expect you only need to send one byte of data in which four of the bits correspond to the four input values. -- Kevin
"Kevin Kramb" <kekramb.invalid@ra.rockwell.com.invalid> wrote in message news:<10a8cghtcb3nu27@corp.supernews.com>...
> "pmm" <muralipmanohar@hotmail.com> wrote in message > > I have been working on IO control application. i have a doubt > > regarding POLL IO messages .i have a 4 in and 4 out Devicenet IO > > module . I wanted to implement the Poll support. i am not able to > > decide what will be the data send by the master in the Poll command > > ,so that my Slave module will open the packet and retrieve the info > > and set them appropriately .ie if masterwants to send a command to my > > 4in 4out device in Poll format what it will send in bit datastream (8 > > bytes )other than produced and consumed conn Ids > > Please reply and help me to complete my project > > Regards > > The Poll Command message sent from the master to the slave > can contain any amount of data. If your slave device has > four digital outputs then perhaps your plan is for the > master to control these outputs. If that is the case then > I would expect you will send one byte of data in the Poll > Command. Four of the bits in this byte would correspond > to how the four outputs should be driven. The remaining > four bits could be ignored. > > Similarly, the Poll Response message sent from the slave to > the master can also contain any amount of data. But I > expect you only need to send one byte of data in which > four of the bits correspond to the four input values. > > -- Kevin
Dear Mr Kevin Thank you for the reply yes I can get that but my problem is how does the slave identify that the data is intended to a specific instance for eg in this code i have two instances of assembly object one is Input and the other is ofcourse output. (I am thinking as if i am a slave )know i got the byte which contain the specific info. how can i identify that the info is intended to input instance(points ) or output instance (points ). (If as master )I want to send the information of 4 bits to a slave IO device thats okay but for whom? input or output. it can be possible if I send the data of 2 byte instead of one .first byte contains instance Id and second byte has information (can i send the instance info in the data bytes ?).plz correct me if i am not heading on right path one clarification needed for me is that the data in poll is vendor defined?.
"pmm" <muralipmanohar@hotmail.com> wrote in message
news:1f1fe31f.0405142248.51e1c9c7@posting.google.com...
> "Kevin Kramb" <kekramb.invalid@ra.rockwell.com.invalid> wrote in message
news:<10a8cghtcb3nu27@corp.supernews.com>...
> > "pmm" <muralipmanohar@hotmail.com> wrote in message > > > I have been working on IO control application. i have a doubt > > > regarding POLL IO messages .i have a 4 in and 4 out Devicenet IO > > > module . I wanted to implement the Poll support. i am not able to > > > decide what will be the data send by the master in the Poll command > > > ,so that my Slave module will open the packet and retrieve the info > > > and set them appropriately .ie if masterwants to send a command to my > > > 4in 4out device in Poll format what it will send in bit datastream (8 > > > bytes )other than produced and consumed conn Ids > > > Please reply and help me to complete my project > > > Regards > > > > The Poll Command message sent from the master to the slave > > can contain any amount of data. If your slave device has > > four digital outputs then perhaps your plan is for the > > master to control these outputs. If that is the case then > > I would expect you will send one byte of data in the Poll > > Command. Four of the bits in this byte would correspond > > to how the four outputs should be driven. The remaining > > four bits could be ignored. > > > > Similarly, the Poll Response message sent from the slave to > > the master can also contain any amount of data. But I > > expect you only need to send one byte of data in which > > four of the bits correspond to the four input values. > > > > -- Kevin > > Dear Mr Kevin > Thank you for the reply > yes I can get that but my problem is how does the slave identify that > the data is intended to a specific instance for eg in this code i have > two instances of assembly object one is Input and the other is > ofcourse output. > (I am thinking as if i am a slave )know i got the byte which contain > the specific info. how can i identify that the info is intended to > input instance(points ) or output instance (points ).
The Poll Command message sent from the master to the slave has a unique connection ID that is predefined by the DeviceNet spec. Remember with an I/O message such as the Poll command the meaning of the data in implicitly defined by the connection ID. When the slave receives a message on this connection ID, it knows that this is the Poll Command from the master. And your application code can know to copy the data in this message to a specific Assembly instance associated with the output data (and/or know to drive the actual outputs according to the data). Your slave application should also know that it needs to send the Poll Response after receiving the Poll command. It will know to get the data from the Assembly instance associated with the input data (and/or know to read the actual input values.) The Poll Response also has a unique Connection ID predefined by the DeviceNet spec. When I say "know" above, I mean that this can be hard coded into your slave application.
> (If as master )I want to send the information of 4 bits to a slave IO > device thats okay but for whom? input or output.
I don't understand why the master would consider sending input data to the slave. I'm assuming that your slave measures the inputs and sends the input data to the master in the Poll Response. Inputs are one-way from the slave to the master. Outputs are one-way from the master to the slave. Do I misunderstand?
> it can be possible if I send the data of 2 byte instead of one .first > byte contains instance Id and second byte has information (can i send > the instance info in the data bytes ?).plz correct me if i am not > heading on right path
Yes it is possible to do this sort of thing. But I don't see the need from what I understand about your application. If you had a more complex slave and for some reason wanted to multiplex the data sent via the Poll Command/Response then you might consider something like this.
> one clarification needed for me is that the data in poll is vendor > defined?.
Yes. Unless you are creating a device to match one of the standard Device Profiles defined in the DeviceNet Spec. There are standard Device Profiles for simple slaves such as a limit switch or photoelectric sensor. These standard Device Profiles may define the format of the Poll and other I/O messages. -- Kevin
"Kevin Kramb" <kekramb.invalid@ra.rockwell.com.invalid> wrote in message news:<10aeukmnbjgksc8@corp.supernews.com>...
> "pmm" <muralipmanohar@hotmail.com> wrote in message > news:1f1fe31f.0405142248.51e1c9c7@posting.google.com... > > "Kevin Kramb" <kekramb.invalid@ra.rockwell.com.invalid> wrote in message > news:<10a8cghtcb3nu27@corp.supernews.com>... > > > "pmm" <muralipmanohar@hotmail.com> wrote in message > > > > I have been working on IO control application. i have a doubt > > > > regarding POLL IO messages .i have a 4 in and 4 out Devicenet IO > > > > module . I wanted to implement the Poll support. i am not able to > > > > decide what will be the data send by the master in the Poll command > > > > ,so that my Slave module will open the packet and retrieve the info > > > > and set them appropriately .ie if masterwants to send a command to my > > > > 4in 4out device in Poll format what it will send in bit datastream (8 > > > > bytes )other than produced and consumed conn Ids > > > > Please reply and help me to complete my project > > > > Regards > > > > > > The Poll Command message sent from the master to the slave > > > can contain any amount of data. If your slave device has > > > four digital outputs then perhaps your plan is for the > > > master to control these outputs. If that is the case then > > > I would expect you will send one byte of data in the Poll > > > Command. Four of the bits in this byte would correspond > > > to how the four outputs should be driven. The remaining > > > four bits could be ignored. > > > > > > Similarly, the Poll Response message sent from the slave to > > > the master can also contain any amount of data. But I > > > expect you only need to send one byte of data in which > > > four of the bits correspond to the four input values. > > > > > > -- Kevin > >
Dear Mr Kevin thanks for the reply
> Your slave application should also know that it needs to send > the Poll Response after receiving the Poll command. It will > know to get the data from the Assembly instance associated with > the input data (and/or know to read the actual input values.) > The Poll Response also has a unique Connection ID predefined by > the DeviceNet spec.
Yes sir i have read the connection format and i am clear with them ie master sends a grp2 command with msgID 101 along with slave's MAC ID and slave sends the response in grp1 with massage id 'F' and its MAC id and some bunch of data as application data only.I am very much confused about these 8 data bytes I can code my own logical analysation but what happens if my device used with other master, how does he know that 'to set the output he needs to send so and so... and to get so and so ..' thats what i am worried of
> When I say "know" above, I mean that this can be hard coded into > your slave application. > > > (If as master )I want to send the information of 4 bits to a slave IO > > device thats okay but for whom? input or output. > > I don't understand why the master would consider sending input > data to the slave. I'm assuming that your slave measures the > inputs and sends the input data to the master in the Poll Response. > Inputs are one-way from the slave to the master. Outputs are > one-way from the master to the slave. Do I misunderstand?
No No ,:-) I placed the question in wrong format sorry One thing from spec I can say that only master has the authority to start & initiate the converstion b/w slave and it self ,am I right here sir ? if this is the case if master wants to see the status of inputs he needs to send a command to slave asking for the status of inputs so what does he send in the data bytes .that is one part of my confusion . (I am thinking to send just instance ID only of Input Assembly and no extra data so that slave thinks that ither instance ID is of Input instance i need to respond with the input status )is it correct ? For Output. if master wants to know the current status of output points what he normally sends in the data part .and if he wants to change these output status to some other format ie set new values what does he send .that is the other part of my problem. bcos the poll part spec say that application related data in those 8 bytes there is no information regarding what a slave receives as command to set/get for output ,and what a slave recieves as command to send the status of its inputs to master hope I explained my problem properly waiting for your reply Regards PMM
"pmm" <muralipmanohar@hotmail.com> wrote in message
<snip>
> I am very much > confused about these 8 data bytes I can code my own logical > analysation but what happens if my device used with other master, how > does he know that 'to set the output he needs to send so and so... and > to get so and so ..' thats what i am worried of
The typical master will NOT know application specific information such as what is the purpose of this input or that output. Typically, the master interfaces to a controller (PLC) and it is in the controller's programming where the application specific processing occurs. The controller is programmed by the user (perhaps via ladder logic) to know the purpose of each input and output.
> One thing from spec I can say that only master has the authority to > start & initiate the converstion b/w slave and it self ,am I right > here sir ?
Well... It is true that only the master establishes the Predefined Master/Slave Connection Set connections such as the Strobe, Poll, and COS connections with a slave. If that is what you meant then you're right.
> if this is the case if master wants to see the status of inputs he > needs to send a command to slave asking for the status of inputs so > what does he send in the data bytes .that is one part of my confusion > . > (I am thinking to send just instance ID only of Input Assembly and no > extra data so that slave thinks that ither instance ID is of Input > instance i need to respond with the input status )is it correct ?
For your application, you define (at design time) what is contained in the I/O messages such as the Poll Command and Poll Response. For example, you can design your slave so that whenever it receives the Poll Command it will send the Poll response containing data that corresponds to the current status of the slave's inputs. Then you wouldn't need to send ANY data in the Poll Command because you have IMPLICITLY defined the meaning of the Poll Command (and there is no need to include any data that would further define the message, explicitly).
> For Output. if master wants to know the current status of output > points what he normally sends in the data part .and if he wants to > change these output status to some other format ie set new values > what does he send .that is the other part of my problem.
If your application includes outputs sent from the master to slave then the Poll Command is a convenient place to include this output data. So now, for example, you design your slave to receive the output data in the Poll Command and send the input data in the Poll Response. There is no need to include any other explicit information in these messages because the meaning of the messages is implicitly defined by your application design.
> bcos the poll part spec say that application related data in those 8 > bytes there is no information regarding what a slave receives as > command to set/get for output ,and what a slave recieves as command to > send the status of its inputs to master
There is no information regarding this because it is APPLICATION RELATED. You decide when you design the application. -- Kevin
> If your application includes outputs sent from the master to > slave then the Poll Command is a convenient place to include > this output data. So now, for example, you design your slave > to receive the output data in the Poll Command and send the > input data in the Poll Response. There is no need to include > any other explicit information in these messages because the > meaning of the messages is implicitly defined by your > application design. > > > There is no information regarding this because it is > APPLICATION RELATED. You decide when you design the application. > > -- Kevin
Dear Mr Kevin that is master will send output info and slave will consume it and in response will send input info.This is what you want to say?? oh i was thinking as master will send two separate commands for input and output you actually clubbing these two am i right feels like i am on right path know :-) thanks a lot plz allow me to disturb you in future bye murali