Msb642ra DC Manual Eng
Msb642ra DC Manual Eng
2. Always use the product within its specifications and ratings. from www.ComfileTech.com for free.
◆ Download Cable
- Risk of fire and shortening of product’s life.
3. Do not exceed ratings of relay switching contacts. If your PC has a built-in RS-232C (serial port), it can be used to download programs to the
◆ MSB LOGIC
4. Does not use in environments with flammable or explosive materials, MSB. If not, a USB-to-serial (RS-232C) adapter can be used.
moisture, direct sunlight, radiation, vibration and/or shock. Originally, the MSB series could only be programmed with CUBLOC Studio, which
supports both BASIC and Ladder Logic. However, some users are not familiar with
5. Keep product free of dust and debris. RS-232 3-pin Download Cable USB-To-Serial + 3-pin Download Cable
6. Make connections correctly and confirm polarity by measuring at the BASIC and prefer to use Ladder Logic exclusively.
appropriate terminals.
Therefore, we have created MSB LOGIC, a Ladder Logic development environment
► CE/KCC designed specifically for the MSB series. If you prefer to do your development in Ladder
Logic, you can now use MSB LOGIC to program the MSB series industrial controllers.
Note: The download cable is not included, and must be purchased separately.
It can be downloaded from www.ComfileTech.com for free.
If using a USB-to-Serial adapater, you must install the necessary drivers to your PC. After
the driver is installed, the PC will assign it a COM port number (e.g. COM6). In Cubloc
Studio's PC Interface Setup, select this COM port.
◆ BASIC I/O Map
◆ Parts Description
Direction Range Input Voltage Description
same as MSB632RA-dc.
Input Port 8 ~ 31 0V or 24VDC 1 if input is 24V
(20V to 28V is recognized 0 if input is 0V
as a logic high)
Output Port 32 ~ 49 10A Relay Outputs If 1, Relay is ON
If 0, Relay is OFF
Analog Inputs Ch 0~7 0~3 (0~20mA) Use “ADIn(0~7)” to read
4~7 (0~10V) input
Example)
Low 32 'Turn OFF output port number 32
A = In(10) 'Read state of input at port number 10
VA = ADIn(0) 'Read analog input from channel 0
By default, all IO is controlled by BASIC at power on. Ladder Logic must be given
permission to use it using the UsePin command.
◆ Status LED
The MSB6xxRA-DC has a status LED that can be used to indicate the product's operating
state. It can be controlled in BASIC using via pin 64. ON > 16V OFF < 13V
Proximity sensors can be used to detect the existence, movement, and displacement of Recommended Operating Voltage 6 ~ 27VDC / 6 ~ 240VAC
objects without any physical contact with the object. They are used quite often in the field
On/Off frequency 10Hz (10 times per second)
of automation.
Maximum Current 10A per relay
◆ Communication Specifications
#include “MSB6XX”
#include “MSB6XX” Do
Do If In(8) = 1 Then
High 64 High 64 'Status LED On
Wait 500 High 32 'Relay 32 On
Low 64 Else
Wait 500 Low 64 'Status LED off
Loop Low 32 'Relay 32 Off
EndIf
Loop
The following shows how to connect the two together. The UIF-5k must be powered
Blinking the status LED while using Ladder Logic
separately with a 9V~24V supply.
#include “MSB6XX”
Set Ladder On
Do
_F(64) = 1
Wait 500
_f(64) = 0
Wait 500
Loop The same behavior using Ladder Logic
You'll find Ladder Logic to be quite easy for handling simple logic.
The following source code will output text to the UIF-5K's display.
2.Toggle Relay
#include “MSB6XX”
Toggle Status LED and relay number 32. OpenCom 1, 115200, 3, 30, 20
Set UIF 2, 1
Cls
#include “MSB6XX” Wait 200
Do Print 27, 80, 1 ' Buzzer On
High 64 'Status LED On CLCDOut 1, 0, “UIF-5K with MSB”
High 32 'Relay 32 On
Wait 500
Low 64 'Status LED Off
Low 32 'Relay 32 off
Wait 500
Loop
The source code will display a key's scan code when it is pressed. ◆ Interfacing with a CLCD module ◆ Using Modbus
A CLCD module is a character LCD module that can be easily interfaced to any Cubloc-based The following source code illustrates how to use Modbus
#include “MSB6XX” device.
OpenCom 1, 115200, 3, 30, 20
Set UIF 2, 1 #include “MSB6XX”
Cls OpenCom 1, 115200, 3, 50, 50
Wait 200 Set Modbus 1, 1, 20
Print 27, 80, 1 ' Buzzer On Set Ladder On
CLCDOut 1, 0, “UIF-5K with MSB” Do
Loop
Dim I as Integer
Dim RX_KEY as Integer
Do The diagram below shows how to connect to a PC.
Incr I
CLCDOut 1, 2, Dec I
Wait 500
A MSB6XX series device can be connected to a CLCD module via RS-232. Be sure the CLCD's
Loop
dip switches are on, and the baud rates of both devices are set to 115200. The following
shows the wiring.
RXD
GND
TXD
' Key press event handler
KEYIN_OCCUR: 1 2 3 4 5
RX_KEY = Get(1, 1)
CLCDOut 10, 2, Hex, RX_KEY
6 7 8 9
Return PC RS232C
The following source code illustrates how to display text to a CLCD module.
#include “MSB6XX”
Each time a key is pressed, a receive interrupt occurs via RS-232 and in turn fires the
Set Display 2, 1, 115200, 50
KEYIN_OCCUR event handler. The event handler reads the scan code and displays it on the
Cls
character LCD.
Wait 200
CLCDOut 1, 0, “CLCD WITH MSB6XX”
◆ Analog Input Example ◆ Dimensions
The following source code illustrates how to use analog inputs. Results are displayed in the
PC's debug terminal.
#include “MSB6XX”
Dim AD as Integer
Do
AD = ADIn(0) 'Read from channel 0
Debug Dec AD, Cr
Delay 1000
Loop
#include “MSB6XX”
Dim AD as Integer
Do
AD = ADIn(4) 'Read from channel 4
Debug Dec AD, Cr
Delay 1000
Loop
◆ Modbus Address
Word Address
Holding/Input Registers
Function : 3,4,6,16
Address Area
0 ~ 255 D (D0 ~ D255)
256 ~ 355 Y (Y0 ~ Y99)
A/D result :
Y20~Y27: 276 ~283
1000 ~ 1255 T (T0 ~ T255)
2000 ~ 2255 C (C 0~ C255)
3000 ~ 3255 WM (WM0 ~ WM255)
Bit Address
Coil, Input Status
Function : 1,2,4,15
Address Area
0 ~ 127 P (P0 ~ P127)
4096 ~ 6143 M (M0 ~ M2047)