Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

modbus comms

Hi, I’m using a Triangle Research PLC. The communication protocol is Modbus ASCII/RTU. I have been able to get communication via com port 1 rs232. I keep getting an alarm that says Garbled comms . Response to short.

Can you help?

0 Kudos
Message 1 of 7
(4,576 Views)

Hi,

Try increasing the Receive Gap under Serial Port settings. 

-Khalid

0 Kudos
Message 2 of 7
(4,567 Views)

Thank you for the response.

I have tried to increase the gap as far as 100 and still the same result.

This is what I have the PLC set to

WRITEMODBUS 1, 1, 1000, 1234

Following is an example of the syntax from the PLC manufacturer

 

 

* WRITEMODBUS ch, DeviceID, address, data {* Applicable only to M+ PLC models}

Purpose

Automatically write the 16-bit data to a MODBUS ASCII device using the MODBUS ASCII protocol. The communication baud rate is the default baud rate of that COMM port unless it has been changed by the SETBAUD command.

ch - PLC COMM port number (1-8)
DeviceID - Device ID of the MODBUS device (1 to 255)
address - Zero-offset address of the holding register in the MODBUS device.
data - the 16-bit data to be written to the MODBUS device

Examples

WRITEMODBUS 3, 8, 1000, 1234

Comments:

The data 1234 will be written to the MODBUS device with ID=08 at the holding register offset address 1000 (in MODBUS convention this refer to holding register #41001). The command automatically checks the response string received from the slave device for the correct LRC and the slave address. The status of the operation can be checked in the user program by executing the STATUS(2) function, which will return a ‘0’ if there is any error or if the slave device is not present.

See Also

READMODBUS( ), STATUS(2), NETCMD$( )

  Basic to TBASIC Reference Manual

 

0 Kudos
Message 3 of 7
(4,549 Views)

Thank you for the response.

I have tried to increase the gap as far as 100 and still the same result.

This is what I have the PLC set to

WRITEMODBUS 1, 1, 1000, 1234

Following is an example of the syntax from the PLC manufacturer

 

 

* WRITEMODBUS ch, DeviceID, address, data {* Applicable only to M+ PLC models}

Purpose

Automatically write the 16-bit data to a MODBUS ASCII device using the MODBUS ASCII protocol. The communication baud rate is the default baud rate of that COMM port unless it has been changed by the SETBAUD command.

ch - PLC COMM port number (1-8)
DeviceID - Device ID of the MODBUS device (1 to 255)
address - Zero-offset address of the holding register in the MODBUS device.
data - the 16-bit data to be written to the MODBUS device

Examples

WRITEMODBUS 3, 8, 1000, 1234

Comments:

The data 1234 will be written to the MODBUS device with ID=08 at the holding register offset address 1000 (in MODBUS convention this refer to holding register #41001). The command automatically checks the response string received from the slave device for the correct LRC and the slave address. The status of the operation can be checked in the user program by executing the STATUS(2) function, which will return a ‘0’ if there is any error or if the slave device is not present.

See Also

READMODBUS( ), STATUS(2), NETCMD$( )

  Basic to TBASIC Reference Manual

 

0 Kudos
Message 4 of 7
(4,536 Views)
 "WRITEMODBUS 1, 1, 1000, 1234" is a TBasic command.
I'm wondering how you use it in Lookout.
I think if you want to give 1234 to register 41001, you only need to connect a pot to it and set its value to 1234. no text command is in need.
Ryan Shi
National Instruments
0 Kudos
Message 5 of 7
(4,502 Views)
I think it was a case of too many masters and not enough slaves ... which got solved in another forum.
=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 6 of 7
(4,485 Views)
It seems that Mort has solved the problem.
 
Ryan Shi
National Instruments
0 Kudos
Message 7 of 7
(4,472 Views)