I spend the every looking and testing samples to read the USB port from FW
I did not succeed.
I can read/write arduino serial data from the Node-Red application from USB port 5. So it is possible to collect data from a Arduino true a USB port. How to read this data from it ?
Maybe it is important to have a usb to com hardware in FW ? But other programs seems to manage them from the USB port.
Any Help ?
USB reading/writing as Com port
- Marc Venken
- Posts: 1482
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
- cmsoft
- Posts: 1294
- Joined: Wed Nov 16, 2005 9:14 pm
- Location: Mercedes - Bs As. Argentina
- Been thanked: 1 time
Re: USB reading/writing as Com port
Generally, when it is necessary to manage a device that connects via the USB port but responds to a serial structure, there are serial port emulators.
Here in Argentina, there are fiscal drivers that use that functionality, and they can be managed with Fivewin's COM port management functions.
Here in Argentina, there are fiscal drivers that use that functionality, and they can be managed with Fivewin's COM port management functions.
- Marc Venken
- Posts: 1482
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
Re: USB reading/writing as Com port
Thanks, So i looked and find a program link CoolTerm, Free, Small and doing what you say. I have to test it this evening.
But it is software, so mayby FiveWin has also a Lib for this ? If I plugin my handscanner, FW can read this and it is also on a USB, but I suppose that this is not the same.
So If Coolterm is needed, I will have a txt/csv file that is updated very fast in realtime, and I can put my Arduino data into the file.
How will FW capture the data from that file (this is updated) and show result in a FW dialog. Just Open if with a fOpen function ? FW will be fast enough ?
My goal is to manage my Arduino RobotArm with FW design Dashboard. FW on Top )) !!
But it is software, so mayby FiveWin has also a Lib for this ? If I plugin my handscanner, FW can read this and it is also on a USB, but I suppose that this is not the same.
So If Coolterm is needed, I will have a txt/csv file that is updated very fast in realtime, and I can put my Arduino data into the file.
How will FW capture the data from that file (this is updated) and show result in a FW dialog. Just Open if with a fOpen function ? FW will be fast enough ?
My goal is to manage my Arduino RobotArm with FW design Dashboard. FW on Top )) !!
Marc Venken
Using: FWH 23.08 with Harbour
Using: FWH 23.08 with Harbour
- karinha
- Posts: 7910
- Joined: Tue Dec 20, 2005 7:36 pm
- Location: São Paulo - Brasil
- Been thanked: 3 times
- Contact:
Re: USB reading/writing as Com port
Look,
Regards, saludos.
Code: Select all | Expand
#include "FiveWin.ch"
/*
Reconocer puerta USB
Local aUnidades:=aDrives()
FOR xI=1 TO LEN( aUnidades )
IF GetDriveType( aUnidades[xI] )=2
?"USB"
ELSEIF GetDriveType( aUnidades[xI] )=3
?"HDISK"
ELSEIF GetDriveType( aUnidades[xI] )=5
?"CDROOM"
ENDif
NEXT
*/
FUNCTION Integrar()
LOCAL aUnidades := aDrives(), Pendrive := '', uni := 0, XI
FOR xI = 1 TO Len( aUnidades )
IF GetDriveType( aUnidades[ xI ] ) = 2
Uni := GetDriveType( aUnidades[ xI ] )
Pendrive := aUnidades[ xI, 1 ] + ':'
ENDIF
? Pendrive
// ELSEIF GetDriveType( aUnidades[xI] )=3
// ?"HDISK"
// ELSEIF GetDriveType( aUnidades[xI] )=5
// ?"CDROOM"
NEXT
IF uni == 2
IF File( PenDrive + 'Evs.txt' )
COPYFILE( 'Bak.rar', PenDrive + 'Bak.rar', .F. )
ELSE
// el correcto es MsgYesno()
IF MsgInfo( OemToAnsi( 'Este nÆo e o PenDrive de Backup' ), + CRLF + ;
'Deseja copiar mesmo assim?', OemToAnsi( 'Aten‡Æo' ) )
COPYFILE( 'Bak.rar', PenDrive + 'Bak.rar', .F. )
ENDIF
ENDIF
ELSE
MsgStop( 'Insira o PenDrive na entrada USB e tente novamente' )
ENDIF
RETURN( Pendrive )
// fin / end
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341