03-30-2011 04:09 AM - edited 03-30-2011 04:17 AM
Hi ,
I have a problem with a Simple RS232 Port...
Is there a function that writing CR termination to a serial port ?
I know i can simply write 13 DEC to the port just wondering if theres any thing build in for the cvi....
03-30-2011 04:33 AM
Hi,
if you happen to use VISA you could use viSetAttribute ( session_handle, VI_ATTR_SEND_END_EN, ) and define VI_ASRL_END_TERMCHAR; this way the terminating character is automatically appended
04-05-2011 02:18 AM
Hi,
This does a string with CR at the end pretty well in an old version of labwindows:
Fmt(send_cmd,"%s<%c%i%s\r", SENDESC, i + 1, LIMITCOM); //this adds 1 to i so send_cmd starts at 1L - Type of slot request
and then:
stringsize = StringLength (send_cmd);
bytes_sent = ComWrt (COMPORT, send_cmd, stringsize)
Of course this is a char string: <ESC>1L<CR>. Have a look at the serial.prj example for single bytes. - NB both SENDESC and LIMITCOM are #defines with SENDESC 27 and LIMITCOM "L"
Steve