キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

READING/WRITING REGISTERS TO A MODBUS TCP SLAVE TO RS485 MASTER GATEWAY

解決済み
解決策を見る

Hello, i have been having issues with the connection to a modbus tcp slave gateway (HD67508-A1-485). The code is really simple and the connection works perfectly with MODBUS POLL (using the exact same register address as the labVIEW code below). Im using the free modbus library. 

As i dont think the archives are needed, here is the labview code, the working Modbus Poll configuration and the ERROR 56 (exiting while).

The problem is probably related to the slave ID and the initialization of the tcp instance.

 

Thannk you for your time!

If anyone needs further information pls let me know.

 

:MODBUS POLL Connection to GatewayMODBUS POLL Connection to GatewayMODBUS POLL Write Single RegisterMODBUS POLL Write Single RegisterlabVIEW CodelabVIEW CodeERROR Exiting WhileERROR Exiting While

 

 

0 件の賞賛
メッセージ1/5
1,571件の閲覧回数
解決策
トピック作成者APG-Bが受理

your code keeps writing on the register every 20 ms. 

Do you need to repeatedly write at this frame rate ? I wonder if you increase the time  between writting if the error will go away. 

0 件の賞賛
メッセージ2/5
1,527件の閲覧回数

What does the manual say about the registers, are they starting from 0 or from 1 ? 

Could be a misalignment, so have you tried address 2000? 

 

LabVIEW modbus has the address input as 0 based, but some models/devices has there address in manuals start at 1.   

0 件の賞賛
メッセージ3/5
1,518件の閲覧回数
解決策
トピック作成者APG-Bが受理

Problem solved, it was related to timings and termination. Seems like i can now have the program working well with 20ms but had to turn it to 2000ms for it to work without termination.

 

Thanks!!

0 件の賞賛
メッセージ4/5
1,478件の閲覧回数

dkfire, in this case register is set by a translate table. It works well now with register 2001, still, i will keep it in mind for other projects, seems like a really usual cause of error.

 

Thank you for the answer!

0 件の賞賛
メッセージ5/5
1,476件の閲覧回数