industrialNETworXnetx

Rainer Versteeg

Rainer Versteeg

| 27.08.2008 | 16:30 | 17 replies

Profbus State indication change from Operate to Stop

HI,

We have the actual Profibus slave linkable object file and test this on a NXDB500 SYS board.

On the CD there as a demo project. I tested the profibusdemo Task. On the other side there is a Hilscher Profibus Master card with the configured slave. In the Sycon configurator there is all green and running.

In Profibusdemo Task there is a State indication. This indication change cyclic from RCX_COMM_STATE_OPERATE to RCX_COMM_STATE_STOP.

In the Datachange function I became sometimes value of 0.

What is wrong ?

Br,
Rainer

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 28.08.2008 | 06:42

Hi Rainer,

Rainer Versteeg wrote:
What is wrong ?

Good question.

Without a bus trace it is like reading of coffee grounds.

    What kind of master are you using? Which version of the Hilscher stack are you using?
    How is your configuration?
    How is the watchdog configured?

I prefer to check the timer, baudrate and watchdog settings.

[/]

Rainer Versteeg

Rainer Versteeg

| 28.08.2008 | 09:06

HI AJ,

I use a CIF 50 PB Master card.

The profibus slave stack version is from 03/2008 V2.0. I use the slave demo from your CD.

The configuration in your demo is:

ptPck->tInitMs0Req.tData.fSyncSupported   = TRUE;
    ptPck->tInitMs0Req.tData.fFreezeSupported = TRUE;
    ptPck->tInitMs0Req.tData.fNoAddChg        = FALSE;
    ptPck->tInitMs0Req.tData.usIdentNumber    = (TLR_UINT16)ptRsc->tLoc.tMscy1s.uIdentNumber;
    /* Copy the configuration data bytes */
    ptPck->tInitMs0Req.tData.fFailSafeSupp    = TRUE;
    ptPck->tInitMs0Req.tData.fDpv1Enabled     = TRUE;
    ptPck->tInitMs0Req.tData.bSlaveAddr       = PROFIBUS_SLAVE_ADDRESS;
    ptPck->tInitMs0Req.tData.bDataRate        = PROFIBUS_FSPMS_DATA_RATE_1500;

The dataexchange time in your demo is 3 ms.

I did not find any watchdog configuration in your slave demo. The watchdog time in the master is set configured to 1000 ms. The datatranfer mode in the master is "gepuffert, anwendergesteuert". I make the slave configuration in the master over "Netzwerkstruktur einlesen".

Br,
Rainer

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 29.08.2008 | 09:22

Hi Rainer,

which version of the PROFIBUS slave stack do you have? The version you told "03/2008 V2.0." is not the real stack version.
Normally you should find a "get_ver.bat" file in library folder. This will help you to read out the version of the library.
Please open a command box and type "get_ver.bat libdpsap_netX100.a"

Now you should get at the end (or maybe at the beginning) the stack version.

Quote:
D:\Profibus\Lib>"C:\Programme\Hitex\GnuToolPackageArm\/bin/arm-hitex-elf-objdump.exe" -sj .hilscher_version libdpsap_netX100.a
In archive libdpsap_netX100.a:

libdpsap_netX100_buildstamp.o: file format elf32-littlearm

Contents of section .hilscher_version:
0000 22445053 5f56322e 302e3130 2e30220d "DPS_V2.0.10.0".
0010 0a0d0a ...

ProfibusAps_Functions.o: file format elf32-littlearm

ProfibusAps_Process.o: file format elf32-littlearm

ProfibusAps_Resources.o: file format elf32-littlearm

ProfibusAps_Body.o: file format elf32-littlearm

D:\Profibus\Lib>

As far as I know is this the last released version from Hilscher. If your version is older, you should get in contact with Hilscher for the latest release. Maybe this will solve your problem.

Rainer Versteeg

Rainer Versteeg

| 29.08.2008 | 14:57

HI AJ,

My profibus slave stack version is 2.07xx.

I have received now version 2.010xx.

I got the same error with the new profibus slave demo that I received today per email.

Can you test it self :?:

Br,
Rainer

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 29.08.2008 | 15:39

Hi Rainer,

I made a test with the same configuration you have. By accident I have also a 500-SYS and a cif50 PB board.
I used the same settings like you and the same versions.

On my side it is running without any problem. I used the original example, which is provided from Hilscher, without any changes on it.

Rainer Versteeg

Rainer Versteeg

| 29.08.2008 | 16:25

HI AJ,

Can you send me the master configuration :?:

Br,
Rainer

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 01.09.2008 | 06:29

Hi Rainer,

I made the same steps like you. I used the network scan option from Sycon32.

Rainer Versteeg

Rainer Versteeg

| 01.09.2008 | 10:21

HI AJ,

Which GSD file do you use ?

Br,
Rainer

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 01.09.2008 | 10:30

Hi Rainer,

the delivered one "HIL_0A12.GSD".

Rainer Versteeg

Rainer Versteeg

| 01.09.2008 | 10:51

HI AJ,

I have tested the profibus slave on the NXSB100 Board, NXDB500-SYS Board and on our Board. All Boards makes the same.

In PbDemo_StateChanged_ind it toggled between state STOP and Operate. I set a breakpoint on the case Label RCX_COMM_STATE_STOP and the program stops here.

void FAR PbDemo_StateChanged_ind(PROFIBUS_DEMO_RSC_T FAR* ptRsc, PROFIBUS_DEMO_PACKET_T FAR* ptPck)
{
  if (ptPck->tStateChangedInd.tData.ulState != (-1))
  {
    /* Handle the new State */
    switch (ptPck->tStateChangedInd.tData.ulState)
    {
      case RCX_COMM_STATE_STOP:
        Mid_LedSetState(ptRsc->tRem.hErrorLed,   LED_MODE_ON, 500, 50);
        Mid_LedSetState(ptRsc->tRem.hReadyLed, LED_MODE_OFF, 0, 0);
        break;

case RCX_COMM_STATE_IDLE:
Mid_LedSetState(ptRsc->tRem.hErrorLed, LED_MODE_ON, 0, 0);
Mid_LedSetState(ptRsc->tRem.hReadyLed, LED_MODE_OFF, 0, 0);
break;

case RCX_COMM_STATE_OPERATE:
Mid_LedSetState(ptRsc->tRem.hErrorLed, LED_MODE_OFF, 0, 0);
Mid_LedSetState(ptRsc->tRem.hReadyLed, LED_MODE_ON, 0, 0);
break;

default:
break;

}
}
} /* PbDemo_StateChanged_ind */

Do you now why this can be happen or what do you hear about something :?:

Br,
Rainer

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 01.09.2008 | 10:59

Hi Rainer,

the problems are the breakpoints.

It is not possible to set a breakpoint at one of the lines from the case "case RCX_COMM_STATE_STOP:" or "RCX_COMM_STATE_OPERATE:". You will always run into this breakpoints.

The reason is, that when you stop with one of the breakpoints, the internal PROFIBUS timout value is reached. In this case the stack try to reconnect again. That is the reason, why you will stop in both breakpoints.

Rainer Versteeg

Rainer Versteeg

| 01.09.2008 | 11:05

HI AJ,

The profibus slave is running and then i only set one breakpoint at runtime on the RCX_COMM_STATE_STOP case. Normally the programs never stops on this breakpoint :?:

Br,
Rainer

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 01.09.2008 | 11:21

The CPU is also stopped, when you are using the functionality "set breakpoint at runtime".
When I do the same I will also reach the break points. When I have no breakpoints the stack is working without any interruption of the communication. The process data's are also updated.

Rainer Versteeg

Rainer Versteeg

| 01.09.2008 | 14:32

HI AJ,

Thank you for the information. The breakpoint was it. Now i send a string over USB when the data is change to zero. I have test it one hour and the data is OK.

Br,
Rainer

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 01.09.2008 | 14:36

Great news :D

Teapot

Teapot

| 21.10.2008 | 09:29

Hi, AJ.
And under what conditions the stack becomes the state RCX_COMM_STATE_STOP?

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 21.10.2008 | 11:45

Hi Teapot,

the stack will signal a stop state as soon the state machine leaves data exchange and went into wait for parameter.

Login