Seite 1 von 1

I need HELP send & receive via RS232

Verfasst: Freitag 16. Juli 2010, 14:15
von KMtronic
Hello, I'm beginner and I want to build some project on ProfiLab.

First step : Reading digital inputs from microcontroller connected to PC via RS232 port 9600/8/N/1.
Protocol:
ProfiLab need to send request to microcontroler "255 128 0" in decimal (HEX "FF 80 00")
Microcontroller reply to request "255 128 0" or "255 128 1" where last byte is status digital input.

Project must read 8 digital inputs and show statuses with 8 LED's.
Commands are from "255 128 00" to "255 135 00".

I test several ways but until now I don't have any success.

We will be very grateful for some help.

Best regards

Re: I need HELP send & receive via RS232

Verfasst: Samstag 17. Juli 2010, 00:15
von KAKTUS
Hi KMtronic,

please test it, and setup the com ports first. The receive part works at my pc.

Re: I need HELP send & receive via RS232

Verfasst: Sonntag 18. Juli 2010, 09:56
von KMtronic
Hi KAKTUS,

Great job!!! Thank you very much!

Your project help my to understand how all must work.
And using it I just have working 'Inputs' part of my experiment project.

To make simple I change little protocol and add 8 more inputs.
So in a moment Read inputs command is '255 128 00' ("FF 80 00") and microcontroller send back '255 128 xx xx' where 'xx xx' are status all 16 inputs in BIN format. '255' ('FF) - all inputs are 5V, 0 inputs are 0V.

I attach project in working state. Also screenshots Front panel and log serial communication.

Next part (Digital Outputs) will start short as possible...
Any ideas welcome.
I think to use Read inputs command for Outputs. Some like '255 128 oo oo' where 'oo oo' will be for control 16 Outputs.

MfG ;)