viam-soleng / viam-modbus

Apache License 2.0
1 stars 2 forks source link

I think in Allen-Bradley PLCs, a "WORD" refers to a 16-bit data type #2

Open williamjhyland opened 6 months ago

williamjhyland commented 6 months ago

I don't think uint32, uint64, float32, and float64 correspond to a "WORD" in Allen-Bradley terminology.

I think I need

case "uint16":
    val, err := r.board.client.ReadUInt16(r.offset, r.pinType)
    return int(val), err
williamjhyland commented 6 months ago

Errors:

3/06/24, 11:27:12.597 PM   error robot_server.rdk:component:board/PLCBoard   resource/graph_node.go:230   resource build error: rpc error: code = Internal desc = grpc: error while marshaling: proto: Marshal called with nil   resource rdk:component:board/PLCBoard   model viam-soleng:board:modbus-tcp 
 
3/06/24, 11:27:12.596 PM   error robot_server.process.modbus_/home/pi/latest/viam-modbus.StdErr   pexec/managed_process.go:242   \_ 2024/03/07 04:27:12 ERROR: [core] [Server #1] grpc: server failed to encode response: rpc error: code = Internal desc = grpc: error while marshaling: proto: Marshal called with nil  

3/06/24, 11:27:12.592 PM   info robot_server.process.modbus_/home/pi/latest/viam-modbus.StdOut   pexec/managed_process.go:244   \_ 2024-03-07T04:27:12.592Z INFO viam-modbus.rdk:component:board/PLCBoard modbus_tcp_board/module.go:145 Reconfiguring Modbus TCP Board Component with &{0x4000543540 [{4 DI_01 input} {5 DI_02 input} {6 DI_03 input} {7 DI_04 input} {0 D0_01 output} {1 D0_02 output} {2 D0_03 output} {3 D0_04 output}] [{0 AI_01 input uint64} {0 A0_01 output uint64}]}