You are on page 1of 9

Page 1

CEV.vi
C:\Users\Eduardo\Dropbox\Tesis\control electronico de velocidad\INTERFAZ LABVIEW\ENERO\CEV.vi
Last modified on 18/02/2016 at 12:17 p. m.
Printed on 18/02/2016 at 12:50 p. m.
Connector Pane

CEV.vi

Flow Control
Stop Bits
Puerto
Baud rate
N° de bits
Paridad
The Basic Serial Read and Write example performs a Serial Port Read, a Serial Port Write, or a combination of these
actions. The user selects the actions (read or write) on the front panel. If both are selected, the VI will write the data
first, read data, and then close the VISA session that is opened to the port. This VI will wait until the specified numb
of bytes is received at the port or until a termination character is read.

INSTRUCTIONS:
1) Select the serial resource and configuration parameters (baud rate, data bits, parity, stop bits, flow control).
2) Select the operations to be performed.
3) Connect the serial port to your device. If no device is available, perform a loopback test by doing one of the
following. Short pins 2 and 3 on a RS-232 cable or short pin 4 to pin 8 and pin 5 to pin 9 on a RS-485/422 cable.
4) Run the VI to see the data read. (The "read string" will match the "string to write" if a loopback test was performe

Note: The parameters set for the serial port must match the parameters of the connected instrument or device. In th
example, the bytes to read parameter specifies the number of bytes that the serial port reads. If there were more by
at the port than the number specified in bytes to read, those bytes would not be read. Also, if you specify to read m
bytes than the number of bytes actually read, you might receive a timeout error message.

On the block diagram, the Configure Serial Port VI sets the configuration parameters. The front panel displays the
controls used to configure the basic parameters, such as baud rate, data bits, and parity. Constants configure the oth
parameters the user probably does not need set. After the VISA Configure Serial Port VI opens the VISA session and
configures the port, the VI passes the VISA resource name to other VIs that perform operations on that VISA resourc
The VISA Write function sends a command to the serial device and the VISA Read function returns data based on th
command. The VISA Close function then closes the reference to the serial device. It is important to close the
reference; otherwise communication through with that port through protocols other than VISA might not be
possible.
Page 2
CEV.vi
C:\Users\Eduardo\Dropbox\Tesis\control electronico de velocidad\INTERFAZ LABVIEW\ENERO\CEV.vi
Last modified on 18/02/2016 at 12:17 p. m.
Printed on 18/02/2016 at 12:50 p. m.
Front Panel

VOLTAJES Motor1 0 RPM VELOCIDADES ANGULARES Motor2 0 RPM UP DIRECCIÓN


Baterías Banco de UC Bus
Tank DC 40 40
30 30 30
LEFT RIGHT
25 25 25 30 30
Radio (cm)
Uso de teclado
20 20 20 28.5
20 20 BACK
15 15 15
Corriente Motor 1 0.00 A CORRIENTES
10 10 10 10 10
40
5 5
0 0
0 0 0 0 5 10 15 20 0 5 10 15 20 30
0.00 V 0.00 V 0.00 V Tiempo Tiempo
20
CONFIGURACIÓN
DEL XBEE
MENÚ DE
Puerto Setpoint Velocidades Angulares ENVÍO 10
COM1
Motor 1
1) VELOCIDAD Velocidad Medida
Error LINEAL (m/s)
Baud rate 0
Velocidad Lineal (m/s) de Plataforma (m/s) 0 5 10 15 20
Estado Código 115200 0 RPM
Time
0 Paridad
Fuente de error Motor 2 1.75
2
1.75
2
None 1.5 Enviar velocidad 1.5 Corriente Motor 2 0.00 A
Stop Bits
0 RPM 2.25 2.25 40
1.25 1.25
1.0 Setpoint 2.5 0 2.5
1 Carga inicial UC 1
N° de bits Velocidad 30
Lineal (m/s) 2.75 2.75
8 0.75 0.75
0 20
Dato
3 3
Transmitido 0.5 ETAPA DE 0.5
REGENERACIÓN 10
3.25 3.25
251 0.25 0.25
Resistencia
0 3.57 0 3.57 0
de Disipación
FIN DEL 0 5 10 15 20
PROGRAMA Time
Page 3
CEV.vi
C:\Users\Eduardo\Dropbox\Tesis\control electronico de velocidad\INTERFAZ LABVIEW\ENERO\CEV.vi
Last modified on 18/02/2016 at 12:17 p. m.
Printed on 18/02/2016 at 12:50 p. m.
Block Diagram

timeout (10sec)
10000 Configure Serial port (baud rate, data bits,
Puerto parity, stop bits and flow control).

Baud rate

True

UP

N° de bits 8
BACK
Uso de teclado249
Paridad
UP BACK False
2000000 LEFT
RIGHT Dato Transmitido
Stop Bits Disabled Disabled

Flow Control LEFT

1 Disabled datosent

Motor 2

Motor 1 Motor2 Motor 1


UP BACK
Radio (cm) Setpoint Velocidad Lineal (m/s)
Visible
0 Disabled Disabled
10
0, Default
Boolean 30 2000
LEFT RIGHT Velocidades Angulares (RPM)
Visible
Disabled Disabled Visible
254
MENÚ DE ENVÍO
Velocidad Lineal (m/s) Radio (cm)
Motor 1
Radio (cm)

100
0.285 30

Motor 2
OK Button
Boolean

Acquire Input Data.vi 0


True

"RIGHT"

0
Uso de teclado 249
UP

DOWN
datosent

RIGHT

LEFT

1 0, Default Default True


Boolean
Uso de teclado False
Visible 255
Velocidades Angulares (RPM)
246

Dato Transmitido
Motor 1 Motor2 True
Boolean
246
2 Disabled

"UP"

247

"DOWN"

248
Page 4
CEV.vi
C:\Users\Eduardo\Dropbox\Tesis\control electronico de velocidad\INTERFAZ LABVIEW\ENERO\CEV.vi
Last modified on 18/02/2016 at 12:17 p. m.
Printed on 18/02/2016 at 12:50 p. m.

400

0 True
False
0

ValorB

Instr
Bytes at Port
0 False

ValorU

255
0 False
0
1
2
3 1
1 4 Motor1
5 Motor 1
6
7

8
9
False
0
251 motor 2 d

Motor 2 1 M

0 False

Corriente Motor 1
8

0 False

Corriente Motor 2

0 True
True
0 Valor Bus

True True False True True True True


Valor Bus False
True False True
0 0 0 0 True
Motor1
0
Corriente Motor 2 ValorU
Corriente Motor 1 False
ValorB Motor 1
8 8

Valor Bus Motor 2


False False
False True True
ValorB
False
Motor1 ValorU
Corriente Motor 1 Corriente Motor 2
8 8 Motor 1

Motor 2
Page 5
CEV.vi
C:\Users\Eduardo\Dropbox\Tesis\control electronico de velocidad\INTERFAZ LABVIEW\ENERO\CEV.vi
Last modified on 18/02/2016 at 12:17 p. m.
Printed on 18/02/2016 at 12:50 p. m.

True

ValorB
27
250

ValorB

Baterías
9

0
ValorU

motor1 datos
ValorU
27
250

Banco de UC
Motor1
10
datos
Write To Write To
Write To
Motor2 Measurement Measurement
Measurement
Motor2 File3 File4
File
motor1 datos Signals motor 2 datos Signals
Signals

Valor Bus

Valor Bus

27
250

Write To Write To Write To


Measurement Measurement Measureme
10
File2 File5 File6
Signals Signals Signals
Tank

Corriente Motor 1 Corriente Motor 2


4 Resistencia
Carga inicial UC 0, Def
de Disipación

ETAPA DE REGENERACION

0, 0,

0, Def 0, Def

Motor2

1
1

Motor2
Page 6
CEV.vi
C:\Users\Eduardo\Dropbox\Tesis\control electronico de velocidad\INTERFAZ LABVIEW\ENERO\CEV.vi
Last modified on 18/02/2016 at 12:17 p. m.
Printed on 18/02/2016 at 12:50 p. m.

motor1 datos
Velocidad Medida
motor 2 datos de Plataforma (m/s)
2000

30
Radio (cm)

10

285

ent
Page 7
CEV.vi
C:\Users\Eduardo\Dropbox\Tesis\control electronico de velocidad\INTERFAZ LABVIEW\ENERO\CEV.vi
Last modified on 18/02/2016 at 12:17 p. m.
Printed on 18/02/2016 at 12:50 p. m.

Error

Note:Closing the serial port


allows it to be used by other
applications without quitting
Close Input Device.vi
LabVIEW.
Page 8
CEV.vi
C:\Users\Eduardo\Dropbox\Tesis\control electronico de velocidad\INTERFAZ LABVIEW\ENERO\CEV.vi
Last modified on 18/02/2016 at 12:17 p. m.
Printed on 18/02/2016 at 12:50 p. m.
1 "LEFT" False
Uso de teclado 247
250
BACK LEFT

Disabled Disabled
False
1 RIGHT

Disabled

0
0

2
Uso de teclado
UP 248
255

Disabled LEFT
1 Disabled
RIGHT

Disabled

4
Uso de teclado
250
UP

Disabled BACK

Disabled
1 RIGHT

Disabled
Page 9
CEV.vi
C:\Users\Eduardo\Dropbox\Tesis\control electronico de velocidad\INTERFAZ LABVIEW\ENERO\CEV.vi
Last modified on 18/02/2016 at 12:17 p. m.
Printed on 18/02/2016 at 12:50 p. m.
False

You might also like