Port of FreeModbus to LPC11xx

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Port of FreeModbus to LPC11xx

1,906 次查看
wiktor_sleziak
Contributor I

Hello,

I am working on a temperature measurring device. Currently, I must do a communication with PC. UART is working great, I can send and receive any strings. Main goal is use a Modbus RTU protocole and I got stuck with this.

I am using a LPC241x demonstration project from freemodbus-v1.5.0 to convert for my program. I changed all VIC interrupts function to NVIC in portserial.c, porttimer.c and portevent.c. Also I modfied port.c and I used portmacro.h. After compilation i get no errors, but when  I start Modbuss Poll,  finally I am getting a nothing.

I have hope that someone help with this subject.

/* ----------------------- Start implementation -----------------------------*/
int
main( void )
{
   eMBErrorCode eStatus;

   eStatus = eMBInit( MB_RTU, 0x0A, 0, 38400, MB_PAR_EVEN );

   /* Enable the Modbus Protocol Stack. */
   eStatus = eMBEnable( );

   for( ;; )
   {
      ( void )eMBPoll( );

      /* Here we simply count the number of poll cycles. */
      usRegInputBuf[0]++;
   }
}

0 项奖励
回复
2 回复数

1,510 次查看
vicentegomez
NXP TechSupport
NXP TechSupport

Hi

can you please confirm the part number that you are using?

Regards

Vicente

0 项奖励
回复

1,226 次查看
xueyuquan
Contributor I

I am working on a temperature measurring device. Currently, I must do a communication with PC. UART is working great, I can send and receive any strings. Main goal is use a Modbus RTU protocole and I got stuck with this.

I am using a LPC1111 demonstration project from freemodbus-v1.6 to convert for my program. I changed all VIC interrupts function to NVIC in portserial.c, porttimer.c and portevent.c. Also I modfied port.c and I used portmacro.h. After compilation i get no errors, but when  I start Modbus Poll,  finally I am getting a nothing.

I have hope that someone help with this subject.

0 项奖励
回复