Difference between revisions of "User talk:Achims"

Line 4: Line 4:
This commands give you the possibility to control the relays on the R6 via a modbus command send as a hex-file in a tcp stack.
This commands give you the possibility to control the relays on the R6 via a modbus command send as a hex-file in a tcp stack.


It is easy to connect the R6 module to a Barix device with a RS485 connector. You have to wire Pin6 (A) and Pin9 (B) of the DB9 connector to Pin2 (A) and Pin3 (B) of the J1 connector on the R6.
It is easy to connect the R6 module to a Barix device with a RS485 interface. You have to wire Pin6 (A) and Pin9 (B) of the DB9 connector to Pin2 (A) and Pin3 (B) of the J1 connector on the R6.


Additional you have to power up the R6 on Pin4 (+) and Pin5 (-) with an external power supply.
Additional you have to power up the R6 on Pin4 (+) and Pin5 (-) with an external power supply.


The serial settings for the RS485 (Serial 2) in the device must set to 19200 Bd, 8E1 (8 Databit, parity=even, 1 Stopbit), Handshake to RS485 direction control and local port to 502.
The serial settings for the RS485 interface (Serial 2) in the device must set to 19200 Bd, 8E1 (8 Databit, parity=even, 1 Stopbit), Handshake to RS485 direction control and local port to 502.


Now it is possible to send a hex-file, which includes the modbus command, via tcp to port 502 of the device. This can be done with the NetCat Application (nc ''ip-device''<nowiki> < </nowiki>''filename'' ).
Now it is possible to send a hex-file, which includes the modbus command, via tcp to port 502 of the device. This can be done with the NetCat Application.


{|  class="wikitable"
{|  class="wikitable"
Line 16: Line 16:
!
!
!
!
! Modbusaddress
! Modbusaddress! Single Coil! Address Hi! Address Lo! Value Hi! Value Lo! CRC Lo! CRC Hi
! Single Coil
| -
! Address Hi
| Relay 1Set| 00| 05| 00| 00| FF| FF| CD| AB  
! Address Lo
| -
! Value Hi
| | Reset000500000000CC1B  
! Value Lo
| -
! CRC Lo
| Relay 2Set| 00| 050001FFFF9C6B  
! CRC Hi
| -
|-
| | Reset00| 05| 00| 01| 00| 00| 9D| DB
| Relay 1,Set ,00,05,00,00,FF,FF,CD,AB
| -
|-
| Relay 3| Set | 00| 05| 00| 02| FF| FF| 6C| 6B
|       ,Reset,00,05,00,00,00,00,CC,1B
| -
|-
| | Reset| 00| 05| 00| 02| 00| 00| 6D| DB
| Relay 2,Set  ,00,05,00,01,FF,FF,9C,6B
| -
|-
| Relay 4| Set | 00| 05| 00| 03| FF| FF| 3D| AB
|       ,Reset,00,05,00,01,00,00,9D,DB
| -
|-
| | Reset| 00| 05| 00| 03| 00| 00| 3C| 1B
| Relay 3,Set ,00,05,00,02,FF,FF,6C,6B
| -
|-
| Relay 5| Set | 00| 05| 00| 04| FF| FF| 8C| 6A
|       ,Reset,00,05,00,02,00,00,6D,DB
| -
|-
| | Reset| 00| 05| 00| 04| 00| 00| 8D| DA
| Relay 4,Set ,00,05,00,03,FF,FF,3D,AB
| -
|-
| Relay 6| Set | 00| 05| 00| 05| FF| FF| DD| AA
|       ,Reset,00,05,00,03,00,00,3C,1B
| -
|-
| | Reset| 00| 05| 00| 05| 00| 00| DC| 1A
| Relay 5,Set ,00,05,00,04,FF,FF,8C,6A
| -
|-
|       ,Reset,00,05,00,04,00,00,8D,DA
|-
| Relay 6,Set ,00,05,00,05,FF,FF,DD,AA
|-
|       ,Reset,00,05,00,05,00,00,DC,1A
|-
|}
|}



Revision as of 16:59, 22 October 2009

Modbus Control commands for R6:

This commands give you the possibility to control the relays on the R6 via a modbus command send as a hex-file in a tcp stack.

It is easy to connect the R6 module to a Barix device with a RS485 interface. You have to wire Pin6 (A) and Pin9 (B) of the DB9 connector to Pin2 (A) and Pin3 (B) of the J1 connector on the R6.

Additional you have to power up the R6 on Pin4 (+) and Pin5 (-) with an external power supply.

The serial settings for the RS485 interface (Serial 2) in the device must set to 19200 Bd, 8E1 (8 Databit, parity=even, 1 Stopbit), Handshake to RS485 direction control and local port to 502.

Now it is possible to send a hex-file, which includes the modbus command, via tcp to port 502 of the device. This can be done with the NetCat Application.

Modbusaddress! Single Coil! Address Hi! Address Lo! Value Hi! Value Lo! CRC Lo! CRC Hi - Set| 00| 05| 00| 00| FF| FF| CD| AB - Reset| 00| 05| 00| 00| 00| 00| CC| 1B - Set| 00| 05| 00| 01| FF| FF| 9C| 6B - Reset| 00| 05| 00| 01| 00| 00| 9D| DB - Set | 00| 05| 00| 02| FF| FF| 6C| 6B - Reset| 00| 05| 00| 02| 00| 00| 6D| DB - Set | 00| 05| 00| 03| FF| FF| 3D| AB - Reset| 00| 05| 00| 03| 00| 00| 3C| 1B - Set | 00| 05| 00| 04| FF| FF| 8C| 6A - Reset| 00| 05| 00| 04| 00| 00| 8D| DA - Set | 00| 05| 00| 05| FF| FF| DD| AA - Reset| 00| 05| 00| 05| 00| 00| DC| 1A -


Please note: It is necessary to calculate a crc-check-sum for each command and add it to the command itself.


Here you can find a online crc-calculator:

http://www.lammertbies.nl/comm/info/crc-calculation.html