Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

23x: Send CR/LF to serial output


AndrewElford Dec 19, 2016 02:55 PM

Using p96 (52) to stream data out via rs232 on 23x.  the built in newlines do not output immediately, making the data one point behind - how can I send a new line charactor out via serial?   tried added P98 & P63 but those ascii charactors don't seem to go anywhere

12:  Do (P86)
 1: 10       Set Output Flag High (Flag 0)

13:  Set Active Storage Area (P80)^16734
 1: 2        Final Storage Area 2
 2: 111      Array ID

14:  Real Time (P77)^11051
 1: 1111     Year,Day,Hour/Minute,Seconds (midnight = 0000)

15:  Sample (P70)^30137
 1: 26       Reps
 2: 5        Loc [ minutes   ]


16:  Send Printer Character (P98)
 1: 42       Printer/9600 Baud

17:  Extended Parameters (P63)
 1: 13       Option
 2: 10       Option
 3: 00       Option
 4: 00       Option
 5: 00       Option
 6: 00       Option
 7: 00       Option
 8: 00       Option

18:  Serial Out (P96)
 1: 52    -- Destination Output


JDavis Dec 20, 2016 05:39 PM

I loaded the code onto a CR23X and am watching the output in a terminal. The carriage return and line feed output at the beginning of the data. If I have time, I'll try modifying code to output characters at the end.


AndrewElford Dec 20, 2016 05:44 PM

That would be great!  Anything I can do on my end to help?


JDavis Dec 22, 2016 11:43 PM

The P98 instruction outputs at the very end of the scan, even if other instructions are after it.

P15 instructions placed after the P98 instruction will output before the P98 instruction.

The format 52-- in P98 outputs a carriage return and line feed before the data.

The format 42-- will output the carriage return and line feed after the data.

I hope that clears things up.


AndrewElford Dec 23, 2016 03:52 PM

Thank you.  This helps but I still need to force a new line programmatically using serial out format 52. (format 42 will not work for us as it chops up the data into multiple lines)  

I have tried P15 but I'm still not able to send new lines out via serial port programmatically.  Exactly how can I send <CR><LF> or just <LF> out via a specified serial port after the data is sent? Ascii 13 & 10 ?


JDavis Dec 23, 2016 03:56 PM

The P98 instruction will always output last.

To output a carriage return and line feed, you would have to make a P15 instruction execute on a following scan.

Honestly, it would probably be easier to change your data processing software.

Log in or register to post/reply in the forum.