Anybody played around with System.IO.Ports?
I know that a specfic thing is connected to an unspecified port. But it don't know how to check for it.
I've gotten this far:
USING System.IO.Ports.*.
DEFINE VARIABLE c AS CHARACTER EXTENT.
DEFINE VARIABLE p AS CLASS System.IO.Ports.SerialPort.
c = SerialPort:GetPortNames().
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DO i = 1 TO EXTENT(c):
DISP i ":" c[i].
p = NEW SerialPort(c[i]).
/*p:WhatToDo(?). */
DELETE OBJECT p.
PAUSE.
END.
Ideas?
Jens,
Serial.IO sends events (receiving data) in another thread.
OpenEdge can't handle this.
Perhaps it's only wasting time trying to use this with OpenEdge.
Stefan
I have an external API for handling the actual communication. The problem is that connecting to the device is only supported on a per port basis (COM4, COM5 etc) and not via an device string.
In this case I really only need to check what's connected to my ports. (I can see it in the Device manager as attached).
Jens@airtours.se schrieb:
In this case I really only need to check what's connected to my ports. (I can see it in the Device manager as attached).
Then this is the wrong class if you need more than detecting DTR.
Which USB Device created the virtual COM Port isn't visible in this class, for this i use the Registry class.
You don't happen to have an example?
Thanks
Because i use the ports in C# it's in this language where i search virtual com ports for Honeywell scanners:
RegistryKey reg = Registry.LocalMachine;
RegistryKey reg1 = reg.OpenSubKey("HARDWARE\\DEVICEMAP\\SERIALCOMM");
foreach (String valuename in reg1.GetValueNames())
{
if (valuename.Contains("\\Device\\honeywell_cdc_AcmSerial"))
iScannerRegistry++;
}
You need to convert this to ABL.NET
Has someone convert this in ABL?
@Peter: that shouldn't be too hard to do on your own? You could equally use GET-KEY-VALUE() to read from the registry in the old fashioned way...