[THIN] Re: Read Data from Scale connected to PC via com port
- From: "Sanders, Robert (GE Energy)" <robert.sanders@xxxxxx>
- To: "Velkov Stojanco" <svelkov@xxxxxxxxx>, <thin@xxxxxxxxxxxxx>
- Date: Mon, 16 May 2005 11:07:07 -0400
IN our environment we have installed a port control software that called CommX
from Greenleaf software , http://www.greenleafsoft.com/commx/commxInfo1.asp .
Works real well and easy. Here's a sample of our code:
DEFINE OUTPUT PARAMETER p-weight AS CHAR.
DEF VAR myport AS COM-HANDLE.
DEF VAR my2 AS COM-HANDLE.
DEF VAR retval AS INT.
DEF VAR sendstring AS CHAR.
DEF VAR readstring AS CHAR.
CREATE "portctl.portctl.1" myport.
myport:portnumber = "1".
myport:baudrate() = "9600".
myport:parity() = "2".
myport:databits() = "7".
myport:stopbits() = "0".
myport:xonxoff() = "1".
retval = myport:open.
IF retval < 0 THEN DO:
MESSAGE "Unable to communicate with scale!" VIEW-AS ALERT-BOX TITLE
"Communication Error".
END.
ELSE DO:
myport:writestring("W").
readstring = myport:readstringtimed("6", "2000").
END.
ASSIGN p-weight = SUBSTRING(readstring,2,4).
myport:close.
Hope that helps
-----Original Message-----
From: postmaster@xxxxxxx [mailto:postmaster@xxxxxxx]On Behalf Of Velkov
Stojanco
Sent: Sunday, May 15, 2005 3:38 PM
To: peg@xxxxxxx
Subject: Read Data from Scale connected to PC via com port
Hi peggers,
I need to read data from a scale (this scale is use to measure from 0 to
60000 kg, (this is not so important)). The scale is connected to PC via com
port. I need to read data from the scale and put it into local variable or
in field in table.
Is it possible to do it with command like this:
INPUT STREAM a FROM opsys-device . /*(opsys-device is the name od the scale)
*/
Thanks,
********************************************************
This Weeks Sponsor: ThinPrint GmbH
Now available: The new version .print Engine 6.2 with SSL encryption
and certificate management.
http://www.thinprint.com
**********************************************************
Useful Thin Client Computing Links are available at:
http://thin.net/links.cfm
ThinWiki community - Excellent SBC Search Capabilities!
http://www.thinwiki.com
***********************************************************
For Archives, to Unsubscribe, Subscribe or
set Digest or Vacation mode use the below link:
http://thin.net/citrixlist.cfm
Other related posts:
- » [THIN] Re: Read Data from Scale connected to PC via com port