Anda di halaman 1dari 5

Page 1

Steamdrum.vi
C:\Documents and Settings\Administrator\Desktop\labview\steamDrum\Steamdrum.vi

Last modified on 4/3/2011 at 1:05 PM


Printed on 4/3/2011 at 1:06 PM
Connector Pane
Steamdrum.vi

SLAVE 1 FUNCTION CODE 04


flow control
stop bits
COM PORT NAME
baud rate
data bits
parity

Port Enable
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 number of bytes is received at
the port. Only the number of bytes specified will be 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 performed.)
Note: The parameters set for the serial port must match the parameters of the connected instrument or device. In this example,
the bytes to read parameter specifies the number of bytes that the serial port reads. If there were more bytes at the port than
the number specified in bytes to read, those bytes would not be read. Also, if you specify to read more 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 other 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 resource. The VISA Write function sends a
command to the serial device and the VISA Read function returns data based on the 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
Steamdrum.vi
C:\Documents and Settings\Administrator\Desktop\labview\steamDrum\Steamdrum.vi

Last modified on 4/3/2011 at 1:05 PM


Printed on 4/3/2011 at 1:06 PM
Front Panel

SERIAL SETING

40

20

COM1

60

WFT2

29

FSP2

40

FOP2

34

MAN

34

80
100

0
baud rate
9600

Manual Mode

data bits

OUTPUT STEAM FLOW CONTROLLER

BOILER FEED WATER FLOW CONTROLLER

COM PORT NAME

20

40

SFT1 88

80
100

40

60

FSP1 40

FOP1 0
Manual

MAN

8
parity
None

1.0

100

flow control
None

100
delay (ms)

80

100

60

LSP

30

90
80

TSP

40

STEAMER

70

LOP

60

150

MAN

50

125

40

100

30

75

20

50

10

25

40

string

{A4}

20

read buffer

EXIT

LEVE

Manual

Port Enable

{A4"( (X(

TEMP 34

LEVEL
CONTROLLER

stop bits

EXIT

DEARATATOR TANK

BOILER FEAD PUMP STEAM DRUM UNIT REBOILER UNIT

Page 3
Steamdrum.vi
C:\Documents and Settings\Administrator\Desktop\labview\steamDrum\Steamdrum.vi

Last modified on 4/3/2011 at 1:05 PM


Printed on 4/3/2011 at 1:06 PM
Block Diagram

EXIT

Configure Serial port (baud rate,


data bits, parity, stop bits and flow control).
delay (ms)

Enable Termination Char (T)


timeout (10sec)

Close session to port.

10000

True

True

COM PORT NAME

Slide

SLAVE 1 FUNCTION CODE 04

baud rate

data bits

Instr
Bytes at Port

parity
Read the number of
bytes specified.

Write bytes to port .

stop bits
Port Enable

flow control

123
TEMP
65

DEARATATOR TANK

REBOILER UNIT
SLAVE 1 FUNCTION CODE 04

52

TSP

string

125

LEVEL

100

STEAM DRUM UNIT

read buffer
LSP

BOILER FEED WATER FLOW CONTROLLER


unsigned byte array[0]

WFT2

unsigned byte array[1]


unsigned byte array[2]
unsigned byte array[3]

LSP2

unsigned byte array[4]

OUTPUT STEAM FLOW CONTROLLER

unsigned byte array[5]


unsigned byte array[6]
unsigned byte array[7]

SFT1
FSP1

unsigned byte array[8]


unsigned byte array[9]
unsigned byte array[10]
unsigned byte array[11]
0

unsigned byte array[12]


0

unsigned byte array[13]

STEAMER

unsigned byte array[14]

False

FEED FLOW_CTRL

FOP2

FSP2
FOP2

WFT2
50

True

LOP

FSP2
FSP2
SFT1

False
LEVEL_CTRL
LSP
0
LOP

LOP
LEVEL

50

STEAM FLOW_CTRL
False
FSP1

0
FOP1

FOP1
50
SFT1

BOILER FEAD PUMP

Page 4
Steamdrum.vi
C:\Documents and Settings\Administrator\Desktop\labview\steamDrum\Steamdrum.vi

Last modified on 4/3/2011 at 1:05 PM


Printed on 4/3/2011 at 1:06 PM
True

True

True

MAN
FOP1

MA N

MA N
LOP

FOP2

Page 5
Steamdrum.vi
C:\Documents and Settings\Administrator\Desktop\labview\steamDrum\Steamdrum.vi

Last modified on 4/3/2011 at 1:05 PM


Printed on 4/3/2011 at 1:06 PM
False

LSP2

False

FSP2

False

Anda mungkin juga menyukai