TREND CNC Protocol

 

TREND CNC Controller is the driver to communicate with CNC controller of Trend Control Systems Ltd., in English.

1. Read settings

 

<Figure 1> is read setting example of TREND CNC communication driver.

<Figure 1> Read setting example of TREND CNC communication driver

Device part of <Figure 1> input Com Port(COM1), Baud Rate(9600), Parity Bit(1), Data Bit(7), Stop Bit(1).

 

Notice) TREND CNC controller's Parity, Data and Stop Bit are fixed to 1, 7 and 1, also, enter the communication speed by selecting among 1200, 4800, 9600 (Default) and 19200 which are set at controller.

 

Read schedule example

READ Station Read type Start address Memory save address Read size
READ, 11, AI, 0, 0, 32,
READ, 11, DI, 0, 32, 10,
READ, 11, B, 18, 50, 5,
FLOAT, 11, K, 1, 0, 20,
FLOAT, 11, A, 1, 20, 10,

1) Station : Station number of TREND CNC controller(0, 1, 4 ~ 127).

Notice) It is station number of each device, not station number of CNC2 communication module.

2) Data Type to Read : Data type to read(refer to <Table 1> ~ <Table 6>).

(A, S, D, L, F, K, B, I, W, G, AI, DR, DI, LR or A_STS, S_STS, D_STS, L_STS, F_STS, K_STS)

3) Read Start Address : Read start address of each data address to read.

AI, DR, DI, LR data address : From 0 address.

Etc : From 1 address.

4) Save Start Address for Communication Server : Memory address to save the read current value or status value (WORD, DWORD< FLOAT memory)

5) Read Size : Size to read.

Notice) Reading B data is read size x eight bit value.

 

Generally, analog current value such as A, S, D, L, F and K are displayed as float type number (decimal point 2 digit), so write read schedule as FLOAT.

And status value data area such as B, I, W, G, A_STS, S_STS, D_STS, L_STS, F_STS and K_STS is written as READ.

Also, if you write AI, DR and LR area as READ(or FLOAT), current value is saved at FLOAT memory and status value is saved at WORD memory, and DI data area always saved at WORD memory.

Data type to read Contents Read value Remarks
A, S, D, L, F, K Analog data FLOAT Decimal point 2 digit(default)
B Bit data current value (status value) 1 Byte (8 Bit) Usually used as WORD
I, W, G 1 Bit
A_STS, S_STS, D_STS,
L_STS, F_STS, K_STS
Analog status value 1 Byte (8 Bit)
AI, DR, LR AI, Driver, Loop read only Current value + Status value Current value - Save to FLOAT memory,
Status value - Save to WORD memory
DI Digital Input Current value(status value) Current value(status value) - WORD memory
<Table 1> Contents and read value for data classification to read
Data type to read Contents Address range Analog area address
A (Current value), A_STS(Status value) Analog 1 ~ 255  
S (Current value), S_STS(Status value) Sensor 1 ~ 48 1 ~ 48
D (Current value), D_STS(Status value) Driver 1 ~  
L (Current value), L_STS(Status value) Loop Output 1 ~ 32 61 ~ 92
F (Current value), F_STS(Status value) Function 1 ~ 120 101 ~ 220
K (Current value), K_STS(Status value) Knob 1 ~ 30 221 ~ 250
<Table 2> Contents and address range of analog data area
Data type to read Contents Address range Bit area address
B Bit 1 ~ 505  
I Digital Input 1 ~ 48 1 ~ 6
W Switch 1 ~ 20 18 ~ 20
G Logic Output 1 ~ 88 21 ~ 31
<Table 3> Contents and address range of digital data area
Data type to read Contents Address range
AI Analog Input 0 ~ 31
DR Driver 0 ~ 31
DI Digital (Binary) Input 0 ~ 47
LR Loop 0 ~ 31
<Table 4> Contents and address range of read only data area
Bit postion AI DR LR
0 Bit High Alarm status value Read back Alarm Setpoint Deviation
1 Bit Low Alarm status value - Present Value Fail
2 Bit Outside Limits status value Loop in Manual
3 Bit Read Error status value -
Table 5> Save contents classified bit of each WORD memory for AI, DR, LR read
Bit postion Contents Remarks
0 Bit Current Status of Input 0 : OFF,   1 : ON
1 Bit Normal Status of Input
2 Bit Alarm Enable Status 0 : Disabled,   1 : Enabled
<Table 6> DI readÀÇ each WORD memoryÀÇ save contents classified by bit

Refer to TREND CNC Controller Manual about detailed data of TREND CNC Controller and contents of each data area.

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

<Figure 2> Example of TREND CNC controller communication driver's Option dialog box

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

<Figure 3> Example of TREND CNC controller communication driver's read schedule Add/Edit dialog box

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

 

2. Writing settings

Write to direct address of controller, regardless of SCAN File.

 

Digital Write

Digital write setting parameters are as follows:

1) PORT           Port number connected with TREND CNC controller. (Not COM number)

2) STATION      Station number(0, 1, 4 ~ 127).  Station number of each controller.

3) Address      Output address.

A, S, D, L, F, K  : Analog address to output between 0001 and 0255(or over),

B  :  High 3 digit - 001 ~ 505 WORD address,

Sub 1 digit - 0 ~ 7 BIT address,

I, W, G  :  Digital address to output between 0001 and 0088(or over),

4) Extra1          Data area to output.

A, S, D, L, F, K – Write analoge current value,(write only 0 and 1 value when setting is digital output)

B, I, W, G – Write digital current value(ON/OFF).

5) Extra2          Don't care.

 

Write example 1)

Port : 0  Station : 11  Address : 0180  Extra1 : B,  EXTRA2 : Blank

The setting parameter shown above is example of controlling(ON/OFF) first BIT value( B18.0  - B10(S0) ) of no.18 BYTE of TREND CNC controller connected with port no.0 and station no.11.

 

Write example 2)

Port : 0  Station : 11  Address : 0001  Extra1 : W,  EXTRA2 : Blank

The setting parameter shown above is example of controlling(ON/OFF) W1 current value( W1(S0) ) of TREND CNC controller connected with port no.0 and station no.11.

 

Analog Write

Analog write setting parameters are as follows:

1) PORT           Port number connected with TREND CNC controller. (Not COM number)

2) STATION      Station number(0, 1, 4 ~ 127).  Station number of each controller.

3) Address      Output address.

A, S, D, L, F, K  :  Analog address to output between 0001 and 0255(or over),

B  :  High 3 digit - 001 ~ 505 WORD address,

Sub 1 digit - 0 ~ 7 BIT address,

I, W, G  :  Digital address to output between 0001 and 0088(or over),

4) Extra1          Data area to output.

A, S, D, L, F, K – Write analoge current value,

B, I, W, G – Write digital current value(ON/OFF).

5) Extra2          Don't care.

 

Write example 1)

Port : 0  Station : 11  Address : 0221  Extra1 : A,  EXTRA2 : Blank

The setting parameter shown above is example of changing no.221( A221(V) ) analog value of TREND CNC controller connected port no.0 and station no.11 as specified value.

 

Write example 1)

Port : 0  Station : 11  Address : 0001  Extra1 : K,  EXTRA2 : Blank

The setting parameter shown above is example of changing K1( K1(V) ) analog value of TREND CNC controller connected port no.0 and station no.11 as specified value.

 

3. Communication cable connection and communication setting 

 

Communication cable connection

Generally, TREND CNC controller must have communication module NBOX/CNC2 device of TREND Co. to be communicated.

Connect general RS-232C communication cable to 25 pin connector of CNC2 device and 9 pin(or 25pin) connector of computer.

<Figure 4> Example of connecting TREND CNC2 communication module with controller

Communication cable connection of CNC2 and TREND controller

Connect R+, R- line of TREND controller to T+, T- terminal of CNC2 device,

Connect T+, T- line of TREND controller to R+, R- terminal(Connection as Multi Drop system : n, m at below are controller station random number).

 

CNC2 side                     no.n controller side                     no.m controller side

Tx+  --------------------------------- Rx+  --------------------------------- Rx+

Tx-  --------------------------------- Rx-  --------------------------------- Rx-

Rx+  --------------------------------- Tx+  --------------------------------- Tx+

Rx-  --------------------------------- Tx-  --------------------------------- Tx-

 

Station setting of CNC2 and TREND controller

You can set station setting among 0, 1, 4 ~ 127 by using DIP switch(8 switches) which are attached to each device.

<Figure 5> Station setting DIP switch