on 07-29-2015 11:17 PM
Are you able to read/write to Com Ports in PB using the standard File functions? I have seen many posts saying you can do the following...
ll_Job = fileopen ("COM1:", StreamMode!, Write!, Shared!)
filewrite (ll_Job, char(27) + char(112) + char(80) + char(25) + char(250))
fileClose(ll_Job)
However, I have tried it and it won't let me open the port. (For "ll_Job" is always set to -1). Is there a best way to communicate with ports in PB? We used to use an ActiveX control, but it doesn't work with 64 bit Windows. Thanks.
I'm using PB 12.5.2 Build 5789 in Windows 7 64 bit.
Hi I use the code you can find attached.
I founded it many years ago into the net, nto tested with 64bit OS
Rename it in n_seriale.sru and then import in your library
Here an example to read:
n_seriale inv_seriale
inv_seriale = create n_seriale
inv_seriale.init( 1 , "9600,N,8,1") // 1 = COMPORT
inv_seriale.read(500,true)
if isvalid(inv_seriale) then
inv_seriale.done()
destroy inv_seriale
end if
Bye
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can use the MSCOMM32.ocx as an OLE object.
You need to register it first (REGSRV)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.