RS232 Help Please

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

RS232 Help Please

Post by acestu »

Hi,

I am trying to get the 4D display working with a pic and I need to send the info from the display to the controller via serial, I am enclosing a pic of the commands that a simple switch sends via serial when it is switched off or switched on, could somebody please tell me if it is possible to do this, I suppose it would be a chart that listens out for the serial data and simply changes the state of a pin accordingly..
New-Rocker.png
(20.22 KiB) Downloaded 2318 times
Thanks In Advance
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: RS232 Help Please

Post by Benj »

Hi Stu,

How about this? I used a finite state machine approach to wait for the detection of the bytes 1,2. Once these are are detected we wait until byte 5 and then check the value to determine if we are switching the LED on or off. Byte 4 also has information but I am currently throwing this away. You could add another branch to the switch statement to collect byte 4 if it is useful.
Attachments
Decoder.fcf
(12.44 KiB) Downloaded 229 times

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: RS232 Help Please

Post by acestu »

Hi Benj,

To be honest I am not sure what is going on with the info that the display sends, is the information that is sent, the green digits in brackets, and if so why are their 12 numbers ?.

So am I right in thinking that all of that info is needed and detected, the first line is when the switch is switched off, and the second lot of info is when the switch is switched off, do you think it would be an idea to build a little circuit on a breadboard that shows what the display sends on an LCD ?

Thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: RS232 Help Please

Post by Benj »

Hi Stu,

I'm assuming that the actual data being sent and received is the bit in the square brackets in hex format so 00 to FF to represent the values 0 to 255.

I'm currently looking into a full featured visi interface for Flowcode v6 so will know more once I have got a bit further with this. The prog I send should work with the values you posted but other values may differ.
do you think it would be an idea to build a little circuit on a breadboard that shows what the display sends on an LCD ?
If you could do this then it may prove very useful. I have a new 4D systems display in a box somewhere so I will have a dig.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: RS232 Help Please

Post by acestu »

Hi Benj,

Yes I will have a go at the LCD circuit then, and the Visi module for FC6 would be brilliant as they are a brilliant piece of kit, I have just taken delivery of a 4d Beaglebone Black touchscreen cape and it is amazing because the video driver and screen resolutions on the Beaglebone Black are not as good as the Raspberry Pi...

cheers
Acestu
Last edited by acestu on Wed Aug 21, 2013 9:09 am, edited 1 time in total.
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times

Re: RS232 Help Please

Post by acestu »

P.S.

There is a new version of 4D Workshop available to download now FREE:

http://www.4dsystems.com.au/product/10/ ... hop_4_IDE/

cheers
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: RS232 Help Please

Post by Benj »

Aha,

The bytes in green are being transmitted to the 4D screen, the bytes in Red are being sent by the screen. Makes a lot more sense now :)

v6 interface coming along nicely.

the 4th byte 00 and 01 are off and on commands, the last byte 03 and 02 is a check sum byte.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: RS232 Help Please

Post by Benj »

Hello,

The Flowcode v6 Visi Interface for the EB076 component has now been done and is available from here.
http://www.matrixmultimedia.com/mmforum ... 793#p50793

Post Reply