Hello,
I am trying to setup PROFINET IO device on comX module. I am accessing the netX via DPM from host (powerPC) running with Linux. In netX I use fimware COMXREPNS.NXF
Initialization via warmstart works correctly, but manual setup of PROFINET IO device fails.
I have similar problem to one, mentioned in
http://board.hilscher.com/viewtopic.php?f=37&t=323
According to PROFINET IO manual (PROFINET IO RT Device Protocol API.pdf) and thread mentioned above I use following sequence of packets sent to communication channel mailbox.
1. set network configuration (command PNS_IF_CFG_SET_NETWORK_CFG_REQ = 0x1FBE )
the response status is OK (ulSta=0)
2. set device info (command PNS_IF_CFG_SET_DEVICEINFO_REQ = 0x1FA6 )
the response status is OK (ulSta=0)
3. register AP (command PNS_IF_REGISTER_AP_REQ = 0x1F62 )
the response status is OK (ulSta=0)
4. open device (command PNS_IF_CFG_OPEN_DEVICE_REQ = 0x1FA8 )
the response status is OK (ulSta=0)
5. add API (command PNS_IF_CFG_ADD_API_REQ = 0x1FAA )
the one that doesn't need hDeviceHndl, the status is also OK (ulSta=0)
I am stuck here, because if I try getting the device handle (command PNS_IF_GET_DEVICE_HANDLE_REQ) the status is 0xC0300009 (no device instance open).
Is this sequence correct (complete)??
On top of that, when I try read out diagnostic buffer (command PNS_IF_GET_DIAGNOSIS_REQ = 0x1FB2) I get following output no matter which packets from above I send.
diagnostic: PN state: 0 last error of PN: 0 last TLR result: 0 config state: 0 link state: 1 reply state: 0 Device Information is set: NO PROFINET Stack is started: NO Device Instance is opened: NO API is added: NO Module 0 is plugged: NO Module 0 and Submodule 1 are plugged: NO Network Communication is allowed: NO Network Communication is enabled: NO Error occured on the core stack level: NO Last return value from rcX: 0 (0==success) Configuration status: 'Not configured' Physical link status: 'Physical link works correctly'
getting station name: name 'Default.Station.Name', ret 0, status 0 getting station name: type 'Default.Station.Type', ret 0, status 0 network configuration: (ret: 1, status: 0) IP:0, mask:0, gateway:0
thank you for answer
Hello,
thank You a lot, the initialization finally works now.
I had older revision of the manual You mentioned, after getting the newest one I found everything.
Hilscher Gesellschaft fuer Systemautomation mbH
Great :D
Hello,
I have several more questions. Considering the same host as above (accessing the netX via DPM from host (powerPC) running with Linux).
The first question is about write request packet handling. When using firmware COMXREPNS.NXF (version 2.1.2.0, date 9.5.2008), the indication of write request packet (0x1F3A) is sent to host, but the reply to PROFINET controller states: 'application: feature not supported' (error code 0xDF80A900). It doesn't matter whether the response (PNS_IF_WRITE_RECORD_RES) is sent (or its content).
When the configuration of stack is different than what controller expects, the packet PNS_IF_CHECK_IND (0x1F16) should be send to host. If module/submodule with invalid identification is inserted, the packet is sent. However when module/submodule is missing, this misconfiguration is reported to controller in 'Connect response' packet but not to host application.
The last question is, whether is possible to send packet 'Application ready' on request of host, not automatically by firmware (as it is now)?
thank you for answer
Hilscher Gesellschaft fuer Systemautomation mbH
Hi kajienk,
The first question is about write request packet handling. When using firmware COMXREPNS.NXF (version 2.1.2.0, date 9.5.2008), the indication of write request packet (0x1F3A) is sent to host, but the reply to PROFINET controller states: 'application: feature not supported' (error code 0xDF80A900). It doesn't matter whether the response (PNS_IF_WRITE_RECORD_RES) is sent (or its content).
When the configuration of stack is different than what controller expects, the packet PNS_IF_CHECK_IND (0x1F16) should be send to host. If module/submodule with invalid identification is inserted, the packet is sent. However when module/submodule is missing, this misconfiguration is reported to controller in 'Connect response' packet but not to host application.
The last question is, whether is possible to send packet 'Application ready' on request of host, not automatically by firmware (as it is now)?
Hello,
Thank You for answer.
Considering write request, I tried reading diagnostic buffer.
diagnostic: PN state: FF last error of PN: 0 last TLR result: 0 config state: 3 link state: 1 reply state: 0 Device Information is set: YES PROFINET Stack is started: YES Device Instance is opened: YES API is added: YES Module 0 is plugged: YES Module 0 and Submodule 1 are plugged: YES Network Communication is allowed: YES Network Communication is enabled: YES Error occured on the core stack level: NO Last return value from rcX (see TRL_Results.h for description): 0 (0==success) Configuration status: 'Configured by application' Physical link status: 'Physical link works correctly'
========================= DATA ====================== 0 0 0 0 68 2E 18 80 0 0 0 0 D8 B0 1C 80 23 0 0 0 0 0 0 0 0 0 0 0 3A 1F 0 0 0 0 0 0 33 33 D7 CC 0 0 0 0 78 BD 18 80 0 0 0 0 0 0 0 0 2 0 0 0 1 0 0 0 1 0 0 0 3 0 0 0 20 8 0 =====================================================
========================= DATA ====================== 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 24 0 0 0 0 0 0 0 0 0 0 0 3B 1F 0 0 0 0 0 0 0 0 0 0 0 0 0 0 78 BD 18 80 0 0 0 0 2 0 0 0 1 0 0 0 1 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 =====================================================
When no response (PNS_IF_WRITE_RECORD_RES) was sent, the packet Write response was sent to PROFINET controller exactly after 1s (according to wireshark trace) with error mentioned above (0xDF80A900).
When response (PNS_IF_WRITE_RECORD_RES) was sent, the same thing happened.
Is there a timeout in the firmware??
According to my observation the response is sent sooner then write response packet, but I doubt the accuracy. Still is it possible that the response arrives too late and is ignored by firmware? Will such scenario produce the error mentioned above?
Do You have any idea what's wrong, or anything that can be helpfull?
best regards
Hilscher Gesellschaft fuer Systemautomation mbH
Hi,
It seems that the packet does not reach the PNS-stack. As a part of the Hilscher packet interface, the response packet should include the unchanged Src (i.e. Source), SrcId (i.e Source Identification), Dst (i.e.Destination), DstId (i.e. Destination) fields of the Indication.
The Response packet needs the changes marked with red:
========================= DATA ======================
0 0 0 0 68 2E 18 80 0 0 0 0 D8 B0 1C 80
24 0 0 0 0 0 0 0 0 0 0 0 3B 1F 0 0
0 0 0 0 0 0 0 0 0 0 0 0 78 BD 18 80
0 0 0 0 2 0 0 0 1 0 0 0 1 0 0 0
3 0 0 0 0 0 0 0 0 0 0 0
=====================================================
Hilscher Gesellschaft fuer Systemautomation mbH
:D good news :D
Andreas Jacob
Hilscher Gesellschaft fuer Systemautomation mbH
Hi kajienk,
the command PNS_IF_GET_DEVICE_HANDLE_REQ is used after the device is completely configured. The device is completely configured when the configuration sequence described in the API Manual 13, Chapter 4.4.3, pp. 49-51 is successfully finished. This means that after the packet with the command PNS_IF_CFG_ADD_API_REQ, packets with following commands should be sent to the task:
PNS_IF_CFG_PLUG_MODULE_REQ * at least module 0 and *
PNS_IF_CFG_PLUG_SUBMODULE_REQ * submodule 1 should be plugged *
RCX_CHANNEL_INIT_REQ * then initialize the configuration *
PNS_IF_GET_DIAGNOSIS_REQ *check if there are no errors occurred and if the:
Device Information is set: NO
PROFINET Stack is started: NO
Device Instance is opened: NO
API is added: NO
Module 0 is plugged: NO
Module 0 and Submodule 1 are plugged: NO *