This post crossed the email ...
I will test it this evening since I have no Arduino hooked on here. The code like it is now is not giving a compiling error or so, that is prommissing !
I'll be back : allways wanted to say this )))))
Ayuda URGENTE- con puerto serial virtual USB
- Marc Venken
- Posts: 1481
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
Re: Ayuda URGENTE- con puerto serial virtual USB
Marc Venken
Using: FWH 23.08 with Harbour
Using: FWH 23.08 with Harbour
- Antonio Linares
- Site Admin
- Posts: 42259
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Ayuda URGENTE- con puerto serial virtual USB
good I posted it here
- Marc Venken
- Posts: 1481
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
Re: Ayuda URGENTE- con puerto serial virtual USB
I tested it, but I see no interaction or message that it is actualy reading/writing.
I also went in communication with ChatGPT and tested some proposals, but that didn't work at all )))
I have no skills to dig deeper into this kind of code. Maybe there is a interest from other members.
At this moment I have a working solution with a 3 party Virtual Com reader to connect to Arduino and FW
I also went in communication with ChatGPT and tested some proposals, but that didn't work at all )))
I have no skills to dig deeper into this kind of code. Maybe there is a interest from other members.
At this moment I have a working solution with a 3 party Virtual Com reader to connect to Arduino and FW
Marc Venken
Using: FWH 23.08 with Harbour
Using: FWH 23.08 with Harbour
-
- Posts: 116
- Joined: Wed Mar 11, 2009 7:32 pm
- Location: Obregon, Sonora, Mexico
Re: Ayuda URGENTE- con puerto serial virtual USB
En el administrador de dispositivos, cuando se instala un puerto virtual usb virtual, le puedes cambiar a que puerto lo quieres, en este caso sería cambiarlo al puerto com1
aquí en la empresa con las basculas de la empresa, así lo hacemos, ya que manejamos puertos virtuales
saludos
aquí en la empresa con las basculas de la empresa, así lo hacemos, ya que manejamos puertos virtuales
saludos
Benjamin Casarrubias Moreno
Cd. Obregon, Sonora, Mexico
chino72vale@hotmail.com
Fivewin 16.05, Harbour 3.2, xharbour 1.2.1, Fivelinux, visual estudio 2013
Cd. Obregon, Sonora, Mexico
chino72vale@hotmail.com
Fivewin 16.05, Harbour 3.2, xharbour 1.2.1, Fivelinux, visual estudio 2013
-
- Posts: 26
- Joined: Tue Mar 20, 2012 11:06 pm
Re: Ayuda URGENTE- con puerto serial virtual USB
hace casi 14 años use esto para conectar un lector en un puerto virtual en windows xpcarito wrote:Hola a todos,
Necesito una ayuda u orientacion urgente:
Tengo que leer el peso de una bascula (PESA) , que se conecta al pc mediante un cable adaptador SERIAL a puerto USB.
El drive de instalacion de la pesa me crea un puerto virtual COM4 por conexion USB. ( este puerto no existe fisicamente en el PC)
Mi problema es que no logro reconocer con las funciones de Harbour 3.2 ese puerto virtual, estoy medio angustiado, pues no
conozco otra forma. Si alguien sabe como configurar o reconocer esos puertos, se lo agradeceria mucho.
Se que la rutina funciona, pues si le doy un puerto serial COM1 verdadero ( no virtual ), es capaz de abrir y conectarse.
Mi rutina es la siguiente:
FUNCTION Balanza1( cPortName )
Local nComPort := 4 //COM3
Local nTimeOut := 100 //ms
Local lIsOpened := FALSE
Local lIsInit := FALSE
Local nBytesSended := 0
Local nBytesReceived := 0
Local cReceiveBuffer := SPACE(512)
Local cStringToSend := "W<CR>" // este comando le indica a la balzan que devuelva el peso detectado
//To receive
Local cReceivedString := ""
//to COM open
lIsOpened := HB_comOpen( nComPort )
//to Com Initialize
lIsInit := HB_ComInit( nComPort, 9600 , "N", 8, 1 )
//To send
nBytesSended := HB_ComSend( nComPort, cStringToSend , , nTimeOut )
//To receive
nBytesReceived := HB_ComRecv( nComPort, @cReceiveBuffer, , nTimeOut )
cReceivedString := Left( cReceiveBuffer, nBytesReceived )
? cReceivedString
return nil
Quedo a al espera y gracias,
Carito
lo hice en Harbour / HMG
Code: Select all | Expand
#include "hbcom.ch"
Function Main
....
fConecta() /* conecta el scanner a Comm3 */
.....
Return
*-------------------------------------------------------------*
Static Procedure fConecta()
*-------------------------------------------------------------*
local f_Com := "COM3"
local f_BaudeRate := 9600
local f_databits := 8
local f_parity := 0 //ninguno
local f_stopbit := 1
local f_Buff := 8000
nHandle := Init_Port( f_Com , f_BaudeRate , f_databits , f_parity , f_stopbit , f_Buff )
If nHandle > 0
Principal.StatusBar.Item(1) :=" Scanner Conectado a COM:3"
lConectado := .T.
OutBufClr( nHandle )
Else
Principal.StatusBar.Item(1) := "Verifique los valores, no se puede establecer la conexion"
lConectado := .F.
EndIf
Return