Source language: Translate to:

Read contact closure from NB

Using NeoBook to control external hardware and devices.

Moderator: Neosoft Support

NeoBook & Arduino

Postby virger » Tue Sep 23, 2014 9:56 pm

Hello.
I would like to contribute something; of the past 7 months using the library (gtRS232free7.nbp), I could do some things, like the communication of NB-Arduino by USB cable, via BlueTooth, USB control via cart, use of shield-ethernet / internet via NB, from MySitio.com, make NB send commands to Arduino and the reverse, and more. I leave it to your attention this example, the first thing I did in Feb / 2014. A PUB and INO, the latter ran the Arduino Uno and Mega -2560. I must say that my first attempt was using "vbs" and BasicLiberty a program to read the serial port and the data passing through "clipboard." If there's interest in these just ask me. Thanks for reading.

PUB
Code: Select all
NBW Publication Source File
(C)2014 NeoSoft Corp.
Title=Ejemplo Arduino
Author=GdoSan-Feb/2014
Language=US
NeoBookVer=5.80
ScreenColors=16777216
ScreenWidth=640
ScreenHeight=480
BkndColor=0
ScreenAutoSize=Yes
LinkColor=16711680
WindowStyle=0
WindowOrder=0
WindowPos=0
WindowProps=29
BiDiMode=0
AllowESC=No
AllowPageUpDn=No
UseUpdateTimer=Yes
ReturnTime=60
StartupAction=if "[NbMode]" "=" "D"¶    ObjectToFront "RcTapa"¶    ObjectToFront "Gr"¶    moveobject "BtPause" "250" "20"¶    hideobject "BtPause" "" ""¶endif
ShutdownAction=gtCommClose "[Prt]"
ShapeTransColor=536870912
SplashProps=3
CompressPub=Yes
CompiledName=ArduinoNeobook.exe
CompileType=0
MediaType=0
FilesIncluded=1
FontsIncluded=2
FontsToCompile=|
CopyExternalFiles=No
SetupMedia=3
SetupInstDir=C:\MyProgram
SetupTitle=Setup
SetupColors=16711680|0|65535
VersionMajor=1
VersionMinor=0
VersionRelease=0
VersionBuild=0
ReqExLevel=1
CustomFontName=Arial
CustomFontSize=9
CustomFontStyle=0
CustomCharset=1
CacheSize=30
ExtractOp=132
L_OK=OK
L_CANCEL=Cancel
L_YES=Yes
L_NO=No
L_CLOSE=Close
L_ERRORTITLE=Error
L_FINDTITLE=Find
L_FINDPROMPT=Find &What
L_FINDFIRST=&Find First
L_FINDNEXT=Find &Next
L_FINDERROR=Search text not found.
L_PWORDTITLE=Password required
L_PWORDMSG=Before continuing, you must first|enter the correct password.
L_PWORDPROMPT=&Password:
L_PWORDERROR=That's not the right password!
L_MEDIAERROR=In order to play this type of file you must install|the appropriate multimedia hardware and/or|software.
L_INTERNETERROR=Unable to locate Internet Browser software.
L_ABORTFUNCTION=Do you want to cancel this function?
L_EXTRACTERROR=This file could not be extracted and cannot be played.
L_INSTDIRPROMPT=Please enter the drive and directory where you would like this program to be installed. To accept the default drive and directory, simply press Enter.
L_INSTFOLDERPROMPT=Do you wish to create a program folder?
L_INSTRUNPROMPT=Do you want to run
L_INSTDISKPROMPT=Please insert disk #
L_INSTDISKERROR=That's not the correct disk, try again.
L_INSTGENERROR=The installation has terminated.
L_INSTEXITPROMPT=Do you really want to cancel the installation?
L_INSTWINTITLE=Setup
L_INSTPROGTITLE=Extracting Files...
L_SENDEMAIL=Sending Mail...
L_MAILSERVER=Please enter the name of your outgoing email server:
L_COPY=Copy to Clipboard
L_SELECTALL=Select All
L_DONWLOADFILE=Downloading: %s
L_PLEASEWAIT=Please wait...
TrayMenuBegin
MenuName=TrayOpen
MenuText=Open
MenuState=3
MenuKey=0
MenuAction=SetVar "[WindowState]" "Normal"
MenuName=TrayExit
MenuText=Exit
MenuState=3
MenuKey=0
MenuAction=Exit "" ""
MenuEnd
MasterPage
NewPage=Main
PageStyle=0
PageColor=10262272
PageGradient1=16711680
PageGradient2=255
PageGradientDir=1
WallpaperStyle=0
EffectSpeed=0
PgEnterAction=setvar "[Prt]" "3"
ObjectType=8
Name=InfColor
X=75
Y=-80
W=60
H=15
Anchor=0
Font=Arial
FontSize=9
FontStyle=1
FontCharset=1
TextColor=16777215
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;\red0\green0\blue0;}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\margh720\margf720{\*\pnseclvl1\pnucrm\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl2\pnucltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl3\pndec\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl4\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{)}}}¶{\*\pnseclvl5\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl6\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl7\pnlcrm\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl8\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl9\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶\endnhere\sectdefaultcl{\pard{\qc\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0\b 0,151,156}}¶}
HMargin=0
VMargin=0
LineColor=0
LineWidth=0
LineStyle=0
FillColor=10262272
FillPattern=0
TabOrder=4
ObjectType=15
Name=Tm
X=609
Y=2
W=32
H=32
Anchor=0
AutoStart=No
Interval=1000
ObjAction=gtCommRxS "[Prt],numbytes,ret"¶.gtCommRx "[Prt]"
ObjectType=5
Name=RcTapa
X=39
Y=11
W=320
H=122
Anchor=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=10262272
FillPattern=0
TabOrder=12
ObjectType=3
Name=BtEnviar
X=161
Y=62
W=55
H=30
Anchor=0
Text=Enviar
Align=2
Key=13
ImageStyle=0
XPTheme=Yes
ObjAction=TimerStop "Tm"¶HideObject "EntRet" "None" "0"¶¶gtCommSend "[Prt],[enviar]"¶¶.gtCommRxS "[Prt],1,return"¶.gtCommRxFlush "[Prt]"¶.Delay "10"¶TimerStart "Tm" "[Retardo]"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=2
ObjectType=9
Name=EntEnviar
X=44
Y=62
W=113
H=30
Anchor=0
Text=123~
VarName=[enviar]
Align=1
EditLen=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16777215
FillPattern=0
FillMode=Yes
Font=Arial
FontSize=14
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=3
ObjectType=3
Name=BtRecibir
X=250
Y=20
W=55
H=30
Anchor=0
Text=Recibir
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=setvar "[byte]" ""¶setvar "[buff]" ""¶setvar "[retrx]" ""¶setvar "[numbytes]" ""¶setvar "[Retardo]" "200"¶. CREO LEE DE 1 EN 1 BYTE¶.gtCommRxByte    'port,¶.                 byte,¶.                 buff'¶.    Receive data from an¶.    open comm port¶.--gtCommRxByte "[Prt],byte,buff"¶.--gtCommRxFlush "[Prt]"¶¶¶.gtCommRxS (port,return var name,number of bytes)¶..gtCommRxS "[Prt],numbytes,ret"¶ShowObject "EntRet" "None" "0"¶timerstart "Tm" "[Retardo]"¶ShowObject "BtPause" "None" "0"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=6
ObjectType=3
Name=BtArduFast
X=312
Y=20
W=40
H=20
Anchor=0
Text=Fast
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=TimerStop "Tm"¶math "[Retardo]-50" "" "[Retardo]"¶delay "25"¶TimerStart "Tm" "[Retardo]"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=11
ObjectType=3
Name=BtArduSlow
X=312
Y=63
W=40
H=20
Anchor=0
Text=Slow
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=TimerStop "Tm"¶math "[Retardo]+50" "" "[Retardo]"¶delay "25"¶TimerStart "Tm" "[Retardo]"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=8
ObjectType=8
Name=InfRetardo
X=312
Y=40
W=40
H=20
Anchor=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;\red0\green0\blue0;}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\margh720\margf720{\*\pnseclvl1\pnucrm\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl2\pnucltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl3\pndec\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl4\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{)}}}¶{\*\pnseclvl5\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl6\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl7\pnlcrm\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl8\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl9\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶\endnhere\sectdefaultcl{\pard{\qc\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 [Retardo]}}¶}
HMargin=0
VMargin=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
TabOrder=10
ObjectType=9
Name=EntRet
X=44
Y=94
W=200
H=30
Anchor=0
VarName=[Ret]
Align=1
WordWrap=No
ScrollBar=No
EditLen=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=10262272
FillPattern=0
Font=Arial
FontSize=14
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=13
ObjectType=3
Name=BtPause
X=188
Y=20
W=55
H=30
Anchor=0
Text=Pause
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=timerstop "Tm"¶HideObject "BtPause" "None" "0"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=1
ObjectType=20
Name=Gr
X=49
Y=25
W=132
H=31
Anchor=0
TabOrder=14
GroupBegin
ObjectType=3
Name=BtClosePort
X=31
Y=0
W=100
H=30
Anchor=0
Text=Cerrar Puerto
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=gtCommClose "[Prt]"¶showobject "BtOpenPort" "" ""¶EnableObject "EnPort"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=0
ObjectType=3
Name=BtOpenPort
X=32
Y=1
W=100
H=30
Anchor=0
Text=Abrir Puerto
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=gtCommOpenStd "[Prt],9600"¶HideObject "BtOpenPort" "None" "0"¶HideObject "RcTapa" "None" "0"¶DisableObject "EnPort"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=1
ObjectType=9
Name=EnPort
X=0
Y=0
W=28
H=30
Anchor=0
VarName=[Prt]
Align=1
EditNumber=Yes
EditLen=1
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=14
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=2
GroupEnd
ObjectType=8
Name=InfHelp
X=-241
Y=-334
W=300
H=277
Anchor=0
Font=Arial
FontSize=9
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;\red0\green0\blue0;}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\margh720\margf720{\*\pnseclvl1\pnucrm\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl2\pnucltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl3\pndec\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl4\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{)}}}¶{\*\pnseclvl5\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl6\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl7\pnlcrm\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl8\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl9\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶\endnhere\sectdefaultcl{\pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtComms V7.01 PlugIn G Turner\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 (RS232 Communications Plugin for NeoBook)\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtOpenCommErr\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommErr\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommRIT\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommRTTM\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommRTTC\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommWTTM\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommWTTC\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommEof\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtTcpErr\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtTcpEof\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 ABC123\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 Open-Close\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommOpen\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommOpen (port,baud,bits,parity,stop,txbuffer,rxbuffer)\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommOpenStd\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommOpenStd (port,baud) \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 \tab A simpler way to open a port using default values (See the help file)\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommClose\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommClose (port) Closes an open comm port\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 Port Settings\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommSetBaud\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommSetBaud 'port,baud' \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 \tab Change baud rate on an open comm port\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommSetTxBuffer\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommSetTxBuffer 'port,buffer' \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 \tab Change TX buffer on an open comm port\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommSetRxBuffer\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommSetRxBuffer 'port,buffer' \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 \tab Change RX buffer on an open comm port\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 Transmit data\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommSend\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommSend 'port,data' \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 \tab Send data to an open comm port\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommSendCRLF\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommSendCRLF 'port,data' \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 \tab Send data to an open comm port with a CR & LF\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 Receive data\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommRxByte\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommRxByte 'port,byte,buff' \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 \tab Receive data from an open comm port\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommRxS\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommRxS (port,return var name,number of bytes)\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommRx\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommRx 'port,filename,bytecountvar' \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 \tab Write RX buffer to file\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommRx\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommRxLine\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommRxLine 'port,var,timeout (mS*10)'\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommRxFlush\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommRx 'port' \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 \tab Flush RX Buffer\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 Port Information\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommRxCount\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommRxCount 'port,num bytes' \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 \tab Get count of bytes in the RX buffer\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommGetBaud\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommGetBaud 'port,baud var' \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 \tab Get the current baud rate for the specified port\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 Flow Control\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommXonXoff\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtCommXoXoff 'port,setting' \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 \tab Set software flow control. 1=On, 0=Off\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 TCP Client Comms\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtTCPopen\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtTCPopen 'host,port,timeout'\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtTCPclose\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtTCPclose ''\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtTCPsend\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtTCPsend 'data to send'\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtTCPsendCRLF\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtTCPrxbyte\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtTCPrxbyte 'var to store byte'\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtTCPrxline\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtTCPrxline 'var to store line'\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtTCPrxF\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtTCPrxF ''\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtTCPrxFT\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtTCPrxFT '' with timeout\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 \par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 gtTCPrxFlush\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs18\cf0 Flush any waiting bytes}}¶}
HMargin=4
VMargin=4
LineColor=0
LineWidth=1
LineStyle=0
FillColor=16777215
FillPattern=0
TabOrder=15
ObjectType=8
Name=InfDebug
X=375
Y=12
W=230
H=65
Anchor=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;\red0\green0\blue0;}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\margh720\margf720{\*\pnseclvl1\pnucrm\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl2\pnucltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl3\pndec\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl4\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{)}}}¶{\*\pnseclvl5\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl6\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl7\pnlcrm\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl8\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl9\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶\endnhere\sectdefaultcl{\pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 gtOpenCommErr: [gtOpenCommErr]\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 gtCommErr: [gtCommErr]\par¶\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs20\cf0 gtCommEof: [gtCommEof]}}¶}
HMargin=4
VMargin=4
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
TabOrder=16
ObjectType=3
Name=BtQuit
X=288
Y=99
W=50
H=27
Anchor=0
Text=Quit
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=TimerStop "Tm"¶gtCommRxFlush "[Prt]"¶Exit "" ""
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=7
ObjectType=15
Name=TmLinea
X=97
Y=195
W=32
H=32
Anchor=0
AutoStart=No
Interval=1000
ObjAction=.setvar "[mS]" "1"¶gtCommRxLine "[Prt],data,timeout(mS*10)"
ObjectType=3
Name=BtIniTimer
X=38
Y=160
W=96
H=35
Anchor=0
Text=([Data])
Align=1
ImageStyle=0
XPTheme=Yes
ObjAction=TimerStart "TmLinea" "100"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=12
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=17
ObjectType=3
Name=BtTimerStop
X=141
Y=160
W=40
H=35
Anchor=0
Text=[mS]
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=TimerStop  "TmLinea"¶math "[mS]+2" "" "[mS]"¶TimerStart "TmLinea" "100"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=12
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=20
ObjectType=3
Name=BtLeeArduinoData
X=224
Y=166
W=160
H=35
Anchor=0
Text=gtCommRxF
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=..GUARDA LOS DATOS QUE VIENEN DEL ARDUINO¶setvar "[FileName1]" "[PubDir]SacaData1.txt"¶setvar "[FileName2]" "[PubDir]SacaData2.txt"¶¶setvar "[ByteCountVar1]" "1"¶setvar "[ByteCountVar2]" "2"¶¶..Probar con # valor¶gtCommRx  "[Prt],[FileName1],[ByteCountVar1]"¶delay "500"¶gtCommRxF "[Prt],[FileName2],[ByteCountVar2]"¶¶fileread "[PubDir]SacaData1.txt" "All" "[TxData1]"¶fileread "[PubDir]SacaData2.txt" "All" "[TxData2]"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=12
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=18
ObjectType=9
Name=EnData1
X=208
Y=208
W=90
H=190
Anchor=0
VarName=[TxData1]
Align=1
EditMultiLine=Yes
EditLen=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=12
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=22
ObjectType=9
Name=EnData2
X=315
Y=208
W=90
H=190
Anchor=0
VarName=[TxData2]
Align=1
EditMultiLine=Yes
EditLen=0
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=12
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=21
ObjectType=8
Name=Text15
X=455
Y=117
W=176
H=145
Anchor=0
Font=Arial
FontSize=12
FontStyle=0
FontCharset=1
TextColor=0
Text={\rtf1\ansi\deff0\deftab254{\fonttbl{\f0\fnil\fcharset1 Arial;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;\red128\green128\blue128;\red0\green0\blue0;\red0\green0\blue0;}\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\margh720\margf720{\*\pnseclvl1\pnucrm\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl2\pnucltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl3\pndec\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{.}}}¶{\*\pnseclvl4\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb}{\pntxta{)}}}¶{\*\pnseclvl5\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl6\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl7\pnlcrm\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl8\pnlcltr\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶{\*\pnseclvl9\pndec\pnstart1\pnhang\pnindent720{\pntxtb{(}}{\pntxta{)}}}¶\endnhere\sectdefaultcl{\pard{\ql\li0\fi0\ri0\sb0\sl\sa0 \plain\f0\fs24\cf0 [ret]}}¶}
HMargin=4
VMargin=4
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
TabOrder=23
ObjectType=3
Name=BtEnvRec
X=456
Y=266
W=78
H=30
Anchor=0
Text=Env/Rec
Align=2
ImageStyle=0
XPTheme=Yes
ObjAction=TimerStop "TmLinea"¶¶TimerStop "Tm"¶HideObject "EntRet" "None" "0"¶gtCommSend "[Prt],[enviar]"¶delay "50"¶setvar "[byte]" ""¶setvar "[buff]" ""¶setvar "[retrx]" ""¶setvar "[numbytes]" ""¶setvar "[Retardo]" "200"¶¶ShowObject "EntRet" "None" "0"¶timerstart "Tm" "[Retardo]"¶ShowObject "BtPause" "None" "0"
LineColor=0
LineWidth=1
LineStyle=0
FillColor=12632256
FillPattern=0
Font=Arial
FontSize=10
FontStyle=0
FontCharset=1
TextColor=0
TabOrder=5


INO
Code: Select all
// ArduNeo.ino
// SE PEGA CON EL "ARDUINO1.PUB"
int    Led      = 13;
int    Lento    = 100;
int    Data     = 0;
String sg       = "S";
char   byt ;
String StrEntra = "";
boolean StrListo = false;



void setup() {
  StrEntra.reserve(200);
  Serial.begin(9600);
  pinMode(Led, OUTPUT);
  digitalWrite(Led, HIGH);
  Serial.println("POTENCIOMETRO");
  Serial.println( "~" + String(Lento) + "~");
  delay(2000);
  Inicio( 0 );
  Serial.println("--- REGRESO ---");
}



void loop() {
  digitalWrite(Led, HIGH);
  delay(Lento);
  Serial.println( Data );
  digitalWrite(Led, LOW);
  delay(Lento);
  if ( sg == "S" )
  {
    Data += 64;
    if (Data >= 1024) {
      sg = "R";  // Resta
    }
  }
  else
  {
    Data -= 64;
    if (Data <= 0) {
      sg = "S";  // Suma
    }
  }
  if (Serial.available() > 0) {
    byt = Serial.read();
    if ( byt == 65 || byt == 97) // Aa
    {
      StrListo = false;
      xserialEvent();
    }
    if ( byt == 83 || byt == 115) // Ss
    {
      Serial.println("ALTO");
      Inicio( 0 );
      Serial.println("...REGRESO...");
      return;
    }
  }
}



void Inicio(int flg ) {
  Serial.flush() ;
  Serial.print("Le llevo [");
  Serial.print(Serial.available());
  Serial.println("]");
  while (Serial.available() <= 1 ) {
    digitalWrite(Led, HIGH);
    delay(50);
    digitalWrite(Led, LOW);
    delay(50);
  }
  byt = Serial.read();
  Serial.print("Recibio: (");
  Serial.print(byt);
  Serial.println(")");
  if ( byt == 65 )
  {
    xserialEvent();
    Serial.println("YA VINE");
  }
  digitalWrite(Led, LOW);
  delay(2000);
  return ;
}


void xserialEvent() {
  while (Serial.available()) {
    char ChrEntro = (char)Serial.read();
    if (ChrEntro == 48 ) {
      Serial.println("TONCES: " + StrEntra);
      digitalWrite(Led, HIGH);
      delay(2000);
      StrListo = true;
    }
    StrEntra += ChrEntro;
  }
}


DESDE COSTA RICA
SOMOS PURA VIDA
COSTA RICA
PURA VIDA
User avatar
virger
 
Posts: 524
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central

Re: Read contact closure from NB

Postby djpilot » Sat Jan 17, 2015 8:15 pm

Hi all,
I have just stumbled across this thread by accident. I am the person that created the gtRS232free7 plugin.
I have not developed it for quite some time however there have been some changes and improvements since the version you are all discussing.

I am now happy to distribute the plugin for free, but I can't see anyway to attach it to this post.
If anyone is interested, send me a message with your email and I can send it to you.

Kind regards
Glendon
djpilot
 
Posts: 21
Joined: Sun Jun 19, 2011 8:03 pm

Re: Read contact closure from NB

Postby ebear » Sun Jan 18, 2015 5:50 am

Hello Brendon,

Very interesting to see you here on the forum. I tried several times to get in contact with you eg. Via your website but always without response.
I'm one of the persons on this forum who is doing a lot of development around hardware communication. Although I'm on the moment very busy with some other projects not regarding NB I would like to try the updated version of your plugin. My email Beerhorst.eric@gmail.com.

Thanks a lot for you reaction.

Best regards,

Eric Beerhorst
http://www.lunarsoftware.eu - Lunar Software ERP database Development. Manufacturing processes, Document management, QMS, Stock management. Standalone solutions or connected to Helios Orange and other ERP systems.
User avatar
ebear
 
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic

Re: Read contact closure from NB

Postby Gaev » Sun Jan 18, 2015 7:24 am

djpilot:

I am now happy to distribute the plugin for free, but I can't see anyway to attach it to this post.


You can post it on the NeoBook Resource Center here ... http://www.neosoftware.com/neobook/modules/MainMenu/
User avatar
Gaev
 
Posts: 3728
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Read contact closure from NB

Postby djpilot » Fri Jan 23, 2015 2:31 am

Hi All,

I have temporarily uploaded it to http://www.gjturner.net.au/gtComms3.zip (57,342 bytes) and it will remain there for several weeks from today. Maybe till the end of Feb.

Please not that there are several errors in the pdf help file. I just had a quick look through it and noticed several.
I would appreciate if you send me a PM if you download it so that I can at least have an idea of who is using it. Also if you agree, I may contact you in the future if I further develop the plugin.

Kind regards to all.
djpilot
 
Posts: 21
Joined: Sun Jun 19, 2011 8:03 pm

Re: Read contact closure from NB

Postby Neosoft Support » Fri Jan 23, 2015 12:00 pm

If you would like a more permanent place to store your plug-in I would be happy to host it on neosoftware.com.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5602
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Read contact closure from NB

Postby sakismorGR » Sat Mar 04, 2017 9:56 am

Hello to everyone,

I would like to know if someone have the plugin gtComms3 and can uploaded or to send it to my email direct sakismor@gmail.com. Please if someone have it send it.

Best regards
User avatar
sakismorGR
 
Posts: 91
Joined: Sat Apr 29, 2006 10:21 pm
Location: Kavala-Greece

Re: Read contact closure from NB

Postby mishem » Sat Mar 04, 2017 12:34 pm

mishem
 
Posts: 575
Joined: Mon Oct 08, 2012 1:51 pm

Previous

Return to Neobook and Hardware Control

Who is online

Users browsing this forum: No registered users and 0 guests