RHU communication driver is the driver to communicate with RHU automatic insertion machine controller.
<Figure 1> is read setting example of RHU communication driver.
<Figure 1> Read setting example of RHU communication driver |
Device part of <Figure 1> input com port( COM1 ), baud rate( 4800 ), parity bit( 0 ), data bit( 8 ), stop bit( 1 ) according to setting of controller.
Read schedule for RHU communication driver
Read schedule for RHU communication driver input 'READ' one line.
RHU communication driver can Download, Upload operation information data.
Error, complete status
RHU communication driver save error and complete status for Download, Upload to memory such as <Table 1>.
Also save to 'c:\error_msg000.txt' file for error status.
Contents | Memory address | Address for Digital Input Tag |
error status | 1st bit of WORD memory | 0000 |
complete status for Download, Upload, ... | 2nd bit of WORD memory | 0001 |
<Table 1> Contents and address for error, complete status |
Note) RHU communication driver always set On for error, complete status bit when occur error, complete status.
So, you should to set Off after read the status bit such as follows.
Memory data Off setting method of Communication Server) You can set 'Off' the memory data by using Extra1 : '#mem#' at Digital, Analog Output Tag.
You can Download, Upload, ... 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 don't care.
4) Extra1 write command = CMD_FILE, DOWNLOAD, UPLOAD. ( refer to <Table 2> )
4) Extra1 overwrite selection when UPLOAD command.
0 : don't overwrite Upload data when same file exist.
1 : overwrite Upload data when same file exist.
<Table 2> is write command and setting method of RHU communication driver.
Write command | Usage | Writing, reading data |
Remakrs |
CMD_FILE | - | command data = read 1st line data of 'C:\cmd_file%03d.txt' ( %03d = port number ) file |
can send long length command data |
DOWNLOAD | send write command after pressing DOWNLOAD, UPLOAD switch | input Download data file after command |
example) DOWNLOAD 1.TXT ( 1.TXT = file of 'work folder\DATA' folder ) |
UPLOAD | input 2 filename after command, 1st filename = arbitray name, 2nd filename = Uploaded data saving file |
example) UPLOAD 1.TXT UP\UP123.TXT (UP123.TXT = file of 'work folder\DATA\UP' folder ) |
|
<Table 2> Write command and setting method of RHU communication driver |
Note) Arbitray filename of UPLOAD write command use for equal paramter with UICS, VCD communication driver.
Write example 1)
PORT:0, station:0, ADDRESS:0000, Extra1: cmd_file, Extra2 : 1, 1st line contents of 'C:\cmd_file000.txt' file ='UPLOAD 1.txt up\rhu.txt'
The setting parameter shown above is write command sending example.
Communication driver get from 1st line data of 'C:\cmd_file000.txt', Command = UPLOAD 1.txt up\rhu.txt.
Above setting is UPLOAD command example. after writing, the Uploaded data save at 'rhu.txt'.
If exist 'rhu.txt' file, communication driver overwrite with Uploaded data.
( 1.txt = Arbitray filename )
Write example 2)
PORT:0, station:0, ADDRESS:0000, Extra1: cmd_file, Extra2 : 1, 1st line contents of 'C:\cmd_file000.txt' file ='DOWNLOAD downdata\dn02.txt'
The setting parameter shown above is write command sending example.
Communication driver get from 1st line data of 'C:\cmd_file000.txt', Command = DOWNLOAD downdata\dn02.txt.
Above setting is DOWNLOAD command example. The downloading data get from 'dn02.txt'.
Analog Write
Analog write and digital write have the same setting parameters except output value.
Setting example for error, complete status bit of RHU communication driver are as follows :
1) Make Digital Input Tag for error, complete status bit at SCADA Server.
2) Create script such as <Table 3>, <Figure 2> to 'Script when program running'. This script show error message box at SCADA Server when occur error.
3) You can make 'complete' status message box same method as avove.
Function of script | Contents |
show message box at SCADA Server when occur error | if($err_check == OFF) { flag = OFF; return; } if(flag == ON) return;
handle = @FileOpen("C:\\error_msg000.txt", "r"); if(handle == 0) return;
len = @FileRead(handle, buf, 79); @FileClose(handle);
buf[len] = 0; @Message(buf); flag = ON; $err_flag_clear1 = OFF; |
<Table 3> Script example for error message box |
<Figure 2> Script example for error message box at Studio |