Page 1 of 1

RS-232 Send Variables

Posted: Mon Sep 15, 2008 1:03 pm
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

Re: RS-232 Send Variables

Posted: Mon Sep 15, 2008 3:20 pm
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.

Re: RS-232 Send Variables

Posted: Tue Sep 16, 2008 5:18 pm
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 625 times

Re: RS-232 Send Variables

Posted: Tue Sep 23, 2008 6:30 pm
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

Re: RS-232 Send Variables

Posted: Tue Sep 23, 2008 11:27 pm
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