Powerbuilder Serial Interface

 

How can I get or wait for the result code of an AT Command without using the Sleep() function in PowerBuilder? I am using the MSComm OLE Control for PowerBuilder. Could I do a While Loop unti the MSCOmm.Input property returns the proper buffer?(e.g, OK) However, I tried this but the Input returns an empty string.

  1. Federal Signal Serial Interface Module
  2. Powerbuilder Serial Port
  3. Asynchronous Serial Interface
Powerbuilder Serial Interface

I am working on a project right now which requires me to read from a serial port and write to a file however I dont believe that the PowerBuilder API has any functions for this type of communication I just wanted to know if anyone has any suggestions or exprience using powerbuilder with serial port communication.

Here is my PB Code:

Serial
  1. Sep 18, 2014. I have powerbuilder 10 installed. I want to read data from USB port in power builder. I already registered MSCOMM control in poweruilder. If the same control. The USB can be read like any other serial port device using the FileOpen ( ). Integer li_FileNum. Li_FileNum = FileOpen ( 'COM1:'.
  2. PowerBuilder 12.6 includes all the features announced for PB15: OData Support, 64-Bit Support, Dockable Windows and more.
Serial

And here is the port settings:

Any suggestions? Or am I doing something wrong?

DacDac

Federal Signal Serial Interface Module

1 Answer

Indeed instead of waiting for an amount of time, you could read some returned data from the Input property. The ATxx command set to communicate with modems is a far memory to me, but in most cases the modem returns an OK if the command succeded. Maybe that you have to tweak the input parameters

Powerbuilder Serial Port

After some data was sent, wait until OK is returned to the serial line (idea adapted from the official MSComm example, untested):

You would also need to adapt that code in cases where the AT command fails, I dunno how the error is returned to the serial line.

Asynchronous Serial Interface

Edit: used the Right() func as suggested by OP in case where the commands are echoed in the modem answers

SekiSeki

Not the answer you're looking for? Browse other questions tagged powerbuilderat-commandmscomm32 or ask your own question.