38 / 69
Web to serial test
Web to serial needs user’s webpage programming ability. Design webpage, request own device’s data
and process data then reveal the results on webpage. According to chapter4.1.17 Customized Webpage, can
download revised webpage into USR-N520 .
1. Build a connection and connect to USR-N520
function connectx(){
try{
socket=new WebSocket('ws://'+window.location.host+':6432');
socket.binaryType = "arraybuffer";
}catch(e){
alert('error');
return;
}
socket.onopen = sOpen;
socket.onerror=sError;
socket.onmessage=sMessage;
socket.onclose=sClose
}
2. Receive Data Function
function sMessage(msg)
3. Send data function
function send()
Summary of Contents for USR-N520
Page 1: ...1 69 User Manual File Version V1 0 4 ...
Page 17: ...17 69 UDP Client Software Configuration UDP Client Testing Screenshot ...
Page 27: ...27 69 2 Set modbus slave software refer to the following ...
Page 28: ...28 69 3 Return result for query command is as drawing ...
Page 33: ...33 69 Drawing 26 Self Defined Heartbeat Function ...
Page 35: ...35 69 2 Testing result ...
Page 37: ...37 69 Web to Serial COM Send Receive Data ...
Page 40: ...40 69 2 Set Printer Driver ...
Page 59: ...59 69 Software Configuration Full Show ...
Page 69: ...69 69 ...