A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Hot answers tagged

5

Serial is a general communications scheme, where information (in this case binary data) is transmitted in pieces sequentially. There are a number of compatible and incompatible computer buses and protocols that use a serial communications. In the context of your question, serial is used as both a communication scheme and a description of the physical bus. ...


5

Some rules for RS485: First, the network needs to be one single string of nodes - NO branches and short stubs. The allowable length of stubs is related to your data-rate, but to be safe, you should strive to eliminate them. Second, now that your link is one long interconnect, you need a termination resistor at each end. The value of the resistor must match ...


4

It sounds like you have a block of registers that must be read or written atomically (i.e. either read/write all of them, or read/write none of them). Traditionally how you deal with this is to have a set of shadow registers; the ISR fills or uses one table, and the UART subroutines use another. The routines which update the data structures lock the working ...


4

If you can rely on the three phase voltages being 120 degrees apart then you can vectorially add two phase voltages to yield a line voltage: - The above shows three phase voltages VR, VB and VY. these vectorially add to produce the line voltages shown. Clearly, if the phase angles are not exactly 120 degrees apart then there is some error in this technique....


4

It is redundant and if you look at the MODBUS Application Protocol Specification figure 22 on page 31, it specifies to check for:(0x0001 ≤ Quantity of Registers ≤ 0x007B) AND (Byte Count == Quantity of Registers x 2), if not true then return ExceptionCode 03 (ILLEGAL DATA VALUE). I would guess that they were trying to follow a consistent format which in ...


4

Address 0 is reserved as a "broadcast" address where the master can write to the slaves, however the slaves are not supposed to respond to broadcast requests. Technically the Modbus Spec only allows slave addresses 1 to 247 (246 total slaves). The address field of a message frame contains two characters (ASCII) or eight bits (RTU). Valid slave device ...


3

Consumer device, so component costs matter and an off the shelf product won't work. When doesn't it matter in industry ;) The more devices I can connect the better. (My understanding is Modbus can do 250 devices by default, but I can do a double register(16bit) to get 65k tho bandwidth will probably cut that in at least half which is fine) ...


3

I think you have an issue with you line driving RE and DE because you set the D3 line high to transmit, then you issue a modbus function 3 (read holding registers). After this you check if the request was a success and after this you set the D3 line low and you read the response from the library buffer from the node. The issues stands that a modbus ...


3

If your computer doesn't support RS485 protocol, and if we're talking about regular PC's it most probably doesn't, then you cannot directly connect A and B to serial port. I would suggest using an USB-RS485 converter.


3

Those look like they are designed to join two cables together, not in a box or anything, just cable to cable. Look for a bulkhead or panel mount connector or feedthrough. You might also be able to buy a panel-mount connector and short serial cable in one piece, sometimes called a panel-mount serial extension or similar. You might have difficulty finding ...


3

Have you checked your termination and grounding? Theoretically at 9600 baud it should not matter. If you use putty you probably type letter-by-letter. If there is no termination there will be ringing at the receiver. It may be just that one character/second gets received correctly, but a longer Modbus frame does not because it "collides with its reflection". ...


3

RS485 is a multidrop bus, which means that a number of nodes are connected to the same bus and, in this case, they all have the potential to "talk" at the same time. For a device to take control of the bus and be able to talk, the RS485 transceiver (in your case the MAX3160) has to have its transmit enable pin be enabled. All the other devices on the bus ...


3

I realize this question already has an accepted answer but I wanted to offer one of my own as well to clarify. The shield of the RS-485 cable should be connected to a low-impedance return path. Generally the ground (negative side of the battery) is used to connect to the shield. However, it is important that only one side of the shield is connected to ...


3

You might consider a 20 mA current loop, used back in the day. I believe mark was 20 mA and space was 0 mA. Not affected by line loss and twisted pair not required since it's operating in current rather voltage mode.


3

You (or whoever made this dubious module) have erroneously wired the transmit enable pin with a pullup resistor. Without code configuring a corresponding MCU pin as an output and driving it low, that RS485 transceiver will jam the bus. You should correct your schematic symbol to show the logical sense of the enables - DE is active high and /RE is active ...


3

The header should include also size of data packet and everything should end with CRC or some checksum. You say that you have been inspired by Modbus, so why you didn't copy the whole protocol, which runs perfectly over decades in industry? If you include checksum at end, there is no way the telegram can be wrongly interpreted


2

A modbus holding register is just a 16 bit value. You can just allocate an array of uint16_t to store them. There are open source MODBUS libraries available.


2

Those functions are not called by you... they're provided by you. You implement those functions in your application to handle a MODBUS master's request for data from your slave. Look at examples provided online (search for those function names... what Tut provided) You'll need to call the MODBUS library's port setup functions and periodic polling functions ...


2

The WDM303FDWA1 uses RS485 as the line interface connection and this means you need to interface the Atmega to an RS485 chip such as a MAX485. Here is a link to Maxim's offerings on that device and here's the chip: - RO is received data out from the 485 and connects to your Atmega RE (bar) is read enable driven from your Atmega - it defines data direction ...


2

Likewise, L-Com (http://www.l-com.com) makes a DB9 Y splitter, available on the web.


2

Yes, obviously you need an UART. Your driver looks also okay. One UART is enough. Do not attempt to build your project when you are not familiar with terms like: Bus system, RS485, Physical Layer, UART, RS232, half duplex, Master-Slave topology, bus-arbitration. With that you will understand what a bus system is and how multiple devices on a single line work....


2

Skip the MAX485 chip and communicate directly between two arduinos - this proves you can communicate TX to RX and vice versa - you can still use the same code libraries and I would suggest that what you might find is that you need both libraries installed at both ends but, you can prove this later - just try sending data from one arduino to another and let ...


2

I don't have great knowledge about the Arduino platform, but I have worked with Modbus over 485 lines. All processors I used, requires pull-up resistors on the Tx-Rx lines to the MAX485. Maybe Arduino board implements internal pull-up resistors, can you verify this? I have much doubt about the manufacturer's specification on the "start byte" and "end byte", ...


2

Modbus is a serial communications protocol, a link layer standard. In your situation, it is being transported over RS-485, a physical layer standard. So, you might say that you have "Modbus over RS-485". Ethernet/RS-485 converters take "Ethernet over copper", and turn it into "Ethernet over RS-485". RS-485 is the physical layer standard, Ethernet is the ...


2

There is no need to compare to someone else's data capture. The Modbus spec is pretty clear about what makes a valid Modbus packet. Actually there are two specs that apply in your case. The first is the Modbus application protocol spec. That tells you what needs to be in a Modbus packet as seen by the applications on the master and the slave. They refer ...


2

There are a number of questions you need to answer before connecting to a Modbus interface: 1) What is the physical layer? Modbus can be transported over a RS-232, RS-485, or Ethernet. Based on your question I'm going to assume you've already determined that it is RS-232. 2) What are the parameters of the RS-232 connection? You will need to know baud ...


2

If the device you want to talk to presents its data via Modbus over RS-485, then on your end you have to implement RS-485 in hardware, and a Modbus master in firmware. You will need a RS-485 transceiver chip between the UART signals of your micro and the RS-485 bus. The tricky part is knowing when to set the bus transceiver to transmit mode instead of ...


2

"C" is usually ground in RS485 configurations that need ground: - And, given that MODBUS uses (or can use) RS485: - I suspect "C" means ground for MODBUS too. I don't think the "C" designator is used in MODBUS TCP.


2

Is it possible to send/recieve on RS485 without flow control. Yes, since there is no flow control in RS-485. RS-485 is a single signal, implemented as a differential pair. That gives it good noise immunity and common mode rejection, but it is still a single signal. There is no provision for flow control. Like everything beyond just sending a single ...


2

Modbus/TCP can be handled by a simple unmanaged Ethernet switch. I have used this numerous times, although I reserve the "cheap" switch for bench testing and use an industrial quality switch (temperature rating, redundant power, status output) in the final product. It's difficult to quantify risk as you have asked, since I have no knowledge of your ...


Only top voted, non community-wiki answers of a minimum length are eligible