ADC value to PC

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

armagon29
Posts: 56
Joined: Thu May 07, 2009 4:40 pm
Been thanked: 2 times
Contact:

ADC value to PC

Postby armagon29 » Wed Jun 02, 2010 3:36 am

Dear All:

I have a problem, may you can help me, I need to send a ADC value to PC Terminal trough RS232 (E-block15), but when pic send ADC value (Byte) to PC, the value is show as a character (Single letter or number) not a Byte value, why?, see the file attached

Thanks

Armagon
Attachments
ADC to PC.fcf
FC v3 File
(7 KiB) Downloaded 208 times

User avatar
DavidA
Matrix Staff
Posts: 1060
Joined: Fri Apr 23, 2010 2:18 pm
Location: Matrix Multimedia Ltd
Has thanked: 58 times
Been thanked: 275 times
Contact:

Re: ADC value to PC

Postby DavidA » Wed Jun 02, 2010 8:31 am

Hi,

The RS232 sends these single ASCII characters as they represent a byte, you can use any lookup table to tell what bytes these characters represent.

Eg: http://www.asciitable.com/ External link not supported by Matrix Multimedia

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

Re: ADC value to PC

Postby Benj » Wed Jun 02, 2010 8:47 am

If you convert the byte value to a string using a toString string manipulation function then you can send the string down the RS232 a character at a time.

armagon29
Posts: 56
Joined: Thu May 07, 2009 4:40 pm
Been thanked: 2 times
Contact:

Re: ADC value to PC

Postby armagon29 » Thu Jun 03, 2010 12:32 am

Dear Sir:

I already dome modification using a string function, but now the question is how to send a string trough RS232 macro, it does not have a sent string option?

Thanks

Armagon

See attachment
Attachments
ADC to PC.fcf
(7 KiB) Downloaded 178 times

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

Re: ADC value to PC

Postby Benj » Thu Jun 03, 2010 9:18 am

Hello,

Sorry its v4 that has the RS232 string send functionality.

You can instead create a simple loop to step through the string until you reach the end or a null character. See the attached example.
Attachments
Flowcode1.fcf
(5.5 KiB) Downloaded 215 times