Z-UNO 2 RS-485

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
luhrern
Posts: 20
Joined: 12 Aug 2019 18:01

Z-UNO 2 RS-485

Post by luhrern »

I am trying to makde and install a sketch for a flowmeter that communicate with RS-485.

Are using the new configurator and select like this picture con1.jpg (attached)

I get the SKECTH below.

I am uploading thsi to the Z-UNO 2 in Arduino 1.8.19 version using the 3.0.10 version of the boards manager.

Then I pair the Z-UNO 2 board with my Z-WAY system version v4.0.3

The pairing of the device is successful. But the device show no measurements, see enclosed file device.jpg.



**SKETCH START

/*
* This code was generated using the configurator
* https://z-uno.z-wave.me/configurator/#/ ... l=XKyjz0A7
*/

#include "ZUNO_SHIELD.h" // Shield library





ZUNOShield shield; // Shield object

void setup() {
Serial1.begin(9600);
pinMode(2, OUTPUT);
digitalWrite(2, LOW);
}

void loop() {
// read values



// check rules



// set values and send reports


}


// Functions
char readByteRS485() {
while(Serial1.available() <= 0) delay(1);
return Serial1.read();
}

void writeRS485(char b) {
digitalWrite(2, HIGH);
delay(5);
Serial1.write(b);
delay(5);
digitalWrite(2, LOW);
}
**SKETCH END
Attachments
device.jpg
device.jpg (94.08 KiB) Viewed 8832 times
con1.jpg
con1.jpg (97.45 KiB) Viewed 8832 times
User avatar
PoltoS
Posts: 7649
Joined: 26 Jan 2011 19:36

Re: Z-UNO 2 RS-485

Post by PoltoS »

Hello!

The RS-485 is just a physical layer. You should fill the RS-485 logic using writeRS485 and readRS485 functions and a channel (check the documentation how to add a channel or use the configurator and then decouple it from the pin (remove digitalRead or whatever is added)
Post Reply