1. Clever Naranjo
  2. PowerBuilder
  3. Thursday, 30 November 2017 18:57 PM UTC

regards
I have a machine that measures, after measuring sends an impression with some readings to a printer connected directly to this machine, I need to read this data instead of the printer

thanks for your support

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 30 November 2017 20:44 PM UTC
  2. PowerBuilder
  3. # 1

Hi Cleaver;

  A serial port or USB  device can be read or written to using the FileOpen ( ) method. For example ...

integer li_FileNum

li_FileNum = FileOpen ( "COM1:", LineMode!, Write!, LockWrite!, Replace!)

FileRead / FileWrite ...

Just replace COM1: with the device name / port you need to access

HTH

Regards ... Chris

Comment
  1. José Gasparini
  2. Friday, 20 September 2024 20:19 PM UTC
Hi Chris,



Do you have some example FileRead to share ?



I tried to use FileOpen to read a USB port (windows redirects to COM5 port) like the example you shared, but FileOpen return -1, if use FileOpen as Write work, but doesn't to Read.



Regards José
  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 20 September 2024 21:36 PM UTC
HI José

Not offhand but I will look through my extensive examples to see.

Regards .. Chris
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Thursday, 30 November 2017 20:13 PM UTC
  2. PowerBuilder
  3. # 2

It would be helpful if you told us the name/model of device (and a link to the device manufacturers website) and how it connects to the pc (USB, Serial Port).

 

Comment
  1. José Gasparini
  2. Sunday, 13 October 2024 13:32 PM UTC
Thanks Chris / Roland for your answer, in order that I can't resolve through FilieOpen, I looking for other option and I found a non visual object that can read the port using windows dll kernel32.dll, with this option I could read the data.



Regards, José
  1. Helpful 1
  1. John Fauss
  2. Sunday, 13 October 2024 23:21 PM UTC
Glad to hear you found a solution, José! Would you please tell us about the NVO you are using (name, URL, etc.) so that others that may need this functionality can try it? Many thanks!
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.