B&B Electronics ADAM-6066 - Manual User Manual
Page 117
107
Chapter 5
palStatus.setBackground(Color.lightGray);
palAdamStatus.setBackground(Color.lightGray);
palStatus.setBounds(new Rectangle(42, 50, 409, 15 *2 + 0 * 2 + 77 +
152 + 33 ));
pal1.setBounds(new Rectangle(12, 15 , 385, 77));
pal2.setBounds(new Rectangle(12, 15 + 77 + 0 , 385, 152));
palAdamStatus.setBounds(new Rectangle(12, 15 + 77+0*2+ 152, 385,
33));
palStatus.setLayout(null); pal1.setLayout(null);
pal1.add(labStartAddress, null); pal1.add(txtStartAddress, null);
pal1.add(labCount, null); pal1.add(txtCount, null);
pal1.add(btAdam6060, null);
labStartAddress.setBounds(new Rectangle(20, 15, 85, 20));
txtStartAddress.setBounds(new Rectangle(205, 15, 60, 20));
labCount.setBounds(new Rectangle(20, 40, 180, 20));
txtCount.setBounds(new Rectangle(205, 40, 60, 20));
btAdam6060.setBounds(new Rectangle(275, 40, 80, 22));
btAdam6060.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(MouseEvent e) {//mouse event handling
int i, j;
long lAddress, lCount;
byte ModBusRTU[] = new byte[128];
if
(Adam6060Connection.ReadCoil((int)Long.parseLong(txtStartAd-
dress.getText()), (int)Long.parseLong(txtCount.getText()), Mod-
BusRTU))
{
lAddress = Long.parseLong(txtStartAddress.getText());
for( i = 0; i < Long.parseLong(txtCount.getText()); i++)
{