Skip to Content
0
Jul 29, 2015 at 10:17 PM

Reading/Writing to Com Ports

404 Views

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.