RS-232 Send Variables

Forum for problems or queries regarding Flowcode Comms Components. Eg LIN, I2C, SPI, RS232, CAN, IrDA etc

Moderators: Benj, Mods

Post Reply
crafty
Posts: 2
Joined: Mon Sep 15, 2008 10:24 am
Contact:

RS-232 Send Variables

Post by crafty »

Dear all,

I have a question concerning the RS-232 properties/macros in Flowcode:

Is it possible to send more than one byte via RS-232? What I need to do is transfer the values of three integer variables. When captured with a terminal program, it should read like this:

123, 56, 34
124, 51, 30
126, 49, 27
127, 45, 26
....

The values should appear in tab or comma separated format.

How can I achieve this with Flowcode macros/add-ons?

Thanks,

Chris

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: RS-232 Send Variables

Post by Benj »

Hello Chris

Create a macro to output the data you need.

Eg create a macro with 6 send RS232 component macro icons.

the first sends the data from variable 1
the second sends a comma
The third sends the data from variable 2
the fourth sends a comma
...

This way you can simply update the global variable values and call the macro whenever you need to output the values collectivly.

jmccorison
Posts: 26
Joined: Mon Aug 18, 2008 11:47 pm
Location: Orcas Island, WA
Contact:

Re: RS-232 Send Variables

Post by jmccorison »

Chris,

A couple questions about what you asked. First, when you say "integer variable" do you mean a variable declared as integer Vs byte, or just generically integer. Second, when say "When captured with a terminal program," do you mean that the results should be readable by a human, i.e. if the value sent is the integer "123" (regardless of how it is declared) should the program be sending 0x7B (hex for 123, or what wold be stored in the variable) or should it send "123" as three ASCII characters? If you are trying to send integer type variables as an ASCII string I've attached an example.

-Jim
SendToRS232.fcf
Example of sending data stream via RS232
(6 KiB) Downloaded 580 times

crafty
Posts: 2
Joined: Mon Sep 15, 2008 10:24 am
Contact:

Re: RS-232 Send Variables

Post by crafty »

Hello Jim,

thanks for your reply and sorry for the delay in responding.

I do mean "integer" as declared vs. byte. The values sent should be ASCII characters, just as you described it. Unfortunately I couldn't open the attached example (I use Flowcode for AVR, the example was designed for use with PIC microcontrollers). I guess this is exactly what I need 8)

Best regards,

Chris

jmccorison
Posts: 26
Joined: Mon Aug 18, 2008 11:47 pm
Location: Orcas Island, WA
Contact:

Re: RS-232 Send Variables

Post by jmccorison »

Chris,

I've never tried it, but I have read that each version of Flowcode can import code from the other versions. Got to File->Import then under file type choose "Flowcode for PIC files". In theory that should load it into your AVR version of Flowcode.

Cheers,
Jim

Post Reply