RS232 Wireless help!

For general Flowcode discussion that does not belong in the other sections.
jgu1
Posts: 615
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 507 times
Been thanked: 132 times

Flowcode v10 RS232 Wireless help!

Post by jgu1 »

Hi!

I am starting a project, wireless with the HC12 transceiver for a remotecontrol. I want to transmit (examble) string "help" and when the receiver receive this in the receiver I want to "do something" turn an output on.

I remember have seen somewhere that it is possible to compare a string via rs232, but where? I don´t remember where I have seen this a good examble.

I have seach in WIKI and in forum. Any help, please, I will be happy :D

Thank´s in advance

Jorgen

chipfryer27
Valued Contributor
Posts: 1149
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 412 times

Re: RS232 Wireless help!

Post by chipfryer27 »

Hi Jorgen

Need to check up on HC12, but assuming you have it working you could setup an interrupt (RxINT) to capture the received information and store in a Circular Buffer.

Once in the buffer it's very easy to either search for the required info (parse) or "LookFor / WaitFor" the required info.

I've posted a couple of examples in the past. I'll look them out in the hope it helps.

Regards

chipfryer27
Valued Contributor
Posts: 1149
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 287 times
Been thanked: 412 times

Re: RS232 Wireless help!

Post by chipfryer27 »

Hi

In this post I used BT modules but as they use the UART too, the principals are the same. If the CB receives the required string then a LED toggles.

https://www.matrixtsl.com/mmforums/view ... 17#p107317

Hope this helps.

Regards

jgu1
Posts: 615
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 507 times
Been thanked: 132 times

Re: RS232 Wireless help!

Post by jgu1 »

Thank you Chipfreyer, I will look ;)

jorgen

viktor_au
Posts: 18
Joined: Wed Jul 12, 2023 7:09 am
Has thanked: 2 times
Been thanked: 4 times

Re: RS232 Wireless help!

Post by viktor_au »

Hello Jorgen


Note: it is important to change the settings of the remote transceiver first and then change the settings of the local transceiver to match, as any initial changes to the local transceiver will interrupt communication between the two.
Attachments
HC-12_english_datasheets.pdf
(528.39 KiB) Downloaded 10 times
Last edited by viktor_au on Sun Apr 21, 2024 11:40 pm, edited 1 time in total.

medelec35
Matrix Staff
Posts: 1453
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: RS232 Wireless help!

Post by medelec35 »

jgu1 wrote:
Wed Apr 17, 2024 8:01 pm
Hi!
I remember have seen somewhere that it is possible to compare a string via rs232, but where? I
In Flowcode, if you select Component Libraries > Storage
Then right click on Circular Buffer (8-bit) [2D] &n select help.
It will take you to a wiki page with the examples will help you in two ways.
1. use the circular buffer for reliable communications as already been mentioned.
2. Show you how to compare the incoming data with a sting value and act on it accordingly .

To do all that, I would recommend looking at UART to USB Serial Data Bridge example for using CB for incoming UART data and Keypad Door Entry for comparing the incoming UART data to a string value.

After seeing how both examples work, and creating your own Flowcode project, if you get stuck we can help you further.
Martin

jgu1
Posts: 615
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 507 times
Been thanked: 132 times

Re: RS232 Wireless help!

Post by jgu1 »

Hi all!

Thank´s to all. Now I have lot of example to look at. :lol:

And thank you Victor, I am familiar with the HC12, very good device, I can recommend. ;)

Gratefull!

Jorgen

medelec35
Matrix Staff
Posts: 1453
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 512 times
Been thanked: 472 times

Re: RS232 Wireless help!

Post by medelec35 »

Hi Jorgen.
Just in case you want to compare two string values:
Compare Strings1.png
Compare Strings1.png (22.61 KiB) Viewed 181 times
Which is:

Code: Select all

Compare$("String1","String2",0) = 0
You can either use literal string values within quotes e.g. "1234ABC" or string variables or a combination of both.
See this Wiki page.
Martin

jgu1
Posts: 615
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 507 times
Been thanked: 132 times

Re: RS232 Wireless help!

Post by jgu1 »

Hi Martin

Thank`s

Exactly what I was looking for, and have seen :D

So I can transmit a string and receive this string, then compare the string, if the received string is equal with the string in the compare, Then do something, set an output, I suppose ;)

But please what does String2",0) = 0 mean, the ,0)=0 if correct string? Edit. Just seen it on wiki :lol:


Jorgen

jgu1
Posts: 615
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 507 times
Been thanked: 132 times

Flowcode v10 Re: RS232 Wireless help!

Post by jgu1 »

Hi all again!

I have now made my receiver. Hope any will please check my program and see if this will working, please ;)

Everytime the receiver recieve the string "open" I want to set the B0 on, after 500mS off again.

Any correction is very welcome :)

jorgen
Attachments
RX_Port.fcfx
(11.19 KiB) Downloaded 8 times

Post Reply