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
RS-232 Send Variables
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 26
- Joined: Mon Aug 18, 2008 11:47 pm
- Location: Orcas Island, WA
- Contact:
Re: RS-232 Send Variables
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
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
Re: RS-232 Send Variables
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
Best regards,
Chris
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
![Cool 8)](./images/smilies/icon_cool.gif)
Best regards,
Chris
-
- Posts: 26
- Joined: Mon Aug 18, 2008 11:47 pm
- Location: Orcas Island, WA
- Contact:
Re: RS-232 Send Variables
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
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