Sending Modbus Packet Using Nim Sockets

2024-06-28 Thread takekikuchi
I don't have documentation prepared, but the section under "when isMainModule:" in tcp.nim might be helpful. "

Sending Modbus Packet Using Nim Sockets

2024-06-28 Thread jbeuter
I got this to work! Here is the working code to send a basic Modbus on/off packet: var socket: Socket = newSocket() socket.connect(ip, port) #Create packet to write coil #OFF packet var packet: array[12, uint8] = [0x00'u8, 0x00, 0x00, 0x00, 0x00, 0x0

Sending Modbus Packet Using Nim Sockets

2024-06-28 Thread jbeuter
Do you have any documentation for how to implement this/nim resources for how to use this? I am pretty new to nim!

Sending Modbus Packet Using Nim Sockets

2024-06-28 Thread enthus1ast
There's also an overload that accepts a pointer:

Sending Modbus Packet Using Nim Sockets

2024-06-27 Thread jbeuter
The send() for socket accepts a string data type. I cannot get the actual packet to be received as Modbus when converted to a string.

Sending Modbus Packet Using Nim Sockets

2024-06-27 Thread takekikuchi
Hello. I have developed a Modbus client library for use in our company's projects. I prefer working with async, so this library is designed for async usage. I hope you find it helpful.

Sending Modbus Packet Using Nim Sockets

2024-06-27 Thread PMunch
For some more context the argument-less version of `newSocket` defaults to a TCP socket: As an aside though that array looks wrong. You define it to be 12 integers long, aka 12*8 on a 64 bit machine, but you only spec

Sending Modbus Packet Using Nim Sockets

2024-06-27 Thread demotomohiro
According to net module reference: > This function should normally be used with connection-less sockets (UDP > sockets). And your socket is using TCP.

Sending Modbus Packet Using Nim Sockets

2024-06-27 Thread jbeuter
Hello, I am a new nim user (forgive me if this post lacks info). Currently I am trying to create a socket connection and send a custom modbus packet. I am able to do this in C with and build my own packet as a char array and send it. Using the nim documentati