# ADAM 4017 Ascii commands through raspberry pi

**URL:** <https://discourse.nodered.org/t/adam-4017-ascii-commands-through-raspberry-pi/71428>\
**Category:** Industrial\
**Created:** [29 November 2022 10:19 UTC](https://discourse.nodered.org/t/adam-4017-ascii-commands-through-raspberry-pi/71428 "2022-11-29T10:19:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pubudu](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@pubudu](https://discourse.nodered.org/u/pubudu)\
**Post date:** [29 November 2022 10:19 UTC](https://discourse.nodered.org/t/adam-4017-ascii-commands-through-raspberry-pi/71428/1 "2022-11-29T10:19:20Z")

</div>

Hi,  
I'm trying to connect ADAM 4017 (data acquisition module) to raspberry pi / node red program through RS485 USB converter and display some readings. The adam 4017 only supports ascii commands.  
The command format works like this 0B is the address, #0B delivers the readings of all the channels. If i want special channel reading, for example 1th channel its #0B1  
On node red, i injected a buffer [35,48,66,49] to serial request node to read the 1st channel reading but no output received.  
Please consider my knowledge on node red is very low and my english is not much good.  
If some one can explain the mistake that i've done, it's a great help  
Thank you.

 ![Adam 4017 ascii](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/0/e0161dda9cb1e5f48fc1527822a53be394270270.jpeg)  
 ![node red ascii 2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/5/f5a88bd5e90fc58122a0097cf327c32bd34e514b.jpeg)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [29 November 2022 10:43 UTC](https://discourse.nodered.org/t/adam-4017-ascii-commands-through-raspberry-pi/71428/2 "2022-11-29T10:43:27Z")

</div>

do you need to add another character for the [enter] key ? maybe "\r" or "\n"  
(just guessing)  
Also usually only one device can talk to the serial port at a time so make sure your other software isn't running.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [29 November 2022 10:49 UTC](https://discourse.nodered.org/t/adam-4017-ascii-commands-through-raspberry-pi/71428/3 "2022-11-29T10:49:00Z")

</div>

> [@pubudu](#):
>
> ADAM 4017

The Adam 4017 supports Modbus/RTU as well as ASCII commands

That means instead of trying to build the ASCII communication protocol, you can simply install and use ModBus nodes (set to ModBus/RTU mode)

> **[node-red-contrib-modbus](https://flows.nodered.org/node/node-red-contrib-modbus)**
>
> The all in one Modbus TCP and Serial contribution package for Node-RED.

---

<div class="post-metadata">

**Author:** ![pubudu](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@pubudu](https://discourse.nodered.org/u/pubudu)\
**Post date:** [29 November 2022 12:31 UTC](https://discourse.nodered.org/t/adam-4017-ascii-commands-through-raspberry-pi/71428/4 "2022-11-29T12:31:52Z")

</div>

Thanks for the reply sir..  
I tried adding characters and test, but no any luck. Yes, only one device for the serial communication.

---

<div class="post-metadata">

**Author:** ![pubudu](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@pubudu](https://discourse.nodered.org/u/pubudu)\
**Post date:** [29 November 2022 12:34 UTC](https://discourse.nodered.org/t/adam-4017-ascii-commands-through-raspberry-pi/71428/5 "2022-11-29T12:34:27Z")

</div>

Thanks for the reply sir.. Adam 4017+ supports Modbus RTU, not 4017.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [29 November 2022 14:08 UTC](https://discourse.nodered.org/t/adam-4017-ascii-commands-through-raspberry-pi/71428/6 "2022-11-29T14:08:41Z")

</div>

Ah yes, i missed that all importnant `+` character!

ok, then I can see from your screenshot you are sending `#0B1`

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/5/35e9b2f0c72ee57831ecbbf620e984df57fcc404.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/5/455ff73e4e26a4e206a903d617f1288b70051fdf.png)

Issues...

- I see you are not sending a `CR` (AKA `0xD`, AKA `13` AKA `'\r'`)
- I also see on your 1st screenshot it sends `#0B` not `#0B1`
- how did you setup the inject node? Is that set to send JSON or BUFFER?

* * *

Things to try...

- try removing the `1` from the INJECT node...
- try adding `13` to the data in the INEJCT node...
- use a function (inbetween INJECT and COM)

```auto
msg.payload = "#0B\r"
return msg

```

---

<div class="post-metadata">

**Author:** ![pubudu](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@pubudu](https://discourse.nodered.org/u/pubudu)\
**Post date:** [30 November 2022 04:01 UTC](https://discourse.nodered.org/t/adam-4017-ascii-commands-through-raspberry-pi/71428/7 "2022-11-30T04:01:32Z")

</div>

Oh my god..! Your are my savior..!  
Just adding 13 worked..!

(I was injecting a buffer and tried 1st channel input. that's why #0B1)  
Many thanks again..!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 December 2022 04:02 UTC](https://discourse.nodered.org/t/adam-4017-ascii-commands-through-raspberry-pi/71428/8 "2022-12-14T04:02:20Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
