FieldTypeBit represents single bit out 16 bit register. func (c *SerialClient) Do(ctx context.Context, req packet.Request) (packet.Response, error).func NewSerialClient(serialPort io.ReadWriteCloser, opts.func (r RegisterRequest) ExtractFields(response RegistersResponse, continueOnExtractionErrors bool) (FieldValue, error).func (r RegisterRequest) AsRegisters(response RegistersResponse) (*packet.Registers, error).If err := client.Connect(context.Background(), "localhost:5020") err != nil, error) ReadHoldingRegistersTCP() // split added fields into multiple requests with suitable quantity size Higher level API allows you to compose register requests out of arbitrary number of fields and extract thoseįield values from response registers with convenience methods b := modbus.NewRequestBuilder("localhost:5020", 1) Builders to group multiple fields into request batches.Convenience methods to convert register data to/from different data types (with endianess/word order).Client (TCP/RTU) separated from Modbus packets.Packets separate from Client implementation.FC23 - Read / Write Multiple Registers ( req/ resp).FC16 - Write Multiple Registers ( req/ resp). FC15 - Write Multiple Coils ( req/ resp).FC6 - Write Single Register ( req/ resp).FC4 - Read Input Registers ( req/ resp).FC3 - Read Holding Registers ( req/ resp).FC2 - Read Discrete Inputs ( req/ resp).Modbus TCP/IP and RTU simpler description: įor questions use Github Discussions Installation go get /aldas/go-modbus-client.Modbus client (TCP/RTU) over TCP/Serial for Golang. (r) ExtractFields(response, continueOnExtractionErrors)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |