Hantec CPU/LIU Lighting communication driver

 

Hantec CPU/LIU Lighting communication driver is the driver to communicate with CPU/LIU(HT-130I) lighting controller of Hantec Electronics in Korea.

 

1. Read settings

 

<Figure 1> is read setting example of Hantec CPU/LIU Lighting communication driver. 

<Figure 1>  Read setting example of Hantec CPU/LIU Lighting communication driver

Device part of  <Figure 1> input Com Port(COM1), Baud Rate(19200), Parity Bit(0), Data Bit(8), Stop Bit(1) respectively according to setting of controller.

 

Hantec CPU/LIU Lighting communication driver read schedule

Read schedule setting parameters are as follows:

1) STATION – Don't care.

2) Read command – Read command = i, g, p, I_LOCK, G_LOCK, P_LOCK. ( Refer to <Table 1> )

3) Read start address – don't care.

4) Save start address for Communication Server – saveing start address of Communication Server.

5) Read size – read size = fixed to 1. ( refer to <Table 1> )

 

Read schedule example) 

READ,     1,     i,     0,    0,   1,

READ,     1,     g,     0,  100,   1,

READ,     1,     p,     0,  150,   1,

 

<Table 1> is data saving address and contents of  Hantec CPU/LIU Lighting communication driver.

Read command Contents Data Saving Address
I Read of indivisual T/U status

Start Add + 0 : 0 T/U, 0 ~ 3 bit = 0 ~ 3 relay status vaule,

4 bit = T/U use/don't use(1 = use, 0 = don't use)

Start Add + 1 : 1 T/U, 0 ~ 3 bit = 4 ~ 7 relay status value ¡¦.

¡¦

Start Add + 63 : 63 T/U, 0 ~ 3 bit = 252 ~ 255 relay status value.

G Read of group status

Start Add + 0 : 0 ~ 3 bit = 0 ~ 3 Group use/don't use, 5 bit = always 1

Start Add + 1 : 0 ~ 3 bit = 0 ~ 3 Group On/Off, 4 bit = always 1

Start Add + 2 : 0 ~ 3 bit = 4 ~ 7 Group use/don't use, 5 bit = always 1

Start Add + 3 : 0 ~ 3 bit = 4 ~ 7 Group On/Off, 4 bit = always 1

¡¦

Start Add + 30 : 0 ~ 3 bit = 60 ~ 63 Group use/don't use, 5 bit = always 1

Start Add + 31 : 0 ~ 3 bit = 60 ~ 63 Group On/Off, 4 bit = always 1

P Read of pattern status

Start Add + 0 : 0 ~ 3 bit = 0 ~ 3 Pattern use/don't use, 5 bit = always 1

Start Add + 1 : 0 ~ 3 bit = 0 ~ 3 Pattern On/Off, 4 bit = always 1

Start Add + 2 : 0 ~ 3 bit = 4 ~ 7 Pattern use/don't use, 5 bit = always 1

Start Add + 3 : 0 ~ 3 bit = 4 ~ 7 Pattern On/Off, 4 bit = always 1

¡¦

Start Add + 10 : 0 ~ 3 bit = 20 ~ 23 Pattern use/don't use, 5 bit = always 1

Start Add + 11 : 0 ~ 3 bit = 20 ~ 23 Pattern On/Off, 4 bit = always 1

I_LOCK Read of indivisual T/U Lock status

Start Add + 0 : 0 T/U value, 0 ~ 3 bit = 0 ~ 3 relay Lock status value,

Start Add + 1 : 1 T/U value, 0 ~ 3 bit = 4 ~ 7 relay status value ¡¦.

¡¦

Start Add + 63 : 1 T/U value, 0 ~ 3 bit = 252 ~ 255 relay status value.

G_LOCK Read of group Lock status

Start Add + 0 : 0 ~ 3 bit = 0 ~ 3 Group Lock status value,

Start Add + 1 : 0 ~ 3 bit = 4 ~ 7 Group Lock status value,

¡¦

Start Add + 15 : 0 ~ 3 bit = 60 ~ 63 Group Lock status value,

P_LOCK Read of pattern Lock status

Start Add + 0 : 0 ~ 3 bit = 0 ~ 3 Pattern Lock status value,

Start Add + 1 : 0 ~ 3 bit = 4 ~ 7 Pattern Lock status value,

¡¦

Start Add + 6 : 0 ~ 3 bit = 20 ~ 23 Pattern Lock status value,

<Table 1> Data saving address and contents of  Hantec CPU/LIU Lighting communication driver

 If you click the icon  in protocol option part, you can see the dialogue box such as <Figure 2>. you can also set read schedule by using this part.

<Figure 2> Example of Hantec CPU/LIU Lighting communication driver¡¯s Option dialogue box

You can set read schedule by using , , button and listbox of <Figure 2>. 

<Figure 3> Example of Hantec CPU/LIU Lighting communication driver¡¯s read schedule Add/Edit dialogue box

When you click Add button or Edit button in dialogue box of <Figure 2>, dialogue box of <Figure 3> is shown.

 

2. Writing settings

You can control Hantec CPU/LIU Lighting controller by using write settings.

 

Digital Write

Digital write setting parameters are as follows:

1)  PORT                   Port no. (0 ~ 255)

2)  STATION             Don't care.

3)  ADDRESS          Relay, group, pattern number.

Extra2 = 0 : decimal unit indivisual relay number(0 ~ 255), group number(0 ~ 63), pattern number(0 ~ 23),

Extra2 = 1 : decimal unit data saving address. (refer to <Table 1>) 

4)  Extra1                   Write command = I, G, P.

I : indivisual relay control,

G : group control,

P : pattern control,

I_LOCK : Lock setting of indivisual relay,

G_LOCK : Lock setting of group,

P_LOCK : Lock setting of pattern.

5)  Extra2                   Selection read or write command.   1 = read command,  0 = write command.

 

Write example 1)

PORT : 0   STATION : 0   ADDRESS : 0004  EXTRA1 :  I  EXTRA2 : 0

The setting parameter shown above is 4 indivisual relay(1 T/U 1st relay) control(On/Off) example.

 

Write example 2)

PORT : 0   STATION : 0   ADDRESS : 0007  EXTRA1 :  I  EXTRA2 : 0

The setting parameter shown above is 7 indivisual relay(1 T/U 3rd relay) control(On/Off) example.

 

Write example 3)

PORT : 0   STATION : 0   ADDRESS : 0009  EXTRA1 :  I  EXTRA2 : 0

The setting parameter shown above is 9 indivisual relay(2 T/U 2nd relay) control(On/Off) example.

 

Write example 4)

PORT : 0   STATION : 0   ADDRESS : 0000  EXTRA1 :  G  EXTRA2 : 0

The setting parameter shown above is 0 Group control(On/Off) example.

 

Analog Write

Analog write and digital write have the same setting parameters except output value.( output value : off = 0, on = 1 )

 

Block Write

Block write comes to be executed by ¡®PlcScanWriteBlock¡¯ script function.

Available script of write command are G_SET, P_SET, P_ONOFF.  G_SET = group setting command,  P_SET = pattern setting command,  P_ONOFF = pattern On/Off setting command.

<Table 2> is write command and setting parameter for Block write.

 

Note) Output value for Block write of Hantec CPU/LIU Lighting communication driver have to set 'byte' unit data and data range equal 0 ~ 15(4 bit status value). 

Write command Contents Address range Output value
G_SET group setting command 0 ~ 63 group ID

byte unit data, data size =  1 ~ 64.

max 64 T/U data. Off setting when don't input data,

T/U data input range = 00h ~ 0Fh.

 group On/Off = each bit data : 4 setting data exist for each T/U.

P_SET pattern setting command 1 ~ 25 pattern ID
P_ONOFF pattern On/Off setting command
<Table 2> Write command and setting parameter for Block write

Script name and type : @PlcScanWriteBlock(int port, int station, int address, string extra1, string extra2, object array_value, int array_size);

 

Scripting example of Block write)

byte   writeVal[5];

 

writeVal[0] = 0;

writeVal[1] = 15;

writeVal[2] = 15;

writeVal[3] = 0;

writeVal[4] = 0;

@PlcScanWriteBlock(0, 0, 1, ¡°G_SET¡±, ¡°¡±, writeVal, 5);

 

Note) Block write is supported 10.1.4.3 version or higher.

 

3. Connection of communication cable

 Connection of communication cable is as follows.

 

Connection of RS-232C communication cable

Please connect normal(cross) RS-232C communication cable to RS-232C socket of Hantec CPU/LIU Lighting such as <Figure 4>.

<Figure 4> is connection example of RS-232C communication cable to Hantec CPU/LIU Lighting controller

1
<Figure 4> Connection example of RS-232C communication cable to Hantec CPU/LIU Lighting controller