Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Modbus rtu Sendop Continous

Modbus rtu Sendop Continous 8 years 3 months ago #7935

  • seec
  • seec's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 78
  • Karma: 0
Hi Claes

I use ModBus RTU as example for my Hitachi project.

At starup with Sendop=0 and Continous=No (ModBus_RTU_Slave)

**********************************************
typedef pwr_tEnum pwr_tYesNoEnum;

typedef enum {
pwr_eYesNoEnum_No = 0,
pwr_eYesNoEnum_Yes = 1,
} pwr_eYesNoEnum;
**********************************************





I get the value Continous == 4 ?????? then value should be 0
undefined???

after the first scan (Start Runtime) the value is change to Continous == 0

I don't know why its starts with the value 4
but in my case is starts with sending all the programmed messages.(only one time)


I solved this problem with the next changes:


IN rt_io_m_mb_rtu_master.c :
********************************************************************************************

for ( i = 0; i < modules; i++) {
sts = 1;

if (!modulep->Continous[/b] && !modulep->SendOp) {
break;
}

local_card = &((io_sCardLocal *)cardp->Local)->msg;
if ( modulep->ScanInterval > 1 && local_card->interval_cnt != 0) {
modulep++;
continue;
}
****************************************************************************************

I change it to :
****************************************************************************************


for ( i = 0; i < modules; i++) {
sts = 1;

if (!(module_p->Continous==pwr_eYesNoEnum_Yes) && !modulep->SendOp) { <----change--
break;
}

local_card = &((io_sCardLocal *)cardp->Local)->msg;
if ( modulep->ScanInterval > 1 && local_card->interval_cnt != 0) {
modulep++;
continue;
}


***************************************************************************************
The administrator has disabled public write access.

Modbus rtu Sendop Continous 8 years 3 months ago #7937

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3176
  • Thank you received: 502
  • Karma: 133
Hi cees,

I suspect some c-code you have written acually writes outside the IO object where it's supposed to write and puts that 4 into the continous attribute of the RTU object. This is a severe error and I think you should find out where that 4 comes from instead of fixing the symptoms.

/Claes
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 9.022 seconds