How do i send data as a string to the com port. The string would be something like "1,0,1,13,10" equating to
sw1 =1
sw2 = 0
sw3 = 1
cr
lf
I need to send the string as seen (including the inverted commas). The program I am using needs to take this as a string and it is then decoded
Sending strings
- goldwingers
- Posts: 118
- Joined: Wed Sep 06, 2006 1:22 pm
- Location: London
- Been thanked: 1 time
- Contact:
- Steve
- Matrix Staff
- Posts: 3433
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
Here's one way...
Code: Select all
//decision
if (sw1 = 1)
//Component Macro
SendRS232Char("1")
//else
//Component Macro
SendRS232Char("0")
//end if
//Component Macro
SendRS232Char(",")
...etc...
- goldwingers
- Posts: 118
- Joined: Wed Sep 06, 2006 1:22 pm
- Location: London
- Been thanked: 1 time
- Contact:
- goldwingers
- Posts: 118
- Joined: Wed Sep 06, 2006 1:22 pm
- Location: London
- Been thanked: 1 time
- Contact:
Errrr
Hi Steve
I have tried to insert "SendRS232Char("1") " into a send box but it does not accept ("1") or do i need to type in char("1")?
cheers
Ian
I have tried to insert "SendRS232Char("1") " into a send box but it does not accept ("1") or do i need to type in char("1")?
cheers
Ian
- 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:
Hello Ian
Try using '1' instead of "1"
Try using '1' instead of "1"
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
- goldwingers
- Posts: 118
- Joined: Wed Sep 06, 2006 1:22 pm
- Location: London
- Been thanked: 1 time
- Contact:
Hi Beng,
The program for my Gui needs the data to be in inverted commas ie
data sent = "1" This is a down fall of the gui program not flowcode.
I have assumed that char (20) is the number for the " so I have tried sending as follows
send rs232 - char20
send rs232 = 43
send rs232 - char20
send rs232 - char 13
send rs232 - char 10
this should give me a string of "43,13,10" but the program im using dont see the inv commas
The program for my Gui needs the data to be in inverted commas ie
data sent = "1" This is a down fall of the gui program not flowcode.
I have assumed that char (20) is the number for the " so I have tried sending as follows
send rs232 - char20
send rs232 = 43
send rs232 - char20
send rs232 - char 13
send rs232 - char 10
this should give me a string of "43,13,10" but the program im using dont see the inv commas