1. attn: Kondor Attila serial ports

Kondor, what version of win32lib does your serial port program need?

Kat

new topic     » topic index » view message » categorize

2. Re: attn: Kondor Attila serial ports

Kat  <gertie at visionsix.com> 2005.07.30. 01:51:33 -5h-kor =EDrta:

>
>
> Kondor, what version of win32lib does your serial port program need?
>
> Kat
>

Hello Kat,

Win32Lib v0.60.6

It is recommended the err_msgs carefully to handle.
I use for hw handshake time_out .

-------- A time_out loop number -----------------
--  after open port=20

integer  CNT_msec, CTS_status
sequence line_status=20

function CTS_cnt()
integer cntr, cntr1, cntr2, CNT_ms
atom t, t1

	t=time()
	cntr=0	  cntr1=100000000	cntr2=500000
	while cntr < cntr1 do
		CTS_status=sio_cts_status(port)
		if cntr2=cntr then
			cntr2=cntr
			cntr=cntr1
		end if
			cntr +=1
	end while
	t1=time()
	CNT_ms=floor((cntr2/(t1-t))/1000)

	return CNT_ms
end function
--------------------------------------------------------

------  wait for CTS 0->1 -------- CTS_H_wait=09=09=09=09
--  timeout [ms]
-- return 1 if CTS=1, =0 if it  was timeout

function CTS_H_wait(integer timeout)
integer cnt, cntr, rv

	cnt= CNT_msec * timeout
=09
	cntr=0 rv=0
	while cntr < cnt do
		cntr +=1
		CTS_status=sio_cts_status(port)
		if CTS_status=1 then
			cntr=cnt
			rv=1
		end if
	end while
=09=09
	return rv
end function

------ wait for CTS 1->0 -------- CTS_L_wait=09=09=09=09
--  timeout [ms]
-- return 1 if CTS=1, =0 if it  was timeout

function CTS_L_wait(integer timeout)
integer cnt, cntr, rv

	cnt= CNT_msec * timeout
=09
	cntr=0 rv=0
	while cntr < cnt do
		cntr +=1
		CTS_status=sio_cts_status(port)
		if CTS_status=0 then
			cntr=cnt
			rv=1
		end if
	end while
=09=09
	return rv
end function

----

Attila Kondor
--

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu